Skip to content
Tutorials Center
My learning

Topics

Lesson 19 of 37 ยท Incident Response

The Incident Response Lifecycle

Learn the phases of incident response, from preparation and detection to containment, recovery and review, and how a SOC moves an incident through them.

An alert is only the start of a story. Somebody has to decide whether it is real, how bad it is, who must be told, what to switch off, and how to get back to normal without destroying evidence. Incident response (IR) is the discipline that turns that chaos into a repeatable process. Without it, every incident is improvised, and improvised responses lose data, miss attackers who are still inside, and repeat the same mistakes next month.

This lesson walks through the lifecycle that most teams follow, based on the widely used NIST model, and ends with a small program that tracks an incident through its phases.

What counts as an incident

An event is any observable occurrence: a login, a file download, a firewall block. An alert is an event (or group of events) that a rule decided deserves attention. An incident is an event that actually threatens confidentiality, integrity or availability, or violates a security policy. Most alerts are never incidents. Deciding which ones are is the main job of the first line of a SOC (see triage).

Event, alert, incident

Event A log line: something happened
Alert A rule says: look at this
Incident Real harm or policy breach

Thousands of events become dozens of alerts and a few incidents.

1 / 2

The phases

flowchart LR
    P["1. Preparation"] --> D["2. Detection and analysis"]
    D --> C["3. Containment, eradication, recovery"]
    C --> L["4. Post-incident activity"]
    L --> P
    D -. "new evidence" .-> D
    C -. "attacker still active" .-> D

The lifecycle is a loop, and you often step backward when new evidence appears.

1. Preparation

Everything you do before an incident: a written IR plan, a contact list (legal, communications, management, vendors), logging that actually covers your systems, trained people, access for responders, and a "jump bag" of tools. Practice with tabletop exercises, where the team talks through a scenario without touching real systems. Teams that prepare respond in hours; teams that do not respond in days.

2. Detection and analysis

Alerts, user reports or outside notices (a partner, a regulator, a researcher) start this phase. Analysts validate the alert, gather context, determine the scope (which hosts, accounts and data) and assign a severity. They also start the incident record: a timeline, what was seen, what was done, and who did it. Write things down as you go; memory fails fast under stress.

3. Containment, eradication and recovery

  • Containment limits damage: isolate a host from the network, disable an account, block an address. Short-term containment buys time; long-term containment (for example rebuilding a segment) keeps the business running meanwhile.
  • Eradication removes the cause: delete malicious files, close the vulnerability, reset credentials, remove persistence.
  • Recovery restores service: rebuild from clean images, restore data, monitor closely for signs the attacker returns.

The details are in containment, eradication and recovery.

4. Post-incident activity

Within days of closing, hold a blameless review: what happened, what worked, what did not, what changes. Update detections, playbooks and training. See the post-incident review.

Frameworks such as NIST SP 800-61 and the SANS six-step model (preparation, identification, containment, eradication, recovery, lessons learned) describe the same loop with different labels. Learn one, and you can read the others.

Severity and priority

Severity describes impact; priority describes how urgently you act. A typical scale:

Level Meaning Example Target response
Critical Active compromise of key systems or data Ransomware spreading Immediate, all hands
High Confirmed compromise, limited scope Admin account takeover Within 1 hour
Medium Suspicious activity, likely contained Malware blocked on one laptop Same business day
Low Policy violation, little risk Unapproved software Within days

Your organization chooses its own scale. What matters is that it is written down, so two analysts rate the same incident the same way.

Roles during an incident

An incident usually needs an incident commander who coordinates and decides, analysts who investigate, a communications lead who talks to management and customers, and legal or privacy advisors who handle notification duties. Even in a team of three, name who holds each role at the start of every incident.

Try it: track an incident through its phases

This small state machine records each phase change with a timestamp and refuses impossible jumps. It is a teaching stand-in for a ticketing system, not a real tool.

Python Incident phase tracker

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Try it: time spent in each phase

Response teams measure how long each phase takes, which later becomes metrics like MTTR (see SOC metrics).

Python Phase durations

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Common mistakes

  • Wiping the machine first. Reimaging destroys evidence you need to learn how the attacker got in. Capture memory and disk images first when the incident justifies it (evidence handling).
  • Containing too loudly. Blocking an attacker's address immediately may tip them off before you know the scope. Decide on purpose.
  • No record. Undocumented actions cannot be reviewed, audited or defended later.
  • Skipping the review. The cheapest improvement you will ever get is a one-hour meeting after the incident.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which statement best separates an alert from an incident?

    Rules raise alerts; analysts decide which of them are real incidents.
  2. 2. What is the purpose of containment?

    Containment stops things getting worse. Removing the cause is eradication and restoring service is recovery.
  3. 3. Why does the lifecycle diagram have arrows going backward?

    Investigations are iterative; finding the attacker still active sends you back to analysis.
  4. 4. Which activity belongs to the preparation phase?

    Exercises, contact lists, tooling and training happen before an incident.

Summary

  • Incident response is a repeatable loop: prepare, detect and analyze, contain/eradicate/recover, learn.
  • Events become alerts, and only some alerts become incidents.
  • Severity scales and named roles keep responses consistent.
  • Document every action with timestamps, and preserve evidence before you clean up.

Next: Triage and Alert Investigation