LESSON 49 · INTERMEDIATE5 min read

Incident Response and Digital Forensics

Run the incident response lifecycle, make containment decisions under pressure, and preserve evidence that can withstand scrutiny.

OWASP Top 10 · MITRE ATT&CK · NIST CSF 2.0Free to readModule 10 of 14
YOUR NEXT SMALL WINS

By the end, you’ll be able to…

  • Apply the incident response lifecycle from preparation through lessons learned.
  • Make containment, eradication, and recovery decisions with incomplete information.
  • Preserve volatile and persistent evidence with a documented chain of custody.
  • Communicate with technical teams, leadership, legal, and affected users.

01The Incident Response Lifecycle

Incident response is a structured process for reducing harm when prevention fails. NIST describes four phases: preparation; detection and analysis; containment, eradication, and recovery; and post-incident activity. The phases overlap in practice. A responder may contain one host while still analysing the initial access vector.

Preparation includes plans, roles, contact lists, playbooks, backups, logging, and exercises. An incident is the wrong time to discover that the backup restore has never been tested or that nobody knows who can authorise taking a production service offline. Preparation also includes legal, privacy, communications, and human resources, because a security incident often becomes a business and regulatory event.

Detection and analysis turn a signal into a declared incident. The responder validates the alert, scopes the affected systems, identifies the initial access vector if possible, and estimates impact. Declaring an incident early is usually better than waiting for certainty. You can always downgrade. The incident commander coordinates, but does not have to be the most technical person in the room.

02Containment, Eradication, and Recovery

Containment limits spread. Options include isolating a host, disabling an account, revoking tokens, blocking a domain, segmenting a network, or shutting down a service. Each option has a cost. Isolating a hospital workstation may interrupt patient care. Disabling an account may stop a business process. The incident commander weighs security benefit against operational and safety impact with the system owner.

Eradication removes the attacker's access and the vulnerability that enabled it. This may require rebuilding hosts rather than cleaning them, rotating credentials, patching software, and removing persistence. Recovery restores service in a controlled way. Validate that the attacker's access is gone before reconnecting a system. Monitor closely after recovery because attackers sometimes return.

Preserve evidence before destructive actions when it is safe to do so. Capture volatile data first: running processes, network connections, logged-in users, memory if your process supports it, and recent command history. Then image disks or collect relevant files according to the investigation plan. The order depends on urgency and volatility. A live ransomware encryption event may require immediate isolation; a low-and-slow intrusion may allow more deliberate collection.

volatile-evidence.shShell
# Run from a trusted collection medium, not the suspect disk.date --iso-8601=seconds | tee collection-time.txthostname | tee -a collection-time.txtwhoami | tee -a collection-time.txtps auxww > processes.txtss -tunap > network-connections.txt 2>&1who > logged-in-users.txtlast -n 50 > recent-logins.txtsudo lsof -nP > open-files.txt 2>&1# Hash evidence files and record the algorithm.sha256sum processes.txt network-connections.txt logged-in-users.txt \  recent-logins.txt open-files.txt > evidence-sha256.txt# Document tool versions and the collector identity.uname -a > system-info.txtcat /etc/os-release >> system-info.txt
Outputstdout
2026-11-01T11:42:03+00:00
web01
analyst
wrote processes.txt (218 lines)
wrote network-connections.txt (34 lines)
wrote evidence-sha256.txt

03Forensics: Answer the Questions That Matter

Digital forensics reconstructs activity from digital artifacts. The questions are usually practical: how did the attacker get in, what did they access, what did they change, when did it happen, and are they still present? The answers come from logs, file system metadata, memory, network captures, cloud audit trails, and application records.

Maintain a chain of custody for evidence. Record who collected it, when, from where, with which tool and version, and where it has been stored. Hash files at collection and verify the hash later. Work on copies, not originals. Keep notes contemporaneously. If the matter may become legal or disciplinary, follow your organisation's legal guidance and do not improvise.

