Containment Strategy
Containment is not a single action — it is a series of decisions made under uncertainty. The central tension is between limiting attacker access and preserving the ability to understand and eliminate what the attacker has done.
Day two of a financial services IR engagement. The IR team has identified 12 confirmed compromised hosts and the attacker's C2 infrastructure. Leadership pressure is intense: "shut everything down, now." The IR lead pushes back. If they isolate the 12 confirmed hosts immediately, they will tip off the attacker — who is still connected — that the investigation has found them. The attacker will execute their contingency plan: deploy secondary persistence on hosts the IR team hasn't found yet, accelerate exfiltration, and potentially deploy a destructive payload. The IR team wants 24 more hours to observe the attacker's behavior and map their full footprint before moving. Leadership disagrees. This is the central tension of every containment decision: act fast and accept incomplete knowledge, or observe longer and accept continued risk. Neither choice is obviously correct. The right answer depends on whether the attacker is actively exfiltrating, whether a destructive payload is present, and how much confidence the IR team has in the scope of their current findings.
Surgical vs Scorched-Earth Containment
Containment approaches exist on a spectrum from surgical (precisely targeting confirmed compromised systems) to scorched-earth (isolating entire networks or business units). The right approach is calibrated to the threat, the blast radius, and what the investigation knows versus suspects.
Containment Approach Spectrum
══════════════════════════════════════════════════════════════════════
SURGICAL CONTAINMENT
─────────────────────────────────────────────────────────────────
Isolate: only confirmed compromised hosts
Leave active: everything else, including suspected-but-unconfirmed hosts
When appropriate:
• Investigation has high confidence in scope
• No evidence of active exfiltration or destructive payload
• Business disruption from broader isolation would be severe
• Attacker does not appear to be monitoring IR activity
Risk: undiscovered compromised hosts remain active
Benefit: minimal business disruption; attacker does not immediately
know containment has begun
SEGMENTATION CONTAINMENT
─────────────────────────────────────────────────────────────────
Isolate: an entire network segment or VLAN containing confirmed
compromised systems
Leave active: other network segments and business functions
When appropriate:
• Multiple hosts in a segment are confirmed compromised
• Lateral movement within the segment is occurring
• Acceptable to take entire segment offline
Risk: may include non-compromised hosts in the isolation
Benefit: stops active lateral movement within segment; limits
attacker's ability to pivot further
SCORCHED-EARTH CONTAINMENT
─────────────────────────────────────────────────────────────────
Isolate: entire business unit, site, or entire corporate network
Leave active: only critical operational technology or life safety systems
When appropriate:
• Ransomware is actively spreading (automated, time-critical)
• Active destructive payload (wiper malware)
• Scope is completely unknown and attacker has pervasive access
• Severe data exfiltration is actively occurring in real time
Risk: massive business disruption; may take days to recover
Benefit: stops active attacker operations immediately; bounds the blast radius
The Tip-and-Cue Problem
Tip-and-cue describes the scenario where your containment action alerts the attacker that you have found them, triggering a change in their behavior — typically an acceleration of their plan or execution of contingency actions. Every containment action is a signal to the attacker. Managing that signal is part of containment strategy.
Sophisticated attackers — particularly APT actors conducting prolonged intrusions — establish contingency plans that activate when they believe detection is imminent. A common pattern: when they observe that one of their compromised hosts goes offline suddenly or that their C2 callback stops, they infer that the host has been isolated. They then (1) execute any remaining objectives they have not yet completed (data exfiltration, lateral movement to targets they've identified but not yet accessed), (2) deploy additional persistence mechanisms on other compromised hosts not yet found by IR, and (3) may execute a destructive payload to obscure evidence of what they stole. The implication for IR: mass simultaneous containment on all confirmed hosts is often better than sequential containment, because sequential isolation of hosts one-by-one signals progress and gives the attacker time to react. The tactical phrase is "synchronized isolation" — isolating all known compromised systems simultaneously in a coordinated action at a chosen time.
Tip-and-Cue Scenarios and Mitigations
══════════════════════════════════════════════════════════════════════
SIGNAL: IR team isolates host A
ATTACKER RESPONSE: C2 callback from host A stops; attacker infers
host A is under investigation
ATTACKER ACTION: accesses host B and C (previously idle) to establish
additional persistence; deploys second-stage payload
MITIGATION: synchronized isolation — isolate A, B, and C simultaneously
───────────────────────────────────────────────────────────────────
SIGNAL: IR team changes the passwords of compromised admin accounts
ATTACKER RESPONSE: authentication from attacker's access paths fails
ATTACKER ACTION: authenticates using a different credential set they
harvested but haven't used yet; escalates privileges
via a different path
MITIGATION: identify ALL credential access before resetting passwords;
reset all compromised credentials simultaneously
───────────────────────────────────────────────────────────────────
SIGNAL: IR team blocks the known C2 IP at the firewall
ATTACKER RESPONSE: C2 beacon switches to backup domain/IP
(domain fronting, CDN routing, backup C2 server)
ATTACKER ACTION: continues operating from backup C2; now knows the
IR team has found the primary C2 infrastructure
MITIGATION: identify and block all C2 infrastructure simultaneously;
include domain-based blocking, not just IP-based
───────────────────────────────────────────────────────────────────
SIGNAL: IR team runs triage tools on a compromised host
ATTACKER RESPONSE: attacker's tool detects analysis (sandbox evasion,
process detection) and terminates or changes behavior
MITIGATION: prefer remote artifact collection (Velociraptor) over
running tools directly on host; use network isolation
rather than host-based shutdown for initial containment
The Silent Observation Window Decision
A silent observation window is a deliberate period where the IR team has identified the attacker's presence but delays containment to observe attacker behavior — mapping their tools, infrastructure, and access paths before acting. This is a high-stakes decision that carries real risk.
| Condition | Observation window: appropriate? |
|---|---|
| Active exfiltration of sensitive data in progress | No — stop exfiltration immediately; observation window is not worth ongoing data loss |
| Ransomware deployment appears imminent (wiper or encryptor staged) | No — act immediately; destructive payload is the worst outcome |
| Attacker appears to be in reconnaissance/staging phase, no active exfiltration | Yes — a short observation window (12–24 hours) may significantly improve scope mapping |
| Scope of compromise is highly uncertain (attacker may have access you haven't found) | Yes — observation may reveal additional pivots and access paths |
| IR team believes attacker is monitoring IR communications | No — the attacker already knows you've found them; observation window provides no benefit |
| Legal/regulatory notification obligation is imminent (72-hour GDPR clock) | No — notification obligation triggers regardless of IR timeline |
Network Segmentation vs Host Isolation
Network segmentation and host isolation are two levels of containment that work together. Understanding the difference is important because they have different blast radii and different effects on attacker behavior.
Segmentation vs Isolation
══════════════════════════════════════════════════════════════════════
HOST ISOLATION (EDR-based or network ACL on the host's switch port)
─────────────────────────────────────────────────────────────────
Effect: single host is cut off from all network communication
except to the EDR management server (most EDR platforms
maintain EDR channel through isolation)
Blast radius: single host
Attacker impact: loses access to that host only; other hosts
the attacker controls remain active
IR benefit: stops attacker activity on that host; preserves
host state for investigation; EDR channel remains
available for continued analysis and artifact collection
How it works in CrowdStrike/Defender/S1:
EDR agent applies firewall rules blocking all traffic except to
the EDR management server's IP. Host remains reachable by IR
via the EDR console (remote shell, artifact collection). The
attacker's C2 channel through the host is blocked.
NETWORK SEGMENTATION (firewall rules, VLAN isolation, network ACLs)
─────────────────────────────────────────────────────────────────
Effect: entire network segment is isolated or restricted; controls
which segments can communicate with which
Blast radius: all hosts in the segment
Attacker impact: cannot move laterally into or out of the segment;
cannot reach C2 from hosts in the segment
IR benefit: stops lateral movement; bounds the incident to the
affected segment; preserves logs from all segment hosts
When to use each:
Confirmed single host, investigation ongoing → host isolation
Multiple hosts confirmed in segment, active lateral movement → segmentation
Ransomware spreading actively → scorched-earth network isolation
Long-Term Containment
Long-term containment bridges the gap between initial containment and full eradication. It is used when eradication (full removal of attacker presence) cannot be completed immediately — due to scope uncertainty, operational constraints, or the time needed for complete remediation planning. Long-term containment accepts that attacker presence may still exist while reducing attacker capability to cause harm.
| Long-term containment measure | What it prevents | What it does not prevent |
|---|---|---|
| Blocking all identified C2 infrastructure at perimeter | Attacker communicating back to their infrastructure from remaining compromised hosts | Attacker communicating via alternate C2 channels not yet identified |
| Credential rotation for all confirmed compromised accounts | Attacker authenticating using stolen credentials | Attacker authenticating using credentials you haven't identified as compromised |
| Enhanced monitoring (EDR alert tuning, NetFlow alerting on new C2 IPs) | Undetected attacker activity going forward | Historical activity that occurred before monitoring was enhanced |
| Restricting lateral movement capabilities (disabling unnecessary remote access tools) | Attacker pivoting to new systems via common lateral movement tools | Attacker using legitimate remote management tools for lateral movement (living-off-the-land) |
Credential Rotation Sequencing
Credential rotation during IR is not simply "reset all passwords." Done in the wrong sequence, it alerts the attacker, gives them time to pivot to backup credentials, or misses credentials entirely. The sequencing matters.
Credential Rotation Sequence
══════════════════════════════════════════════════════════════════════
STEP 1: Identify ALL compromised credentials before resetting any
─────────────────────────────────────────────────────────────────
Review: process memory of compromised hosts (credential material),
event logs (which accounts authenticated from compromised hosts),
EDR telemetry (credential access events — LSASS reads, Mimikatz
artifacts, credential vault access)
Goal: build a complete list of potentially compromised credentials
before touching any of them. Resetting one account tells the
attacker which ones you know about.
STEP 2: Identify all privileged and service accounts the attacker accessed
─────────────────────────────────────────────────────────────────
Priority: domain admin, enterprise admin, service accounts with
domain privileges, cloud IAM roles with broad permissions
STEP 3: Simultaneous reset in priority order
─────────────────────────────────────────────────────────────────
Reset all confirmed privileged accounts simultaneously.
Next: all service accounts simultaneously.
Next: all user accounts simultaneously.
Do NOT reset one at a time over hours. The attacker has time to
move between resets if you're sequential.
STEP 4: Force re-authentication everywhere
─────────────────────────────────────────────────────────────────
Password reset alone is not sufficient if the attacker has active
sessions or tokens. Require re-authentication everywhere.
For Kerberos: golden ticket → KRBTGT account must be reset TWICE
(48 hours apart, or in close succession) to invalidate
all forged tickets. Single reset is insufficient.
For cloud: revoke all sessions/tokens, not just reset passwords.
STEP 5: Monitor for use of old credentials
─────────────────────────────────────────────────────────────────
Any authentication attempt using a credential that was just reset
may indicate attacker activity. Alert on old credential reuse.
Active Directory Containment
When the attacker has compromised Active Directory — especially if they have obtained Domain Admin or have forged Kerberos tickets — containment is significantly more complex than host isolation and credential rotation. Active Directory compromise means the attacker has the ability to create new accounts, modify group memberships, establish persistence through GPOs, and in some scenarios, maintain access even after credential rotation.
| AD compromise indicator | Containment action | Why this specific action |
|---|---|---|
| Domain Admin credential harvested (Mimikatz on DC) | Reset all DA accounts; audit DA group membership for unknown accounts; review recent DA group changes | Attacker may have added their own account to DA group; new accounts not in your known-good list are backdoors |
| KRBTGT hash obtained (golden ticket capability) | Reset KRBTGT password twice; first reset invalidates new tickets; second reset (after 10+ hours) invalidates existing tickets that were issued before the first reset | Kerberos tickets have a maximum lifetime (default 10 hours); attacker can use forged tickets until they expire unless KRBTGT is double-reset |
| DC compromised (attacker had code execution on domain controller) | Forest-level assessment required; all domain trust relationships must be reviewed; new forests may need to be rebuilt | An attacker with DC access can modify any object in AD; the entire forest's trust integrity is questionable |
| GPO modified by attacker | Audit all GPO changes in the investigation window; revert modified GPOs; check for scheduled task GPOs deploying attacker tools | Malicious GPOs can establish persistent code execution on every host in the domain; will reinfect cleaned hosts if GPO is not also cleaned |
A large enterprise experienced a ransomware deployment. The IR team contained and eradicated the ransomware from all identified hosts over 5 days. The team reset the compromised domain admin credentials. They did not reset the KRBTGT password, because they weren't sure the attacker had obtained the KRBTGT hash. Three days after the "eradication complete" declaration, ransomware began deploying again on 2,000 hosts — using a golden ticket to authenticate as domain admin and deploying the ransomware payload via GPO. The attacker had maintained access through a forged Kerberos ticket that remained valid after the user-level credential resets. The KRBTGT double-reset would have invalidated all forged tickets and prevented the second deployment. The reinfection cost more than the original incident in downtime and recovery effort. KRBTGT reset is now standard practice in any IR where AD was confirmed compromised.
Cloud Containment
Cloud environments require a containment approach adapted to their architecture. Traditional "isolate the host" concepts apply to cloud VMs, but the more interesting threat in cloud environments is identity-based: IAM roles, service accounts, OAuth tokens, and API keys that give the attacker access to cloud resources without needing to maintain a foothold on a specific host.
Cloud Containment Actions by Provider
══════════════════════════════════════════════════════════════════════
AWS
─────────────────────────────────────────────────────────────────
• Revoke all access keys for compromised IAM users/roles immediately
• Invalidate active console sessions (IAM → Security credentials
→ sign-out all sessions)
• For compromised EC2 instances: modify security group to deny all
inbound/outbound (VPC-level isolation; more reliable than OS-level
firewall changes via SSM)
• Enable GuardDuty and CloudTrail in all regions if not already active
• Scope all S3 buckets the compromised IAM principal could access
Azure
─────────────────────────────────────────────────────────────────
• Revoke all refresh tokens for compromised users (Entra ID →
Revoke sessions)
• Disable compromised service principals; rotate client secrets/certs
• For compromised VMs: apply restrictive NSG (Network Security Group)
denying all traffic except Azure management endpoints
• Review Entra ID conditional access logs for access from unexpected
locations/devices by the compromised identity
GCP
─────────────────────────────────────────────────────────────────
• Disable compromised service accounts; rotate keys
• Revoke OAuth tokens for compromised user accounts
• For compromised GCE instances: modify firewall rules to deny all traffic
UNIVERSAL CLOUD PRINCIPLE
─────────────────────────────────────────────────────────────────
Identity is the perimeter in cloud. An attacker with a valid token
can operate from anywhere — they do not need a compromised host.
Identity containment (token revocation, key rotation, session
termination) must happen in parallel with or before host containment.
Reimaging a compromised EC2 instance while leaving the attacker's
IAM keys active accomplishes nothing.
Q & A
How do you decide when it's safe to end containment and move to eradication?
Containment transitions to eradication when you have sufficient confidence in the scope of the compromise — meaning you believe you have identified all compromised systems, all compromised credentials, and all attacker persistence mechanisms. This is a judgment call, not a binary determination, because IR investigations rarely achieve 100% certainty. The practical test is: if you were to clean everything you've identified and the attacker retained access somewhere, what would the evidence look like? If your EDR and SIEM monitoring would detect a re-intrusion attempt quickly, the risk of transitioning to eradication is lower. If your logging coverage is incomplete and a re-intrusion might go undetected, the bar for confidence before transitioning should be higher. At minimum, the following should be true before transitioning: all confirmed compromised hosts identified, active C2 communication from your environment has stopped, all confirmed compromised credentials have been rotated, and a clean baseline exists for eradication comparison.
What should you do if you discover the attacker has access to your Active Directory but you cannot take AD offline for remediation?
This is one of the most operationally difficult scenarios in IR, and the honest answer is that there is no containment action that fully addresses a confirmed AD compromise while the domain remains operational. The available options in order of effectiveness: (1) KRBTGT double-reset, which invalides golden tickets and is high-impact but operationally safe (it does not break AD authentication for legitimate users permanently); (2) reset and audit all privileged accounts simultaneously; (3) implement Privileged Access Workstations (PAWs) for any administrative access performed during the incident — preventing the attacker from harvesting new credentials from analyst activity; (4) monitor for anomalous DA usage, new account creation, and GPO changes continuously until full remediation is possible. The underlying AD architecture may need to be rebuilt in a "clean forest" migration if the compromise was deep enough — this is a multi-week project, not an IR timeline decision. For the incident period, the goal is reducing attacker capability, not the impossible goal of complete containment of a fully compromised domain.
What is the risk of NOT isolating a compromised host to observe attacker behavior?
Three primary risks: (1) ongoing data exfiltration — the attacker may be actively extracting data from the host, and every hour of observation is additional data loss; (2) attacker discovery of your investigation — sophisticated attackers monitor for IR activity (new processes, network scans, log forwarding rate changes) and may deploy destructive or accelerated actions when they detect it; (3) further lateral movement — an uncontained host is an active pivot point the attacker can use to reach additional systems. These risks must be weighed against the benefit of the observation window, which is typically: a more complete map of attacker infrastructure, better understanding of the full scope of compromise, and higher-confidence simultaneous containment action. The observation window is most justified when data exfiltration is not occurring, the attacker appears to be in a dormant phase, and the benefit of scope completion is high.
How do you contain lateral movement that used Windows built-in tools (WMI, PsExec, RDP, PowerShell remoting) rather than malware?
Living-off-the-land lateral movement is harder to contain than malware-based movement because you cannot simply delete a malicious file or block a malicious process. The containment approach works at three levels: (1) credential containment — the attacker's lateral movement via WMI/RDP/PSRemoting requires credentials; rotating all confirmed-compromised credentials removes their ability to authenticate via these paths; (2) access restriction — disable WinRM, restrict RDP to management jump hosts only, tighten WMI namespace ACLs for non-administrative users during the incident period; (3) network segmentation — if you can segment the compromised workstation VLAN from the server VLAN, you break the lateral movement path without touching individual hosts. The key insight is that LOLBAS (living off the land binaries and scripts) lateral movement requires valid credentials and network access — attacking both of these is more effective than trying to block the individual tools.
Should you notify law enforcement during containment, and does it affect your containment options?
Whether to notify law enforcement is a legal counsel decision, not an IR team decision — raise it with legal early in the incident. Law enforcement notification can affect containment in specific ways: the FBI, for instance, may ask for a period of observation before containment to support their investigation or to correlate with other ongoing investigations involving the same threat actor. They may also have intelligence about the threat actor's capabilities or contingency plans that would affect your containment strategy. In cases involving nation-state actors, law enforcement liaison may provide access to classified threat intelligence that changes the risk calculation. However, law enforcement involvement is not appropriate for or available in most routine corporate incidents. The situations where it is clearly relevant: ransomware from known criminal groups (FBI has active operations against some), suspected insider threat (HR and legal must be involved first), nation-state intrusion, or incidents with critical infrastructure implications.