← All PBQs

Chapter 7

Dorothy Reviews the Emerald City Breach (Diagnostic)

Seven months after Dorothy presented her audit-response plan to the board, the board approved 'phased remediation' — a polite phrase for we'll do the easy ones first. The CASB rollout shipped. The CSPM didn't. The Lambda least-privilege refactor was in flight; the customer-managed-keys migration was scheduled for Q4. Then the news broke.

On a Saturday morning Glinda Northrop forwarded a tip: a sample of Emerald City customer records had appeared for sale on a forum. By Monday afternoon Dorothy was estimating 14.2 million records exposed — the entire cust-data-prod bucket — and had a tentative dwell time of eleven hours. CloudTrail had recorded every step; nobody had been watching it. The board's first question to Dorothy was the predictable one: Isn't this AWS's fault?

It was not.

Post-incident report — Emerald City Solutions cloud breach.   Author: D. Gale, Cloud Architect. Status: draft for board and Munchkin Industries notification. Do not forward.

Timeline (from CloudTrail, reconstructed)

  • 04:11 External request to /lookup?url=... triggers the known SSRF in customer-search-v3. The function's HTTP client follows a file:// URL to /proc/self/environ and returns the function's environment — including the execution role's temporary credentials (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN) — in the HTTP response.
  • 04:14 Attacker begins using the stolen temporary credentials from an IP address outside AWS. CloudTrail attributes every call to the Lambda role's session.
  • 04:18 ListObjectsV2 issued against cust-data-prod. Lambda role still has s3:GetObject on * — the refactor was in flight, not in production.
  • 04:21 – 15:09 14,217,883 objects pulled (each GetObject captured as a CloudTrail S3 data event). Records remain encrypted on the wire but kms:Decrypt is implicitly granted to the same role; decryption is seamless and silent.
  • Saturday a.m. Sample appears on a dark-web forum. Glinda Northrop forwards the tip.

Contributing failures

  • The Lambda role still held s3:GetObject on *. The least-privilege refactor was real work, in progress, not production.
  • The bucket was encrypted with the default AWS-managed KMS key. Because the same IAM principal had both read and decrypt rights, the encryption protected against literally no one in the attack chain.
  • CloudTrail recorded every step. No CSPM deployment, no behavioral alert against anomalous S3 bulk reads, no rate limit on outbound object retrievals. The data exited at AWS line rate over eleven hours.
  • The SSRF vector itself was a known finding from the Q3 audit. The patch was in the application-team backlog at priority 'P3 — fix this quarter.'
  • Marketing's shadow SaaS (Notion, Loom) did not contain this dataset, but the team's habit of moving data into unmanaged tenants meant several quarters of incident-response staff hours went into proving a negative before Dorothy could focus on the actual exfil path.

What the board needs to hear

Every line on the contributing-failures list lives on Emerald City's side of the line. The infrastructure operated as designed.

For each contributing failure in Dorothy's loss report, name the specific control or principle that failed.

The chain here — an application flaw that hands over the function's role credentials, then those credentials reading the data — is the textbook pattern. It is the same shape that produced the Capital One breach in 2019 (where the credentials came from the EC2 metadata service rather than a Lambda environment), and it works only because controls on the customer's side of the model were missing or wrong at every step.

The Lambda role's continued s3:GetObject on * is a direct violation of the principle the chapter names by hand. Scoping the role to just the prefixes the function actually reads would not have prevented the SSRF, but it would have bounded the data the attacker could exfiltrate to whatever the legitimate function was authorized to touch.

The AWS-managed KMS encryption did not protect the data in this incident because . This is why separating read access from decrypt authority matters: without it, encryption is a checkbox, not a control.

The eleven-hour silent exfiltration of 14 million records reflects the absence of . CloudTrail's data was there; nobody had authored a rule against it, and the CSPM that would catch configuration drift had been deferred to next fiscal.

When the board asks whether AWS is at fault, Dorothy points to the model: every contributing failure on the list above lives on Emerald City's side of the boundary. The hypervisor, the data center, and the KMS service operated correctly.

For the next fiscal quarter, Dorothy is moving the deferred Q4 work — encrypting cust-data-prod with rather than the AWS-managed key — to immediate. The point of this change is that Emerald City, not AWS, owns the key policy that decides which roles may decrypt — so a compromised principal needs an explicit grant from Emerald City's KMS authorization to read anything, and Emerald City can revoke that grant in seconds.