When to use
Use this when a security incident is suspected or confirmed — breach, malware, credential compromise, data exposure, or active intrusion. It structures a calm, evidence-preserving defensive response.
Not for: hacking back or retaliating against an attacker; destroying data before it is captured as evidence; or routine bug triage. Contain and recover — never counter-attack.
Method
- Triage & declare. Confirm the incident is real, classify severity, assign an incident lead, and open a timestamped log. Record scope: what systems, data, and accounts are involved.
- Preserve evidence. Before changing anything, capture volatile state (logs, memory, connections, disk snapshots). Decision point: if the attacker is active, weigh evidence capture against stopping ongoing damage — capture what you can, then contain.
- Contain. Isolate affected hosts, revoke compromised credentials and sessions, block malicious IPs/domains, and disable exploited paths. Prefer reversible short-term containment first.
- Eradicate. Remove malware, close the entry vector, patch the exploited weakness, and rotate all potentially exposed secrets.
- Recover. Decision point: when host integrity is in doubt, rebuild from known-good images rather than cleaning in place. Restore from verified backups, monitor for reinfection, and confirm integrity before reopening.
- Postmortem. Write a blameless timeline, root cause, impact, what worked, and concrete action items with owners and dates.
Example
Alert: a service account logs in from an unfamiliar country at 02:14. Triage confirms anomalous API calls (Sev 2). Preserve: snapshot the host, export auth logs. Contain: disable the service account, revoke its active tokens. Eradicate: rotate the leaked key found in a public gist, patch the pipeline that logged it. Recover: redeploy from a clean image, watch auth logs 48h. Postmortem action item: move CI secrets to a vault, owner @platform, due in 2 weeks.
Pitfalls
- Rebooting or "cleaning" before capturing state. Volatile evidence (memory, connections) is gone forever once you do.
- Containing loudly against an active intruder. Premature, visible action can trigger data destruction; coordinate the cutoff.
- Declaring recovery without watching for reinfection. Attackers leave persistence; monitor before you call it closed.
- Blame in the postmortem. Naming a person instead of a process gap stops people from reporting the next incident.
Output format
## Incident summary
Severity: <>. Scope: <>. Current status: <>.
## Timeline
| Time (UTC) | Event / action taken |
|------------|----------------------|
## Phase checklist
- Contain: [ ] ...
- Eradicate: [ ] ...
- Recover: [ ] ...
## IOCs
- <indicator of compromise>
## Postmortem
Root cause: <>. Impact: <>.
| Action item | Owner | Due |
|-------------|-------|-----|
1---2name: sec-incident-response3description: Drive a security incident through triage, contain, eradicate, recover, and blameless postmortem while preserving evidence.4---56## When to use78Use this when a security incident is suspected or confirmed — breach, malware, credential compromise, data exposure, or active intrusion. It structures a calm, evidence-preserving defensive response.910**Not for:** hacking back or retaliating against an attacker; destroying data before it is captured as evidence; or routine bug triage. Contain and recover — never counter-attack.1112## Method13141. **Triage & declare.** Confirm the incident is real, classify severity, assign an incident lead, and open a timestamped log. Record scope: what systems, data, and accounts are involved.152. **Preserve evidence.** Before changing anything, capture volatile state (logs, memory, connections, disk snapshots). *Decision point:* if the attacker is active, weigh evidence capture against stopping ongoing damage — capture what you can, then contain.163. **Contain.** Isolate affected hosts, revoke compromised credentials and sessions, block malicious IPs/domains, and disable exploited paths. Prefer reversible short-term containment first.174. **Eradicate.** Remove malware, close the entry vector, patch the exploited weakness, and rotate all potentially exposed secrets.185. **Recover.** *Decision point:* when host integrity is in doubt, rebuild from known-good images rather than cleaning in place. Restore from verified backups, monitor for reinfection, and confirm integrity before reopening.196. **Postmortem.** Write a blameless timeline, root cause, impact, what worked, and concrete action items with owners and dates.2021## Example2223Alert: a service account logs in from an unfamiliar country at 02:14. Triage confirms anomalous API calls (Sev 2). Preserve: snapshot the host, export auth logs. Contain: disable the service account, revoke its active tokens. Eradicate: rotate the leaked key found in a public gist, patch the pipeline that logged it. Recover: redeploy from a clean image, watch auth logs 48h. Postmortem action item: move CI secrets to a vault, owner @platform, due in 2 weeks.2425## Pitfalls2627- **Rebooting or "cleaning" before capturing state.** Volatile evidence (memory, connections) is gone forever once you do.28- **Containing loudly against an active intruder.** Premature, visible action can trigger data destruction; coordinate the cutoff.29- **Declaring recovery without watching for reinfection.** Attackers leave persistence; monitor before you call it closed.30- **Blame in the postmortem.** Naming a person instead of a process gap stops people from reporting the next incident.3132## Output format3334```35## Incident summary36Severity: <>. Scope: <>. Current status: <>.3738## Timeline39| Time (UTC) | Event / action taken |40|------------|----------------------|4142## Phase checklist43- Contain: [ ] ...44- Eradicate: [ ] ...45- Recover: [ ] ...4647## IOCs48- <indicator of compromise>4950## Postmortem51Root cause: <>. Impact: <>.52| Action item | Owner | Due |53|-------------|-------|-----|54```