Skip to content

Lesson 11 of 12 · 18m

Eradication, Recovery, and the Postmortem That Pays Rent

Kill every foothold the timeline found — sessions, OAuth grants, keys — then rebuild from before the attacker existed.

Containment stopped the bleeding. Now you have to get the attacker out of the building, put the building back, and make the incident pay rent. The wrong mental model is "reimage the box, close the ticket" — persistence lives in far more places than the disk: cloud IAM, OAuth grants, added authorized_keys, new accounts, ticket-system forwarding rules, DNS records, CI secrets. Eradication that only rebuilds the box leaves the attacker's other keys on your keyring.

Eradicate: enumerate every foothold, not just the obvious one

Work off the forensic timeline — it tells you exactly what the attacker touched, and each touch is a foothold to kill. The order matters: revoke what the attacker can use right now first (session tokens, the host's IAM role sessions, keys the host could reach), then everything adjacent.

The cautionary tale is CitrixBleed (CVE-2023-4966, October 2023). The patch closed the bug, but session tokens already issued stayed valid — organizations that patched without killing sessions kept getting breached for weeks; Boeing Distribution disclosed theirs in November. Patching is not eradication. Kill sessions, rotate credentials, verify the foothold is gone.

The positive example is Cloudflare's write-up on their October 2023 Okta incident: they treated every production credential as potentially compromised and rotated over 5,000 of them, reimaged or rebuilt every machine that could have been touched, and published the whole timeline. That is what thorough looks like — it is tedious, it is expensive, and it is cheaper than the alternative.

Recover: rebuild from before the attacker existed

Restore from an image or snapshot known to predate first contact — a backup made after initial access reintroduces the attacker with gift wrapping. Verify the image is clean (hash it, scan it, check the timeline against its build date), stage the return to service behind heightened logging, and watch egress for a soak period: if callbacks resume, your eradication list missed something, and the soak window just became the detection.

The postmortem: blameless, specific, ticketed

NIST 800-61 calls it "lessons learned" and it is the phase most orgs skip because the adrenaline is gone. The deliverable is two lists, not a vibe:

  1. The causal chain. Entry vector, what let it work, what let it spread. "Phished credential" is not a root cause; "contractor account had no phishing-resistant MFA" is.
  2. The control gaps. Every stage where you could have seen it and didn't, every credential that was broader than its job. Each gap becomes a ticket — a detection rule, a hardening change, a rotation — with an owner and a date. Tickets that never close are how the same incident happens twice.

Feed every missed stage into the detection backlog and the next adversary-emulation run (the next lesson's loop). Track real metrics — time-to-detect and time-to-contain per stage — not "number of alerts handled," which measures noise, not readiness.

Try this

Take a published incident write-up — Cloudflare's Okta postmortem, CircleCI's January 2023 disclosure — and extract the timeline, the eradication list, and the control gaps yourself. Then write the two-list postmortem for a simulated incident on a lab VM: one compromised service, one lateral move, one persistence mechanism. The format is the skill.

Field notes

  • Legal and comms belong in recovery decisions early — breach-notification clocks don't pause while you're rebuilding.
  • A postmortem that names a person instead of a control guarantees the next incident. Blamelessness isn't kindness; it's the only way to get the full causal chain on paper.
  • If "rotate everything the host could reach" feels expensive, that feeling is your least-privilege gap speaking. Narrow service roles before the incident, not after.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.