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

Free lesson

Safety versus security in a control system

After this lesson: I can explain why a safety trip must sit outside what the network can write.

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

A limit nobody on the network can move

Safety in a control system means people and the plant are not harmed, whatever goes wrong. Security means nobody can make the system do what they should not.

The two meet when an attacker tries to push a plant past its limits. A good design keeps the last limit out of the attacker's reach. You test that in your own lab copy only.

By the end of this lesson

Note

I can explain why a safety trip must sit outside what the network can write.

Key words

WordWhat it means
Safetyprotection from harm to people and the plant
Securityprotection from people who should not be in control
Safety tripa stop that takes over when a limit is passed
Latchto stay in a state until somebody resets it
SISa safety instrumented system, kept apart from the control logic

The cells students fill in are left blank in this preview.

The one rule

Warning

The next Run forces a pump in your own simulated lab. Never try anything like it on a real plant or device, even a test rig, without written permission. It can be a crime under the Computer Misuse Act 1990, and a real tank overflowing can hurt somebody.

Control logic and safety are kept apart

The control logic runs the plant well: it keeps the tank between 20 and 80 per cent. The safety function has one job: stop the pump if the level reaches 95, whatever the logic or anybody else says.

In the lab PLC the safety function runs after the logic in every scan. Its limit is a constant in the program, not a Modbus register. Once tripped, it latches.

Try it: where the limit is kept

Code: python
registers = {"high_setpoint": 80, "trip_level": 95}   # a bad design: the trip is a register


def write(name, value):
    registers[name] = value


write("trip_level", 200)      # somebody's write over the network
level = 96
print("trip as a register:", level >= registers["trip_level"])
TRIP_LEVEL = 95               # the lab's design: a constant in the program
print("trip as a constant:", level >= TRIP_LEVEL)
# Write 90 into "high_setpoint" instead. Does it change either answer?

Force the pump and watch the trip hold

This Run behaves like an attacker in your own copy. It writes manual mode and pump on, with no password. The tank fills by one per cent a scan.

At exactly 95 the trip latches. The pump command coil still says on, because the write was obeyed. But the pump is not running, because the safety function overrules it.

Force the pump on in your own copy

Command
docker exec work python3 steps/override.py

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

Worked example: what the lab printed

LineValueWhat it shows
safety trip latchedTrueThe limit was reached
level when it tripped95The trip acted at its limit
pump command coil still onTrueThe attacker's write stands
pump runningFalseThe safety function overruled it

The cells students fill in are left blank in this preview.

Only a person at the panel resets it

A trip that the network could clear would be no defence. So the lab's trip is cleared only by panel_reset.py, which runs inside the PLC's own container, like a key on its panel.

Even then it waits until the level is below 90. A person must see that the plant is safe before it starts again.

Reset the trip at the PLC's panel

Command
docker exec plc python3 panel_reset.py

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

A common mistake

Warning

Many people think a safety system makes security unimportant. A safety trip stops one harm at one limit, and only if it is kept apart. In 2017 malware called Triton went after a plant's safety system itself. So safety systems are separated, and their changes need a person on site.

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.