Containment, Eradication, Recovery and Post-Incident Activity
Once an incident is understood, the team stops it from spreading, removes its cause, restores operations and learns from it. This lesson explains containment strategies, eradication, recovery and documentation, and post-incident activities.
Learning outcomes
After completing this lesson, you will be able to:
- Choose appropriate containment strategies.
- Explain eradication and root cause removal.
- Describe recovery and incident documentation.
- Describe lessons learned and continuous improvement.
Containment
Containment limits the damage and stops the incident from spreading. It buys time for eradication without letting the attacker do more harm. Common containment actions include isolating infected hosts from the network (for example through EDR network isolation or moving them to a quarantine VLAN), disabling or resetting compromised accounts and revoking their sessions, blocking malicious IP addresses, domains and email senders, taking an affected service offline, and segmenting the network further.
Short-term containment acts immediately, such as isolating a host. Long-term containment keeps the business running safely while a full fix is prepared, such as moving a service to a clean temporary system. Containment decisions balance several factors, which the following list summarises.
- Damage and spread: how fast the incident is growing and what it threatens.
- Business impact: the cost of taking systems or services offline.
- Evidence preservation: powering off a system destroys memory evidence; network isolation preserves it.
- Attacker awareness: obvious actions may alert the attacker, who may then destroy data or change tactics, so containment of an advanced intrusion is often coordinated and carried out all at once.
The following diagram compares pulling the power with isolating a file server that ransomware has begun encrypting.

Contain, eradicate or recover?
Eradication
Eradication removes the cause of the incident and everything the attacker left behind: malware, web shells and backdoors, attacker-created accounts, scheduled tasks and other persistence mechanisms. It also closes the root cause, the vulnerability or weakness that allowed the incident, for example by patching, fixing a misconfiguration or enforcing MFA, and resets credentials that may have been exposed, including service accounts.
Attackers often establish several footholds, so eradication depends on a thorough understanding of the incident's scope; missing one foothold lets the attacker return. For serious compromises, rebuilding systems from known-good images is more reliable than trying to clean them.
Recovery and incident documentation
Recovery returns systems to normal operation safely. Systems are restored from clean backups (checked to ensure they predate the compromise and are not infected) or rebuilt, hardened, tested and validated by their owners before returning to production. Recovery is often phased, starting with the most critical services, and recovered systems are monitored closely for signs that the attacker has returned.
Incident documentation, maintained throughout and completed at recovery, records the timeline, the systems and data affected, the evidence collected and its chain of custody, the actions taken and by whom, decisions and their rationale, communications and notifications made, and costs. It supports lessons learned, insurance claims, legal proceedings and regulatory reporting.
Post-incident activities
After the incident is closed, a lessons learned review, held soon while memories are fresh, examines what happened and when, how well the team and plan performed, what information was missing, what would be done differently and what could prevent or detect similar incidents sooner. The review is blameless: its purpose is improvement, and fear of blame would hide information.
Its outputs are new countermeasures (controls, detection rules, patches, architecture changes), updates to the plan, playbooks and training, and metrics such as time to detect, time to contain and cost. Evidence is retained according to policy and legal needs. These actions feed back into preparation, which is the continuous improvement that makes incident response a cycle. The following comparison summarises the response stages.
After the incident
Power off or isolate?
EDR detects ransomware beginning to encrypt files on a file server. A technician proposes pulling the power cable immediately. What is the better containment action?
Isolate the server from the network, for example with EDR isolation or by disabling its switch port, which stops the ransomware spreading and stops contact with the attacker's servers while preserving volatile evidence in memory, which may even contain encryption keys. Pulling the power destroys that evidence. If isolation is impossible and encryption is spreading rapidly to critical data, management may accept the loss of evidence, but that is a deliberate decision.
The attacker returns
Two weeks after a compromised web server was cleaned of malware and returned to service, the same attackers are back. What was most likely missed?
Eradication was incomplete: either the root cause (the vulnerability used to get in) was not fixed, or a persistence mechanism such as a second web shell, a scheduled task or stolen credentials was not removed. The server should be rebuilt from a known-good image, patched, credentials reset, and its activity monitored closely after recovery.
Why must backups be checked before they are used for recovery after a compromise?
Show answer
They may contain the malware or attacker persistence, or predate missing changes; restoring an infected backup would reintroduce the compromise.
Exam Tips
Remember for the exam
- Contain before eradicating, and prefer isolation to power-off to preserve evidence.
- Eradication must close the root cause and remove every foothold.
- Lessons learned are blameless and produce new countermeasures.