Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Monitoring and incident response for OT

After this lesson: I can flag the requests in a capture that a baseline has never seen.

65 min lesson2 commandsIndustrial control system security lab: a simulated PLC, Modbus, HMI and conduit

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

WordWhat it means
Baselinea record of what normal traffic looks like
Anomalysomething that differs from the baseline
Passive monitoringwatching copies of traffic without sending any
Containmentstopping an attack spreading, without stopping the plant
Asset inventorya 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

Command
docker exec work python3 steps/baseline.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Worked example: what the lab printed

PartPairsMeaning
Baselinehmi 4, hmi 2, eng 3, eng 6The HMI reads, the engineering station reads and writes a setpoint
Alertslaptop 3, 8, 5 and 6Six requests from a machine never seen before
Not alertedeng 6 at 12.5A 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

Code: python
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

Command
docker exec work python3 steps/watch.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Responding on a live plant

DoDo not
Tell the operators and the safety team firstReboot or patch a PLC in the middle of a run
Contain at the conduit: block the stranger's pathPull the PLC off the network while it runs
Keep the captures and the PLC's logs as evidenceRun an active scan across the control zone
Check the safety system is still healthyTrust 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.

About this lab and its source: Industrial control system security lab: a simulated PLC, Modbus, HMI and conduit

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.