Timelines are the most useful forensic product. Combine events from multiple sources in UTC, note the source and confidence of each entry, and look for gaps. A login at 10:00, a new service at 10:02, and an outbound connection at 10:04 tell a story that isolated logs do not. Correlation is more valuable than any single artifact.

04Communication Is Part of the Response

Incidents create uncertainty. People want to know what happened and what to do. Communicate what you know, what you do not know, and when you will update next. Avoid speculation and blame. Use a single source of truth for status so different teams do not contradict each other.

Different audiences need different messages. Engineers need technical detail and clear tasks. Executives need business impact, decisions, and timelines. Legal and privacy teams need data exposure facts and notification obligations. Affected users need clear guidance and a way to get help. Customer support needs approved language so they do not improvise.

After the incident, hold a blameless review. What happened, what worked, what failed, and what will change? Focus on systems and decisions, not individuals. Assign owners and dates to actions, and track them. The final report should be useful to someone who joins the team later. An incident that produces a document nobody implements has not improved resilience.

LET IT CLICK

The ideas worth keeping.

  • Incident response is a lifecycle: prepare, detect, contain, eradicate, recover, and learn.
  • Containment decisions balance security benefit against operational and safety impact.
  • Preserve volatile evidence and maintain a chain of custody before destructive actions.
  • Clear, honest communication and a blameless review turn an incident into resilience.
TURN UNDERSTANDING INTO SOMETHING YOU CAN DO

Make it yours.

Type and test your code right here in the interactive workspace. Run your solution, check the output, and compare with the worked guide when ready.

01

Exercise 1: Decide on containment

A workstation is showing ransomware notes and files are being encrypted. The user is a surgeon who needs the machine for an urgent procedure. What do you do first, and how do you balance safety and availability?

Explore a worked solution
one_possible_solution.mdCybersecurity
First, isolate the machine from the network without powering it off, if the platform and process allow, to stop encryption and lateral movement while preserving volatile evidence. Notify the incident commander and the clinical lead immediately. Determine whether the procedure depends on this specific workstation or on a shared clinical application that remains available. Provide a clean replacement device or alternative workflow if possible. Do not reconnect the original until it is rebuilt and cleared. Document the decision, the operational impact, and who authorised it.

Containment is urgent, but safety and clinical impact matter. Isolate rather than destroy, involve the operational owner, and provide a safe alternative.

02

Exercise 2: Build a timeline

You have three events: VPN login from a new country at 08:12, a new local administrator account created at 08:18, and a large upload to an unknown domain at 08:31. What does the sequence suggest, and what two additional sources would you check?

Explore a worked solution
one_possible_solution.mdCybersecurity
The sequence suggests possible unauthorised access followed by persistence and data exfiltration. Check the identity provider and VPN logs for the account's normal locations, MFA result, device, and user agent; check endpoint or domain controller logs for who created the administrator account and what else that session did; check DNS, proxy, and firewall logs for the destination domain and other hosts contacting it; check data-loss-protection or cloud storage logs for what was uploaded. Correlate timestamps in UTC and verify that the clock sources are consistent.

The timeline is a hypothesis. Additional sources help distinguish a malicious sequence from a legitimate administrative change with a coincidental upload.

A SMALL QUESTION. A USEFUL NEXT STEP.

What stayed with you?

Check the ideas while they’re fresh. Your answers stay in this page and feedback appears as you go.

A LITTLE ACTIVE RECALL0 / 4 answered
01What is the first phase of the incident response lifecycle?
02Why should you capture volatile evidence early?
03What is the purpose of a chain of custody?
04Why hold a blameless post-incident review?

Keep exploring.

The official references behind this lesson, when you want a second angle or the full details.

One lesson closer.

Reading is a start. Trying it yourself makes the connection.

Completion is saved in this browser. It records reading and hands-on practice progress.