PIVTR-D
RResponse loop

Contain

STARTS WHENScope clear enough to act, posture chosen, authority in hand.
DONE WHENNetwork, process, and log channels all show attacker activity stopped.
RECORDST3 Containment decision record.

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

#ItemOwner
1Reset passwords at the primary identity provider, privileged accounts firstOperations
2Rotate service account credentials, application programming interface (API) keys and programmatic tokensOperations
3Coordinate resets for accounts synced between on-premises and cloud directoriesOperations
4Revoke active sessions and authentication tokens at the identity provider (commands below)Operations
5Force-disconnect virtual private network (VPN), Remote Desktop Protocol (RDP) and Secure Shell (SSH) sessionsOperations
6Where the application supports it, increment the session token version to invalidate browser sessionsOperations
7Invalidate OAuth refresh tokens and offline access tokensOperations
8Where applications accept stateless JSON Web Tokens (JWTs), deny-list the attacker's tokensOperations
9Watch authentication logs for token endpoint requests that show cached credential useIntelligence/Investigations
10Apply conditional access: location, device compliance, risk-based blocking, phishing-resistant multifactor authentication (MFA)Operations
11Disable 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
12Find applications with local accounts outside the identity provider, and revoke those accounts separatelyOperations
13Revoke the OAuth-connected applications the compromised account authorizedOperations
14Disable automation rules, webhooks, continuous integration and delivery (CI/CD) deployment keys, and browser extensions with broad permissionsOperations

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.

ProviderRevoke sessionsBlock new sign-insAlso
Entra IDChoose 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:$falseRemove registered authentication methods and devices the attacker added
OktaChoose Clear User Sessions in the Admin Console, or call: DELETE /api/v1/users/<user-id>/sessions?oauthTokens=trueSuspend or deactivate the userSessions inside downstream applications survive. End them in each application.
Google WorkspaceReset sign-in cookies on the user in the Admin console, or call the Directory API method users.signOutSuspend the userRevoke OAuth tokens and app passwords separately
AWS IAMChoose 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 InactiveTemporary 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

#ItemOwner
15Capture memory first, with WinPMEM or Linpmem (commands)Operations
16Image the systems that contain unique evidence, such as patient zero and hosts running custom toolingIntelligence/Investigations
17Forward logs off the host as soon as the compromise is found, so they cannot be deletedOperations

Validate before calling it contained

#ItemOwner
18Network: firewall, proxy and Domain Name System (DNS) logs show no command and control (C2) traffic resuming, no new connection patterns and no protocol tunnelingIntelligence/Investigations
19Process: no respawned malware, no new persistence, no executables in unusual pathsIntelligence/Investigations
20Logs: no bursts of failed authentication, no privilege escalation, no unusual file accessIntelligence/Investigations

Decisions and records

Watch out
  • 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

Four stacked panels: Network with VLAN isolation, firewall rules and DNS sinkholes; Host with EDR isolation, local firewall and process restrictions; Application with WAF, app controls and revoking automations; Identity with credential revocation, session termination and conditional access.
Figure 77. Containment layers.
LayerUse it for
NetworkBroad, fast control over many systems at once
HostPrecision on a known-compromised endpoint
ApplicationAttacker tooling that network controls do not see
IdentitySoftware as a service (SaaS) and cloud paths, where it is frequently the only layer that reaches
DNS sinkhole flow: a host asks DNS to resolve a malicious domain, DNS matches it against a deny list and answers with an internal address, and the host connects to a quarantine server instead of the attacker.
Figure 79. DNS sinkholing redirects command and control traffic to a controlled destination.

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.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.