Contain
Containment stops the attacker and preserves the evidence. Cut the specific paths the attacker is using. A compromised web server isolated from internal systems while it keeps serving the internet is contained, and the site stays up.
Collect volatile evidence before an action destroys it, following Evidence collection. The scenario page for the incident type lists the containment steps that differ, and the cloud playbooks give the provider commands.
Identity containment
| # | Item | Owner |
|---|---|---|
| 1 | Reset passwords at the primary identity provider, privileged accounts first | Operations |
| 2 | Rotate service account credentials, application programming interface (API) keys and programmatic tokens | Operations |
| 3 | Coordinate resets for accounts synced between on-premises and cloud directories | Operations |
| 4 | Revoke active sessions and authentication tokens at the identity provider (commands below) | Operations |
| 5 | Force-disconnect virtual private network (VPN), Remote Desktop Protocol (RDP) and Secure Shell (SSH) sessions | Operations |
| 6 | Where the application supports it, increment the session token version to invalidate browser sessions | Operations |
| 7 | Invalidate OAuth refresh tokens and offline access tokens | Operations |
| 8 | Where applications accept stateless JSON Web Tokens (JWTs), deny-list the attacker's tokens | Operations |
| 9 | Watch authentication logs for token endpoint requests that show cached credential use | Intelligence/Investigations |
| 10 | Apply conditional access: location, device compliance, risk-based blocking, phishing-resistant multifactor authentication (MFA) | Operations |
| 11 | Disable the account at the identity provider to block new sign-ins to every single sign-on (SSO) application. Item 4 revokes the existing sessions. | Operations |
| 12 | Find applications with local accounts outside the identity provider, and revoke those accounts separately | Operations |
| 13 | Revoke the OAuth-connected applications the compromised account authorized | Operations |
| 14 | Disable automation rules, webhooks, continuous integration and delivery (CI/CD) deployment keys, and browser extensions with broad permissions | Operations |
By identity provider
Revoking sessions stops refresh, but access tokens already issued keep working until they expire. Entra ID access tokens last 60 to 90 minutes by default.
Applications that support Continuous Access Evaluation (CAE) get tokens lasting up to 28 hours. They reject those tokens in near real time after a revocation, though Microsoft says propagation can take up to 15 minutes. Every other application accepts the old token until it expires. Expect up to 90 minutes of residual access and watch the sign-in logs for it.
| Provider | Revoke sessions | Block new sign-ins | Also |
|---|---|---|---|
| Entra ID | Choose Revoke sessions on the user in the admin center, or run: Revoke-MgUserSignInSession -UserId <upn> | For a synced account, also disable it in on-premises Active Directory, or the next sync re-enables it. Disable it in Entra ID: Update-MgUser -UserId <upn> -AccountEnabled:$false | Remove registered authentication methods and devices the attacker added |
| Okta | Choose Clear User Sessions in the Admin Console, or call: DELETE /api/v1/users/<user-id>/sessions?oauthTokens=true | Suspend or deactivate the user | Sessions inside downstream applications survive. End them in each application. |
| Google Workspace | Reset sign-in cookies on the user in the Admin console, or call the Directory API method users.signOut | Suspend the user | Revoke OAuth tokens and app passwords separately |
| AWS IAM | Choose Revoke active sessions on the role. IAM attaches the AWSRevokeOlderSessions policy, which denies credentials issued before that moment. | Remove the console password, then deactivate each access key: aws iam update-access-key --user-name <user> --access-key-id <key-id> --status Inactive | Temporary credentials stay valid until expiry unless the role's sessions are revoked |
Provider documentation, checked October 2026. Microsoft: identity platform access tokens and Continuous Access Evaluation, and Graph PowerShell Revoke-MgUserSignInSession. Okta: User Sessions API. Google: Admin SDK Directory API users.signOut. AWS: revoking IAM role temporary credentials, and the CLI update-access-key reference. Cloud-specific scope and eradication are in the cloud scenario, and provider commands are in the cloud playbooks.
Evidence to preserve
| # | Item | Owner |
|---|---|---|
| 15 | Capture memory first, with WinPMEM or Linpmem (commands) | Operations |
| 16 | Image the systems that contain unique evidence, such as patient zero and hosts running custom tooling | Intelligence/Investigations |
| 17 | Forward logs off the host as soon as the compromise is found, so they cannot be deleted | Operations |
Validate before calling it contained
| # | Item | Owner |
|---|---|---|
| 18 | Network: firewall, proxy and Domain Name System (DNS) logs show no command and control (C2) traffic resuming, no new connection patterns and no protocol tunneling | Intelligence/Investigations |
| 19 | Process: no respawned malware, no new persistence, no executables in unusual paths | Intelligence/Investigations |
| 20 | Logs: no bursts of failed authentication, no privilege escalation, no unusual file access | Intelligence/Investigations |
Decisions and records
- Choose the posture in Which containment posture, and get the authority named in who authorizes what.
- If a trigger in When containment cannot wait applies, take its approved action now.
- Fill in one T3 per action: layer, trigger, posture, authority, business impact, rollback procedure and the three validation checks.
- Human-operated ransomware groups have accelerated encryption after detecting defensive action, and watchdog processes respawn malware or trigger destructive payloads. Before killing processes on a system you do not yet understand, prefer quiet, coordinated containment unless an immediate trigger applies.
- Sequential isolation signals the response and gives the adversary time to escalate. Execute simultaneously across the network, endpoint, identity and application teams, with one plan for the operational period. See the planning cycle.
- Write and test the rollback procedure before changing firewall rules or network topology.
Containment layers
| Layer | Use it for |
|---|---|
| Network | Broad, fast control over many systems at once |
| Host | Precision on a known-compromised endpoint |
| Application | Attacker tooling that network controls do not see |
| Identity | Software as a service (SaaS) and cloud paths, where it is frequently the only layer that reaches |
WannaCry and the kill-switch domain
Reporting by WIRED, TechCrunch, the Associated Press, Reuters and The Seattle Times, and sinkhole data published by Kryptos Logic.
WannaCry, May 12, 2017. The worm was spreading across Europe and the National Health Service (NHS) was turning patients away. Marcus Hutchins, working for Kryptos Logic from England, found an unregistered domain inside a WannaCry sample and bought it on Namecheap for $10.69. He intended to sinkhole the traffic and count infected hosts.
The malware checked whether it could reach that domain before encrypting anything, and halted when it could. Darien Huss of Proofpoint reverse-engineered the check and confirmed the behavior. Spread of that variant stopped the same afternoon. It was a public sinkhole, the same idea as Figure 79 at internet scale.
The sinkhole contained the outbreak without eradicating it. Variants with different kill-switch domains appeared within days, and unpatched hosts were still reaching the sinkhole years later. WannaCry halted Honda's Sayama plant and infected Victoria's road safety cameras in June 2017, and Boeing reported an infection in March 2018. Use the time a sinkhole buys to patch.