IT containment usually means isolate first and ask later. OT
containment means ask operations first, because isolating the wrong
controller can stop a process unsafely or leave it without its safety
monitoring. This sub-skill covers the middle of an OT incident, from
the containment decision through staged recovery and return to
normal operations. Triage and initial scoping live in the parent
ics-incident-response skill. This one picks up where that leaves off.
Safety warning. Human safety outranks evidence, and process safety
outranks speed of recovery. No containment or recovery step runs
without operations approval, and no safety system is touched at all
outside a dedicated safety assessment. If a step could change the
process state, it waits for the operations lead to say go.
Quick Workflow
- Confirm the process is in a safe state with operations before
any containment action. If it is not, stabilize the process first.
- Decide containment with operations, per asset. Isolate, monitor
only, or leave running under watch, with the reason recorded.
- Preserve evidence before containment changes it. Passive capture,
historian exports, HMI logs, and PLC logic copies, all hashed.
- Contain in the least disruptive effective way. Network isolation
at the boundary first, host isolation second, controller action
only with operations and a maintenance window.
- Eradicate. Clean or rebuild engineering workstations, reset
credentials, remove unauthorized accounts and remote access, and
verify no persistence remains.
- Restore from known good baselines. PLC logic and firmware from
offline backups, compared by hash to the approved baseline.
- Recover in stages. One system at a time, with operations
validating the process at each stage before the next starts.
- Return to normal operations only on a signed check. Process
stable, monitoring restored, and the incident record complete.
- Review. Update the OT playbook with what the process constraints
changed about the plan, and what to do faster next time.
1. Containment decision record
A containment decision without a written reason cannot be reviewed
later, and it cannot be defended if the process is affected. Record
every asset decision in the same format.
#!/usr/bin/env python3
"""Containment decision record for OT assets."""
decisions = [
{"asset": "engineering-workstation-01", "decision": "isolate",
"reason": "suspected persistence, process does not need it running",
"approved_by": "operations lead, name here"},
{"asset": "plc-press-01", "decision": "monitor only",
"reason": "isolating it would stop the press unsafely",
"approved_by": "operations lead, name here"},
{"asset": "historian-dmz-01", "decision": "isolate from IT",
"reason": "blocks IT to OT path while keeping OT collection running",
"approved_by": "operations lead, name here"},
]
for item in decisions:
print("%s: %s" % (item["asset"], item["decision"]))
print(" reason: %s" % item["reason"])
print(" approved by: %s" % item["approved_by"])
# Passive capture for evidence, started before containment changes traffic
mkdir -p /tmp/ot_ir
sudo tshark -i eth0 -f "not arp" -w /tmp/ot_ir/capture.pcap &
echo $! > /tmp/ot_ir/capture.pid
# Stop it only when the capture window is agreed, then hash it
# kill $(cat /tmp/ot_ir/capture.pid)
sha256sum /tmp/ot_ir/capture.pcap > /tmp/ot_ir/capture.sha256
cat /tmp/ot_ir/capture.sha256
2. Evidence hashing and timeline
Hashing at collection time is what makes OT evidence hold up later.
Historian data, logs, and logic copies each get a hash and a
collection note, including who collected them and from where.
#!/usr/bin/env python3
"""Hash OT evidence files and build a simple collection manifest."""
import hashlib
import pathlib
BASE = pathlib.Path("/tmp/ot_ir")
for path in sorted(BASE.iterdir()):
if path.is_file() and path.suffix != ".sha256":
digest = hashlib.sha256(path.read_bytes()).hexdigest()
print("%s %s" % (digest, path.name))
(path.with_suffix(path.suffix + ".sha256")).write_text(
"%s %s\n" % (digest, path.name))
# Historian timeline pull for the incident window (read only)
# Replace the window and tag list with the real incident scope
echo "Incident window: fill in start and end times here"
echo "Tags to export: process values, alarms, and operator actions"
echo "Export to /tmp/ot_ir/historian_export.csv, then hash it"
sha256sum /tmp/ot_ir/historian_export.csv 2>/dev/null || echo "Export not yet present"
3. Staged recovery checklist
Recovery that restores everything at once cannot be validated. Each
stage ends with an operations check, and the next stage waits for it.
# Staged recovery checklist, one stage at a time, operations signs each
cat << 'EOF'
Stage 1: Restore engineering workstation from known good image.
Check: workstation clean, credentials reset, no unknown accounts.
Stage 2: Restore PLC logic from offline approved backup, hash verified.
Check: logic hash matches baseline, process values read correctly.
Stage 3: Restore historian and HMI connectivity.
Check: trends flowing, alarms visible, operator actions logging.
Stage 4: Restore IT to OT bridge through the industrial DMZ only.
Check: no direct IT to control path, firewall rules as approved.
Stage 5: Return to normal operations, signed by operations lead.
Check: process stable for an agreed observation window.
EOF
Edge cases
- No known good backup. Recovery without a baseline means rebuilding
logic from documentation and vendor defaults, then validating it
in a lab before it touches a live controller. Say so, and do not
present a rebuilt program as a verified restore.
- Evidence on a controller that cannot be copied. Some controllers
offer no clean export. Photograph screens, record values by hand
with two witnesses, and note the limitation in the record.
- Containment that changes the process. If isolating a host changes
a control loop, operations must approve a safe process state
first, even if that delays containment by hours.
- Credential reset scope. Resetting a shared engineering password
affects every controller it unlocks. Coordinate the reset order
with operations so no controller is left unreachable mid incident.
- Recovery during a safety event. If a safety trip occurs during
recovery, stop recovery, let the safety system do its job, and
restart the recovery plan only after the safety team clears it.
- Legal and regulatory hold. Some OT incidents require evidence
preservation beyond the technical recovery. Check with legal and
the asset owner before deleting any collected artifact.
Key references
- NIST SP 800-82 Rev 3, Guide to Operational Technology Security,
for OT incident response, containment, and recovery constraints.
- NIST SP 800-61 Rev 3, Computer Security Incident Handling Guide,
adapted here to OT priorities where safety comes first.
- IEC 62443 incident and patch management concepts, for how OT
recovery should be staged and approved.
- Parent skill ics-incident-response, for OT triage, scoping, and
the playbook this containment and recovery sub-skill extends.
1---2name: ics-incident-response-containment-recovery3parent: ics-incident-response4description: Use when containing and recovering from a suspected incident in an OT or SCADA environment. Covers safety first containment decisions with operations, OT evidence preservation without disrupting the process, staged recovery from known good PLC logic and backups, credential and engineering workstation remediation, and return to normal operations checks. Also use when an IT containment playbook would isolate a controller that the process still needs.5version: 1.0.06domain: ics-scada7lifecycle: stable8last_verified: '2026-10-27'9requires: [ics-incident-response]10extends: []11relates: [plc-basics, safety-systems, scada-network-seg]12tools:13 - name: Python14 version: "3.12"15 - name: Wireshark16 version: "4.4"17 - name: nmap18 version: "7.98"19metadata:20 source: https://skillmd.com/skills/mizazhaider-ceh/ics-incident-response-containment-recovery21---2223IT containment usually means isolate first and ask later. OT24containment means ask operations first, because isolating the wrong25controller can stop a process unsafely or leave it without its safety26monitoring. This sub-skill covers the middle of an OT incident, from27the containment decision through staged recovery and return to28normal operations. Triage and initial scoping live in the parent29ics-incident-response skill. This one picks up where that leaves off.3031Safety warning. Human safety outranks evidence, and process safety32outranks speed of recovery. No containment or recovery step runs33without operations approval, and no safety system is touched at all34outside a dedicated safety assessment. If a step could change the35process state, it waits for the operations lead to say go.3637## Quick Workflow38391. Confirm the process is in a safe state with operations before40 any containment action. If it is not, stabilize the process first.412. Decide containment with operations, per asset. Isolate, monitor42 only, or leave running under watch, with the reason recorded.433. Preserve evidence before containment changes it. Passive capture,44 historian exports, HMI logs, and PLC logic copies, all hashed.454. Contain in the least disruptive effective way. Network isolation46 at the boundary first, host isolation second, controller action47 only with operations and a maintenance window.485. Eradicate. Clean or rebuild engineering workstations, reset49 credentials, remove unauthorized accounts and remote access, and50 verify no persistence remains.516. Restore from known good baselines. PLC logic and firmware from52 offline backups, compared by hash to the approved baseline.537. Recover in stages. One system at a time, with operations54 validating the process at each stage before the next starts.558. Return to normal operations only on a signed check. Process56 stable, monitoring restored, and the incident record complete.579. Review. Update the OT playbook with what the process constraints58 changed about the plan, and what to do faster next time.5960## 1. Containment decision record6162A containment decision without a written reason cannot be reviewed63later, and it cannot be defended if the process is affected. Record64every asset decision in the same format.6566```python67#!/usr/bin/env python368"""Containment decision record for OT assets."""69decisions = [70 {"asset": "engineering-workstation-01", "decision": "isolate",71 "reason": "suspected persistence, process does not need it running",72 "approved_by": "operations lead, name here"},73 {"asset": "plc-press-01", "decision": "monitor only",74 "reason": "isolating it would stop the press unsafely",75 "approved_by": "operations lead, name here"},76 {"asset": "historian-dmz-01", "decision": "isolate from IT",77 "reason": "blocks IT to OT path while keeping OT collection running",78 "approved_by": "operations lead, name here"},79]80for item in decisions:81 print("%s: %s" % (item["asset"], item["decision"]))82 print(" reason: %s" % item["reason"])83 print(" approved by: %s" % item["approved_by"])84```8586```bash87# Passive capture for evidence, started before containment changes traffic88mkdir -p /tmp/ot_ir89sudo tshark -i eth0 -f "not arp" -w /tmp/ot_ir/capture.pcap &90echo $! > /tmp/ot_ir/capture.pid91# Stop it only when the capture window is agreed, then hash it92# kill $(cat /tmp/ot_ir/capture.pid)93sha256sum /tmp/ot_ir/capture.pcap > /tmp/ot_ir/capture.sha25694cat /tmp/ot_ir/capture.sha25695```9697## 2. Evidence hashing and timeline9899Hashing at collection time is what makes OT evidence hold up later.100Historian data, logs, and logic copies each get a hash and a101collection note, including who collected them and from where.102103```python104#!/usr/bin/env python3105"""Hash OT evidence files and build a simple collection manifest."""106import hashlib107import pathlib108109BASE = pathlib.Path("/tmp/ot_ir")110for path in sorted(BASE.iterdir()):111 if path.is_file() and path.suffix != ".sha256":112 digest = hashlib.sha256(path.read_bytes()).hexdigest()113 print("%s %s" % (digest, path.name))114 (path.with_suffix(path.suffix + ".sha256")).write_text(115 "%s %s\n" % (digest, path.name))116```117118```bash119# Historian timeline pull for the incident window (read only)120# Replace the window and tag list with the real incident scope121echo "Incident window: fill in start and end times here"122echo "Tags to export: process values, alarms, and operator actions"123echo "Export to /tmp/ot_ir/historian_export.csv, then hash it"124sha256sum /tmp/ot_ir/historian_export.csv 2>/dev/null || echo "Export not yet present"125```126127## 3. Staged recovery checklist128129Recovery that restores everything at once cannot be validated. Each130stage ends with an operations check, and the next stage waits for it.131132```bash133# Staged recovery checklist, one stage at a time, operations signs each134cat << 'EOF'135Stage 1: Restore engineering workstation from known good image.136 Check: workstation clean, credentials reset, no unknown accounts.137Stage 2: Restore PLC logic from offline approved backup, hash verified.138 Check: logic hash matches baseline, process values read correctly.139Stage 3: Restore historian and HMI connectivity.140 Check: trends flowing, alarms visible, operator actions logging.141Stage 4: Restore IT to OT bridge through the industrial DMZ only.142 Check: no direct IT to control path, firewall rules as approved.143Stage 5: Return to normal operations, signed by operations lead.144 Check: process stable for an agreed observation window.145EOF146```147148## Edge cases149150- No known good backup. Recovery without a baseline means rebuilding151 logic from documentation and vendor defaults, then validating it152 in a lab before it touches a live controller. Say so, and do not153 present a rebuilt program as a verified restore.154- Evidence on a controller that cannot be copied. Some controllers155 offer no clean export. Photograph screens, record values by hand156 with two witnesses, and note the limitation in the record.157- Containment that changes the process. If isolating a host changes158 a control loop, operations must approve a safe process state159 first, even if that delays containment by hours.160- Credential reset scope. Resetting a shared engineering password161 affects every controller it unlocks. Coordinate the reset order162 with operations so no controller is left unreachable mid incident.163- Recovery during a safety event. If a safety trip occurs during164 recovery, stop recovery, let the safety system do its job, and165 restart the recovery plan only after the safety team clears it.166- Legal and regulatory hold. Some OT incidents require evidence167 preservation beyond the technical recovery. Check with legal and168 the asset owner before deleting any collected artifact.169170## Key references171172- NIST SP 800-82 Rev 3, Guide to Operational Technology Security,173 for OT incident response, containment, and recovery constraints.174- NIST SP 800-61 Rev 3, Computer Security Incident Handling Guide,175 adapted here to OT priorities where safety comes first.176- IEC 62443 incident and patch management concepts, for how OT177 recovery should be staged and approved.178- Parent skill ics-incident-response, for OT triage, scoping, and179 the playbook this containment and recovery sub-skill extends.