Lion Cipher Lab

Trace one attack across three services with correlation IDs: measure the timestamp join, then make it exact with W3C traceparent

Why it matters

When an incident crosses more than one service, the investigator's first job is to stitch together the pieces of one request: the gateway saw the login, auth approved it, orders exported the data, a background worker shipped it. If the logs share nothing but a timestamp and a username, that stitching is guesswork, and guesswork in an incident means either blaming a real customer for the attacker's export or missing the export entirely. This lab makes you measure that guesswork instead of assuming it: you reconstruct one attacker's chains from plain logs, grade them against an answer key, and…

What you'll learn

Steps in this lab

  1. Read this first: the scenario, and why it all stays on your machine
  2. The problem: one request, four log files, and nothing they share
  3. Set up: a terminal, Python, and a folder
  4. Build the three services and the traffic driver (stack.py)
  5. BEFORE: run it with plain-text logs and look at what an investigator gets
  6. Build the investigator and grade the timestamp join (investigate.py)
  7. AFTER: mint a traceparent at the edge, log JSON, and join on trace_id
  8. Why it worked: born at the edge, random, and carried on every hop
  9. Break it 1: the async hop that drops context
  10. Break it 2: an edge that trusts the client's traceparent
  11. Break it 3: a request ID that forges a log line (CWE-117)
  12. When NOT to hand-roll this: OpenTelemetry, and what sampling costs an investigation
  13. What you proved, and the checklist to take back

Open the full interactive lab →