01 / 20

Containment
Strategies

Learn how security teams isolate threats, reset credentials, and stop lateral movement to limit damage during a cyber incident.

Cyber Security

What Is Containment?

When a security breach occurs, the first instinct might be to eliminate the threat entirely. But before eradication, teams must contain the incident: prevent it from spreading to other systems, users, or data while preserving evidence for investigation.

Why Containment Matters

✕ Without Containment
Malware spreads to additional hosts, attackers pivot through the network, and sensitive data continues to be exfiltrated.
✓ With Containment
Damage is limited to known affected systems, evidence is preserved for forensics, and recovery time is significantly reduced.

The Incident Response Lifecycle

Preparation Detection Containment ★ Current Focus Eradication Recovery

Containment sits at the centre of the NIST incident response lifecycle. It bridges detection (we know something is wrong) and eradication (we remove the threat). Without effective containment, eradication becomes a moving target.

Core Containment Strategies

Containment Network Isolation Credential Reset VLAN Change Firewall Block Port Disable Password Reset Token Revoke MFA Enforce System Shutdown

The three primary containment approaches are network isolation, credential reset, and system shutdown. Each targets a different attack vector.

Network Isolation Explained

Network isolation prevents a compromised system from communicating with the rest of the network. The goal is to cut off lateral movement while keeping the system powered on for forensic analysis.

VLAN Reassignment
Move the infected host to a quarantine VLAN with no routes to production networks.
Firewall Rules
Apply deny-all rules to the host's IP at network firewalls to block inbound and outbound traffic.
Switch Port Disable
Administratively shut down the physical switch port connecting the compromised device.

Credential Reset Explained

If an attacker has stolen or compromised credentials, isolating the network alone will not stop them. Credential reset invalidates stolen authentication tokens and forces re-authentication with new secrets.

1
Password reset: Force affected accounts to change passwords immediately. Prioritise privileged accounts (admin, root, service accounts).
2
Session token revocation: Invalidate all active sessions and OAuth/API tokens for compromised accounts so stolen cookies become useless.
3
MFA enforcement: Enable or re-enrol multi-factor authentication to ensure the attacker cannot re-authenticate with a password alone.
4
Key rotation: Rotate SSH keys, API secrets, and certificates that the compromised account had access to.

Isolation vs. Credential Reset

Network Isolation Credential Reset
Primary target Compromised hosts Compromised accounts
What it stops Lateral movement, C2 callbacks Unauthorised access, privilege escalation
Speed Seconds (switch/firewall change) Minutes (may require directory sync)
Side effects Legitimate services on that host go offline Users locked out until they reset
Evidence impact Preserves host for forensics Does not affect host evidence
Best used when Malware or active exploit detected Phishing, stolen credentials, insider threat

Short-Term vs. Long-Term

Short-Term
Immediate actions taken in the first minutes: disconnect the host, block IPs, disable accounts. The goal is to stop the bleeding as fast as possible.
Long-Term
Sustained measures while investigation continues: apply temporary patches, tighten firewall rules, deploy monitoring agents. The goal is to stay secure during eradication.

Containment Checklist

1
Identify affected assets: Determine which hosts, accounts, and data are compromised using SIEM alerts and logs.
2
Isolate the network segment: Move compromised hosts to a quarantine VLAN or apply firewall deny rules.
3
Reset compromised credentials: Force password resets, revoke tokens, and enforce MFA on all affected accounts.
4
Preserve evidence: Take memory dumps and disk images of isolated systems before any changes are made.
5
Monitor for re-entry: Deploy enhanced logging on neighbouring systems to detect if the attacker attempts to pivot through another path.
6
Communicate: Brief stakeholders, legal, and management. Document all actions taken with timestamps.

Example: Ransomware on a Workstation

Infected Workstation Quarantine VLAN Isolated Host VLAN move Production Network ✕

Example: Phishing and Credential Theft

Attacker Stolen Creds User Account j.smith@corp Password Reset + MFA Revoke All Sessions Rotate API Keys

Example: Advanced Persistent Threat

An APT actor has been inside the network for weeks, moving laterally across multiple servers. Simple isolation of one host won't suffice: the attacker has footholds on several machines and may have created backdoor accounts.

1
Segment the network: Create micro-segments around known-compromised servers to prevent further lateral movement.
2
Reset all privileged credentials: The attacker likely has domain admin access: reset every admin password, Kerberos ticket-granting tickets, and service account secrets.
3
Block C2 communication: Use threat intelligence to block known attacker command-and-control IP addresses and domains at the perimeter firewall and DNS resolver.
4
Deploy EDR monitoring: Install endpoint detection agents on all hosts to detect new attacker activity during the containment window.

Additional Techniques

System Shutdown
Powering off a system guarantees it cannot communicate. However, volatile memory evidence (RAM) is lost permanently. Use only as a last resort.
DNS Sinkholing
Redirect attacker C2 domains to a controlled IP. The malware connects to your sinkhole instead, providing intelligence while blocking communication.
Application Whitelisting
Temporarily restrict execution to known-good binaries. Prevents the attacker from running new tools or malware payloads on contained systems.

Common Mistakes

✕ Alerting the Attacker
Immediately wiping an infected host can tip off the attacker that they've been detected, causing them to activate dormant backdoors elsewhere.
✕ Partial Credential Reset
Resetting only the compromised user's password while leaving service accounts and cached tokens untouched allows the attacker to maintain access.
✕ Destroying Evidence
Shutting down or reimaging a machine before capturing a memory dump and disk image destroys critical forensic evidence needed for root cause analysis.

Strategy Summary

Strategy When to Use Caution
VLAN Isolation Active malware, lateral movement Services on host go offline
Firewall Block Known attacker IPs, C2 traffic May block legitimate traffic too
Password Reset Stolen credentials, phishing User disruption, helpdesk load
Token Revocation Compromised sessions, API abuse Active workflows interrupted
DNS Sinkhole Malware C2 domains identified Does not stop IP-based C2
System Shutdown Last resort: destructive attack in progress Volatile evidence lost forever

Question 1 of 5

What is the primary goal of the containment phase in incident response?

Question 2 of 5

A workstation is actively encrypting files with ransomware. Which containment action should be performed first?

Question 3 of 5

After a phishing attack compromises an employee's credentials, which combination of actions best contains the threat?

Question 4 of 5

Why is shutting down a compromised system considered a last-resort containment action?

Question 5 of 5

Which analyst's approach is more appropriate for containing an APT, and why?