Lesson 39 — The Device Needed Containment — What Happens Next?
By now the evidence was no longer a collection of weak clues.
The endpoint had shown suspicious PowerShell execution, file creation, outbound communication, persistence and possible credential access. The affected account had then appeared on another device.
The SOC had reached an operational decision:
the device needed containment.
But containment is not simply pressing an isolation button. The analyst must understand what evidence needs preserving, who needs coordinating, what business impact isolation may create and what must be checked afterwards.
The investigation became a response
Preserve the timeline, assess business impact, coordinate isolation, investigate related identities and devices, and verify that containment achieved its purpose.
Case briefing
Investigation objective
Move from evidence-led investigation into controlled containment without losing the timeline, overlooking related entities or assuming isolation alone has removed the threat.
Investigator's rule
Containment is a response action, not the end of the investigation. Isolation can stop communication while the SOC still needs to understand scope, persistence, credentials and remediation.
Stage 1 — record why containment is justified
| Evidence | Why it matters |
|---|---|
| Suspicious process chain | Connects browser activity to PowerShell and the unknown executable. |
| Outbound connection | Shows the suspicious process communicating externally. |
| Persistence | Indicates an attempt to maintain execution. |
| LSASS-related activity | Raises possible credential-access risk. |
| Second-device logon | Expands concern beyond the original endpoint. |
Write the reason before acting
A responder reviewing the incident later should be able to see exactly which evidence justified containment at that moment.
Urgency still needs discipline
Strong evidence may require rapid action, but urgency does not remove the need for timestamps, notes and coordination.
Stage 2 — preserve the immediate endpoint timeline
let TargetDevice = "WS-FIN-044";
let StartTime = datetime(2026-08-25 10:10:00);
let EndTime = datetime(2026-08-25 10:25:00);
DeviceProcessEvents
| where DeviceName =~ TargetDevice
| where Timestamp between (StartTime .. EndTime)
| project Timestamp,
AccountName,
FileName,
ProcessCommandLine,
InitiatingProcessFileName,
SHA1
| order by Timestamp asc
Preserve the pivots
Record important hashes, process names, command lines, accounts, IP addresses, URLs, task names and timestamps before response actions alter the endpoint state.
Use the incident record
Investigation notes should explain what was observed, what was inferred, what remains unknown and which response action was authorised.
Stage 3 — assess the impact of isolation
Asset criticality matters
Isolating an employee workstation and isolating a production server can have very different operational consequences.
Risk can override convenience
Business impact must be considered, but active compromise may still justify immediate containment under the organisation's incident-response procedures.
Stage 4 — isolate through the approved response process
Microsoft Defender for Endpoint can provide device-response capabilities such as device isolation when the required permissions and platform support are available. The analyst should use the organisation's authorised incident-response procedure rather than improvising a containment action.
Isolation is not deletion
Containing the endpoint is intended to restrict its ability to communicate. It does not automatically remove persistence, malicious files or compromised credentials.
Keep the case open
The device may be isolated while investigation continues into other endpoints, accounts, cloud sessions and infrastructure.
Stage 5 — check the second device immediately
let RelatedDevice = "WS-HR-021";
DeviceProcessEvents
| where Timestamp > ago(24h)
| where DeviceName =~ RelatedDevice
| project Timestamp,
AccountName,
FileName,
ProcessCommandLine,
InitiatingProcessFileName,
InitiatingProcessCommandLine,
SHA1
| order by Timestamp asc
Containment scope may grow
If the second endpoint shows related malicious activity, the response plan must expand. Isolating only the first device may be insufficient.
Do not chase devices blindly
Use evidence to determine which related endpoints require containment. A shared account or ordinary logon does not automatically make every device compromised.
Stage 6 — investigate the affected identity
let TargetAccount = "alex.wilson";
DeviceLogonEvents
| where Timestamp > ago(24h)
| where AccountName =~ TargetAccount
| project Timestamp,
DeviceName,
ActionType,
LogonType,
RemoteIP,
RemoteDeviceName
| order by Timestamp asc
Endpoint containment does not contain identity
If credentials or sessions are compromised, isolating a workstation does not automatically prevent the account from being used elsewhere.
Coordinate identity remediation
Password reset, session revocation, authentication-method review and other identity actions should follow the organisation's response process and the evidence collected during the incident.
Stage 7 — verify what happened after containment
Containment needs validation
Confirm that the intended response action completed successfully and continue monitoring for evidence that the attacker remains active elsewhere.
Recovery is a separate decision
Do not reconnect a device simply because the immediate alert has stopped. Recovery should follow remediation and validation.
Stage 8 — separate containment, remediation and recovery
| Phase | Purpose |
|---|---|
| Containment | Limit the attacker's ability to continue or spread. |
| Investigation | Determine scope, evidence, affected entities and attack sequence. |
| Remediation | Remove malicious artifacts, persistence and compromised access. |
| Recovery | Return systems safely to normal operation after validation. |
Stage 9 — make the SOC response record defensible
Lesson 39 key takeaways
- Containment should be justified by documented evidence.
- Preserve important pivots and timestamps before changing endpoint state.
- Consider asset criticality and operational impact.
- Use authorised incident-response procedures for device isolation.
- Isolation does not automatically remove malicious artifacts or persistence.
- Endpoint containment does not automatically contain a compromised identity.
- Investigate related devices before assuming the incident is contained.
- Separate containment, remediation and recovery decisions.
- Verify the response action and continue hunting afterwards.
- Document who acted, what changed, when it changed and why.
Module 4 — Endpoint Incidents: Following the Attack Chain
Lesson 39 moves the SOC from investigation into response. In the final lesson of Module 4, Agent Foskett reconstructs the complete endpoint compromise from the original execution chain through persistence, credential access, movement and containment.
Continue your SOC Analyst training
🔎 SOC Analyst Academy — Module 4: Endpoint Incidents: Following the Attack Chain
How to contain a compromised endpoint in Microsoft Defender XDR
Lesson 39 of the Agent Foskett SOC Analyst Academy teaches analysts how to move from investigation to containment, preserve endpoint evidence, assess business impact, coordinate device isolation and continue hunting related identities and devices.
SOC endpoint containment and remediation workflow
Learn the difference between containment, investigation, remediation and recovery, and how Microsoft Defender XDR telemetry supports an evidence-led response to an endpoint compromise.
