Watching a plant without disturbing it
Monitoring an OT network means learning what normal looks like and raising an alert when something new appears. Incident response is what you do next.
On a plant, the wrong response can do more harm than the attack. A reboot can stop a process and a scan can crash a PLC. You practise here in your own lab copy only.
By the end of this lesson
Note
I can flag the requests in a capture that a baseline has never seen.
Key words
| Word | What it means |
|---|---|
| Baseline | a record of what normal traffic looks like |
| Anomaly | something that differs from the baseline |
| Passive monitoring | watching copies of traffic without sending any |
| Containment | stopping an attack spreading, without stopping the plant |
| Asset inventory | a list of every device and what it talks to |
The cells students fill in are left blank in this preview.
The one rule
Warning
Monitor only networks you own or are allowed in writing to watch. On a real plant, never test a response by scanning, rebooting or isolating a device yourself. Act through the site's operators, because a careless action can stop a process people rely on.
A baseline is what normal looks like
Control traffic changes little. The same machines ask the same questions on the same timer. So a baseline can be short: which source used which function code.
The lab learns one from normal.txt, twenty quiet seconds. Then it reads capture.txt and alerts on every pair it has never seen. The security operations module taught detection rules; this one is learnt from the plant.
Learn a baseline and check a new capture
docker exec work python3 steps/baseline.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Worked example: what the lab printed
| Part | Pairs | Meaning |
|---|---|---|
| Baseline | hmi 4, hmi 2, eng 3, eng 6 | The HMI reads, the engineering station reads and writes a setpoint |
| Alerts | laptop 3, 8, 5 and 6 | Six requests from a machine never seen before |
| Not alerted | eng 6 at 12.5 | A known pair, so a baseline alone does not flag it |
The cells students fill in are left blank in this preview.
Try it: requests faster than usual
times = [0.0, 1.0, 2.0, 3.0, 3.1, 3.2, 3.3, 4.0]
gaps = []
for i in range(1, len(times)):
gaps.append(round(times[i] - times[i - 1], 1))
print("gaps:", gaps)
usual = 1.0
for i in range(len(gaps)):
if gaps[i] < usual / 2:
print("request at", times[i + 1], "came", gaps[i], "s after the last: faster than normal")
# Change usual to 0.1. Which requests are flagged now, and is that a good baseline?
Watch gently: copies of traffic, not new requests
On an office network, an analyst may scan every machine. On a plant that can crash an old PLC. So OT monitoring is passive: a switch sends a copy of the traffic to a sensor, which listens and never sends.
When you must ask a device, ask little and slowly. The next Run sends five reads, a second apart, and never a write.
Watch the PLC with a few slow reads
docker exec work python3 steps/watch.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Responding on a live plant
| Do | Do not |
|---|---|
| Tell the operators and the safety team first | Reboot or patch a PLC in the middle of a run |
| Contain at the conduit: block the stranger's path | Pull the PLC off the network while it runs |
| Keep the captures and the PLC's logs as evidence | Run an active scan across the control zone |
| Check the safety system is still healthy | Trust the HMI alone to say what the plant is doing |
The cells students fill in are left blank in this preview.
A common mistake
Warning
Many people think the first step in an incident is to shut everything down. On a plant, a sudden stop can be dangerous in itself. Contain first, at the conduit, while the operators keep the process safe, and stop the plant only as the operators decide.