# Ics Incident Response Containment Recovery

> 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.

- Skill: `mizazhaider-ceh/ics-incident-response-containment-recovery` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/ics-incident-response-containment-recovery`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/ics-incident-response-containment-recovery/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/ics-incident-response-containment-recovery

---


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

1. Confirm the process is in a safe state with operations before
   any containment action. If it is not, stabilize the process first.
2. Decide containment with operations, per asset. Isolate, monitor
   only, or leave running under watch, with the reason recorded.
3. Preserve evidence before containment changes it. Passive capture,
   historian exports, HMI logs, and PLC logic copies, all hashed.
4. 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.
5. Eradicate. Clean or rebuild engineering workstations, reset
   credentials, remove unauthorized accounts and remote access, and
   verify no persistence remains.
6. Restore from known good baselines. PLC logic and firmware from
   offline backups, compared by hash to the approved baseline.
7. Recover in stages. One system at a time, with operations
   validating the process at each stage before the next starts.
8. Return to normal operations only on a signed check. Process
   stable, monitoring restored, and the incident record complete.
9. 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.

```python
#!/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"])
```

```bash
# 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.

```python
#!/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))
```

```bash
# 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.

```bash
# 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.

