Lion Cipher Lab

Engineer detections over Google Cloud Audit Logs: catch a service-account impersonation chain (offline)

Why it matters

The GCP authorization lab in this catalog proved that the signature Google Cloud privilege escalation is service-account impersonation: hold iam.serviceAccounts.getAccessToken on a service account and your effective permissions become that account's, transitively, across projects and folders. That lab answered 'who CAN do this?'. This lab answers the question a defender actually gets paged for: 'is someone doing it RIGHT NOW, and can I prove it from the logs?'. The honest answer is uncomfortable. A room of cloud engineers will tell you Cloud Audit Logs record everything -- and they are wrong…

What you'll learn

Steps in this lab

  1. The question this engine answers: five alerts are not an incident
  2. Set up: one folder, one file, no installs
  3. Model the REAL Cloud Audit Log entry shape
  4. Build the synthetic log stream: ~200 benign events plus honest noise
  5. Plant the multi-stage attack: grant, impersonate, persist, exfiltrate
  6. Small accessors on the real log shape
  7. The headline rule: correlate the impersonation CHAIN
  8. The supporting single-event rules, and why they are noisier
  9. Run it with Data Access logging ON: the measured results
  10. The failure mode nobody warns you about: Data Access logs are OFF by default
  11. The judgment: where these rules live, and how to build them better
  12. Contrast with the AWS CloudTrail detection lab, and why you must never ship this

Open the full interactive lab →