Cyber-Physical Systems (BIL-435), week 11 of 14

Security of Cyber-Physical Systems: False Data Injection and Defences

Prof. Dr. Utku Kose, Süleyman Demirel University

Overview

Weeks 1 to 10 assumed that every reading and every command of the campus is what it claims to be. This week drops that assumption. An attacker who reaches the networks of Week 8 can forge commands, change readings and replay old data. Because the campus acts on what it reads, such attacks reach the physical world [1]. The week studies three attacks and the defences against them.

flowchart LR
  A["Threats and attack surfaces"] --> B["False data injection"]
  B --> C["Replay and denial of service"]
  C --> D["Defences in depth"]
  D --> S["The campus microgrid, stage 11"]
  S --> FT["In the field: An unknown device"]
  FT --> H["Learning machines"]
Python code of this week

Every method on this page is also written as Python code in the Colab notebook of the week. Its code is divided into numbered sections. Each orange box on this page names the section whose code carries out what the text above the box explains. The box says what to run and what to look at in that section, and its button opens the Colab notebook at that place. The virtual laboratories, the practice parts and the self-assessment of the week are in the interactive lab. Each blue box opens one part of the interactive lab. The part ends with a link back to its box on this page, and the Colab notebook is always opened from the orange boxes here.

Python step 11: Hashes and keys

Open in Colab

Python code in the Colab notebook, right after Section 0 (setup). Open the Colab notebook and run this step cell by cell: It consists of short pieces of Python code with their explanations, a quick check and three exercises. Topics: Hash functions · A keyed hash · Counters against replay.

The step computes the fingerprint of a Modbus frame with a hash function of the family Secure Hash Algorithm (SHA), SHA-256, from the module hashlib. It then adds a secret key with the module hmac and numbers messages against replay [2]. These are the tools of the defences in the second half of the week. Students who have never programmed start with the start-here notebook of the course.

The campus microgrid so far

Weeks 1 to 10 built the balance, the dynamics, the modes, the measurements, the controllers and the estimators of the campus. They added its real-time tasks, networks, optimal plans and forecasts. All of them trusted their inputs.

This week attacks the campus through its own data and commands and builds the defences that keep it safe.

The campus microgrid through the fourteen weeks of the course. The figure marks the stage of this week.
The campus microgrid through the fourteen weeks of the course. The figure marks the stage of this week.

Threats and attack surfaces

Information security pursues three goals: Confidentiality, integrity and availability. An office network puts confidentiality first. A cyber-physical system turns the order around. A wrong command or a frozen control loop can damage equipment or hurt people, while a disclosed reading usually cannot. The guide of the National Institute of Standards and Technology (NIST) on operational technology (OT) therefore weighs integrity and availability highest [3].

Cárdenas and colleagues divide the attacks on a control system into two classes [1]. Deception attacks send false readings or false commands. Denial-of-service (DoS) attacks block or delay the true ones. Teixeira and colleagues describe what an attacker needs as three resources [4]. Model knowledge tells how the system works, disclosure lets the attacker read its data, and disruption lets the attacker change or block data. Each attack of this week uses a different combination.

The best known attack on a cyber-physical system is Stuxnet. It reached the controllers of a uranium enrichment plant and changed the speed of the centrifuges. Meanwhile it showed the operators recorded values of normal operation [5, 6]. Surveys collect the threats, attacks and defences of many kinds of cyber-physical systems [7]. The campus offers smaller targets, but the same kinds of entry points.

Entry pointWhat an attacker reachesWeek
RS-485 bus of the battery container (Modbus RTU)Setpoints of the inverter and readings of the battery management system8
Broker of the campus messages (MQTT)Readings of the buildings and commands of the chargers8
Meters and the data concentratorThe readings of the state estimate in the control room4 and 6
Feed of the weather serviceThe forecasts and the battery plan of the next day9 and 10
Engineering laptop with the PLC softwareThe program of the programmable logic controller7
Remote maintenance access of the inverter makerThe settings and the firmware of the inverter8

A worked example. At 19:00 of the spring day of Week 1, the campus would import 585.67 kW without the battery. The rule of Week 1 discharges 135.67 kW and holds the import at 450.00 kW. An attacker on the bus of the battery container sends function 06, Write Single Register, to the inverter at address 2. The request sets register 100, the power setpoint, to −250 kW, charging with full power. The frame is 02 06 00 64 FF 06, followed by the cyclic redundancy check (CRC) 09 D4.

The inverter checks the CRC, finds it right and obeys. The import of the hour becomes \(585.67 + 250 = 835.67\) kW, 235.67 kW above the contracted limit of 600 kW. The CRC of Week 8 finds random errors on the line, but it uses no secret. The attacker computes it as easily as the controller does.

Animation. A forged setpoint. Choose the hour and the setpoint that the attacker writes into register 100 of the battery inverter, and watch the import of the spring day. With a counter and a tag on the bus, the inverter rejects the frame and the rule of Week 1 keeps the import at 450 kW.

Left: The import of the spring day without the battery, with the rule of Week 1 and with the forged command at 19:00. Right: The resources that six kinds of attack need: Knowledge of the model, disclosure of the data and disruption of the data.
Left: The import of the spring day without the battery, with the rule of Week 1 and with the forged command at 19:00. Right: The resources that six kinds of attack need: Knowledge of the model, disclosure of the data and disruption of the data.

Check your understanding. Why can the CRC of a Modbus frame not protect it against an attacker?

Open in Colab

Python code in the Colab notebook, Section 1. Open Section 1 of the Colab notebook and run it. The function write_request builds the forged frame of function 06 with its CRC, and crc16_modbus checks it as the inverter does. The code prints the frame and the import of the evening hours with the rule of Week 1 and with the forged command. It then draws the whole day.

Discuss: Entry points of the campus
  1. Which entry point of the table above would you close first, and what would it cost the daily work of the campus?
  2. An attacker can reach the bus only from inside the battery container. Does this make the forged command unlikely, or only different?

False data injection

The control room of Week 6 estimates the six feeders of the campus from thirteen meters by weighted least squares (WLS). The weights are \(W = R^{-1}\), the inverses of the variances of the meters. The test value \(J\) sums the weighted squared residuals and raises a bad-data alarm above the 99 percent quantile of the chi-square distribution:

\[\hat{\mathbf{x}} = \left(H^T W H\right)^{-1} H^T W \mathbf{z}, \qquad \mathbf{r} = \mathbf{z} - H\hat{\mathbf{x}}, \qquad J = \mathbf{r}^T W \mathbf{r}\]

Liu, Ning and Reiter showed that this test has a blind direction [8]. An attacker who knows \(H\) adds the false data \(\mathbf{a} = H\mathbf{c}\) to the readings. The readings then look exactly like those of a system whose state is \(\mathbf{x} + \mathbf{c}\). The estimate moves by \(\mathbf{c}\), and the residual does not change at all:

\[\mathbf{z}_a = \mathbf{z} + H\mathbf{c} \quad \Rightarrow \quad \hat{\mathbf{x}}_a = \hat{\mathbf{x}} + \mathbf{c}, \qquad \mathbf{r}_a = \mathbf{r}, \qquad J_a = J\]

Such a false data injection (FDI) is called hidden or stealthy. A change of one meter alone, in contrast, breaks the consistency of the readings and raises \(J\).

→ These formulas with numbers, step by step: Lab Part B, calculator, steps 1 to 4.

A worked example. Two feeders have one meter each, \(z_1 = 120\) and \(z_2 = 80\) kW, and the main meter reads their sum \(z_3 = 206\) kW. All three have \(\sigma = 2\) kW. The mismatch is \(u = z_1 + z_2 - z_3 = -6\) kW. Least squares gives \(\hat{x}_1 \)​\({}= (2z_1 - z_2 + z_3)/3 \)​\({}= 122.00\) kW and \(\hat{x}_2 = 82.00\) kW. The residuals are \(u/3\), \(u/3\) and \(-u/3\), so \(J = u^2/(3\sigma^2) = 36/12 = 3.00\). That lies below 6.63, the threshold with one degree of freedom.

An attacker adds 20 kW to \(z_1\) alone. The mismatch becomes 14 kW, \(J = 196/12 = 16.33\), and the test raises an alarm. A second attacker adds 20 kW to \(z_1\) and to \(z_3\), the first column of \(H\). The mismatch stays −6 kW and \(J\) stays 3.00, while \(\hat{x}_1\) rises by the full 20 kW to 142.00 kW.

Scene: The plane of consistent readings. Three meters span a space of readings: Feeder 1, feeder 2 and the main meter, which measures their sum. The five buttons show the readings as a point, the plane of consistent readings with the estimate and the slab that the chi-square test accepts. They then follow an attack on one meter and a hidden attack along the plane. The views Front and Along the plane show the space from two sides.

The control room of the campus sheds the dormitory B3 when its estimate exceeds 150 kW, its rated load. At 19:00 the estimate is 103.93 kW and \(J = 8.04\) against the threshold 18.48. An attacker who changes only the B3 feeder meter must add 68.65 kW, because the estimate follows that meter with a share of 0.671. The test value then jumps to 658.61, a certain alarm.

The hidden attack adds 50 kW to the B3 feeder meter, the B3 building meter and the main meter, the third column of \(H\). The test value stays at 8.04, the estimate of B3 rises to 153.93 kW, and the control room sheds B3 without any alarm. Any hidden shift above 46.07 kW would do the same.

Left: The six feeder estimates without an attack, with one meter changed and with the hidden attack, with their test values J. Right: The test value against the shift of the B3 estimate for three ways of attack, on a logarithmic scale.
Left: The six feeder estimates without an attack, with one meter changed and with the hidden attack, with their test values J. Right: The test value against the shift of the B3 estimate for three ways of attack, on a logarithmic scale.

Check your understanding. Why does the hidden attack leave the test value J unchanged?

Open lab Part A

Interactive lab, Part A. The main switchboard in 3D: Seven panels with the main meter and the feeder meters, and the meters of the buildings. The rack holds the data concentrator, and the laptop of an attacker sits on the network switch. Change readings, tag meters and watch the control room. The results can be copied into the Colab notebook.

Open lab Part B

Interactive lab, Part B. The calculator of the week computes the estimate and the test of two feeders and three meters step by step. It then follows an attack on one meter, a hidden attack and a hidden attack with the main meter protected.

Open in Colab

Python code in the Colab notebook, Section 2. Open Section 2 of the Colab notebook and run it. The function wls is the state estimate of Week 6, and injection turns changes of named meters into the vector a. The code prints the change of one meter that sheds B3 with its J, and the hidden attack along a column of H. Paste the results of Part A into MY_ATTACKS, and the code sends each of your attacks to the control room again.

Discuss: What the attacker must know
  1. The hidden attack needs the matrix H. Where could an attacker of the campus learn it, and how could the campus make it harder?
  2. Which hidden attack would hurt the campus more than shedding B3?

Attacks on control loops: Replay and denial of service

A control loop gives the attacker two more options. A denial-of-service attack blocks the messages of the loop. The controller notices that no measurement arrives, for example with a watchdog as in Week 7, and falls back to a safe mode. A delay is subtler: Beyond the delay margin of 1.072 s of Week 8, the frequency loop of the island becomes unstable.

A replay attack records measurements of normal operation and plays them back while the attacker acts on the plant, as Stuxnet did. Mo and Sinopoli showed why this works [9]. In steady operation the replayed readings are real readings of the same system, so they have the same statistics as live ones. Every test that looks only at the readings, the chi-square test included, sees nothing wrong.

The island of the campus shows the danger. The battery holds the frequency with its droop of Weeks 2 and 5. It reads the frequency meter every \(\Delta t = 0.1\) s and sets its power from the measurement \(y_t\). Over one step, the frequency deviation follows the swing equation of Week 2:

\[f_{t+1} = \alpha f_t + \beta \left(P_t - d_t\right), \qquad \alpha = e^{-D\Delta t / M} = 0.9851, \qquad \beta = \frac{1 - \alpha}{D} = 1.2407 \ \text{mHz per kW}, \qquad P_t = -K y_t\]

Here \(d_t\) is the change of the load, \(M = 80\) kW·s/Hz, \(D = 12\) kW/Hz and \(K = 125\) kW/Hz. An attacker inserts a small box into the line of the frequency meter. It records the frequency from 20 to 60 s and replays the recording from 60 s. At 80 s a forged command starts three cars, the load step of 66 kW of Week 2.

The battery sees a calm frequency and does not respond. The true frequency falls with the time constant \(M/D = 6.67\) s and reaches the protection limit of 47.5 Hz at 84.0 s. The island trips 4.0 s after the step, as the island without droop did in Week 2.

Mo and Sinopoli proposed a physical watermark [9, 6]. The battery adds a small secret random power \(\omega_t\) to its setpoint, \(P_t = -K y_t + \omega_t\). One step later the measured frequency must have moved by \(\beta\,\omega_t\). A recording cannot know the current watermark, so a replay does not show this response. The detector measures the response as the slope of the movement \(m_{t+1}\) against the watermark over the last \(N\) steps:

\[m_{t+1} = y_{t+1} - (\alpha - \beta K)\,y_t, \qquad g = \frac{\sum \omega_t\, m_{t+1}}{\beta \sum \omega_t^2}, \qquad \text{alarm when } g < 0.5\]

In normal operation \(g\) stays close to 1, and under a replay it falls to about 0. After an alarm the battery switches to its own measurement of the frequency.

A worked example. Four steps have the watermark \(\omega = 8, -6, 10\) and \(-4\) kW. Their movements are \(m = 9.1, -8.2, 12.0\) and \(-3.5\) mHz, and \(\beta = 1.24\) mHz per kW. The sum of the products is \(72.8 + 49.2 + 120.0 + 14.0 = 256.0\), and \(\beta \sum \omega^2 \)​\({}= 1.24 \times 216 \)​\({}= 267.84\). So \(g = 256.0/267.84 = 0.96\): The frequency answers the watermark. Replayed movements of \(m = -2.1, 4.0, 1.3\) and \(-5.2\) mHz give \(g = -7.0/267.84 = -0.03\): An alarm.

A watermark of 10 kW with a window of 5 s finds the replay at 62.6 s, 2.6 s after it starts. The battery then holds the frequency at about −0.50 Hz after the step, close to the −0.482 Hz of the droop of Week 2. The price is a noisier frequency: Its jitter in normal operation grows from 5.53 to 21.45 mHz. A smaller watermark needs a longer window. With 2 kW, a window of 20 s raises a false alarm at 22.0 s. A window of 30 s finds the replay at 72.7 s, with a jitter of 6.81 mHz.

In everyday life: A question at the door

A recording of a neighbour's voice can ask perfectly for the door to be opened. A careful resident therefore asks a question whose answer changes every day, such as the colour of today's umbrella. The recording cannot answer it. The watermark is such a question, asked of the physics of the island ten times a second.

Left: The frequency of the island under the replay without a watermark, with what the battery sees, and with a watermark of 2 kW and a window of 30 s. Right: The response g to the watermark for two settings, with the threshold 0.5 and the alarms.
Left: The frequency of the island under the replay without a watermark, with what the battery sees, and with a watermark of 2 kW and a window of 30 s. Right: The response g to the watermark for two settings, with the threshold 0.5 and the alarms.

Check your understanding. Why can a test on the residual alone not detect a replay of steady operation?

Open lab Part C

Interactive lab, Part C. The island controller in 3D: The battery inverter and the control cabinet with the frequency meter, the box of the attacker and the battery controller. Three chargers and the screen of the frequency complete the room. Run the replay with different watermarks and windows. The results can be copied into the Colab notebook.

Open in Colab

Python code in the Colab notebook, Section 3. Open Section 3 of the Colab notebook and run it. The function island(watermark_kw, window_s) simulates the 100 s of the attack with the same random numbers as Part C. The code prints the alarm, the fate of the island and the jitter of the frequency for six settings and draws the frequency and the response g. Paste the results of Part C into MY_RUNS.

Discuss: The price of the watermark
  1. Who on the campus would object to a battery that adds a random power all the time, and with which argument?
  2. Could the attacker record long enough to learn the watermark? What would protect against that?

Defences in depth

No single defence stops every attack, so a cyber-physical system builds layers. The first layer keeps attackers out. The International Electrotechnical Commission (IEC) groups the devices of a control system into zones in its series IEC 62443. Traffic between zones passes only through defined conduits. Part 3-3 of the series lists the security requirements that each zone must meet [10]. The second layer makes forged data visible, the third detects what still passes, and the fourth lets the plant survive an attack.

Message authentication answers the forged command. The controller and the inverter share a secret key \(K\). Each frame carries a counter and a tag. The tag is the first 8 bytes of the hash-based message authentication code (HMAC) of the frame and the counter, with SHA-256 as the hash function [11]:

\[\text{tag} = \text{HMAC}_K\left(\text{frame} \,\|\, \text{counter}\right)_{1..8}, \qquad \text{accept when the tag is right and the counter} > \text{the last counter}\]

A forged value makes the tag wrong, and a replayed frame carries an old counter. A random tag of 64 bits is right with a chance of \(2^{-64}\), about \(5.4 \times 10^{-20}\). The frame of the setpoint grows from 8 to 20 bytes. On the bus of Week 8 at 19200 baud, a poll cycle of the meter, the inverter and the battery management system then takes 170.83 ms instead of 129.58 ms.

Protected meters answer the hidden injection. Kim and Poor showed that a small set of meters that the attacker cannot change suffices [12]. Such meters carry a tag or measure with their own protected link. A hidden attack must then leave every protected meter alone:

\[H_P \mathbf{c} = \mathbf{0} \ \text{has no solution } \mathbf{c} \neq \mathbf{0} \quad \Longleftrightarrow \quad \operatorname{rank} H_P = n\]

Here \(H_P\) holds the rows of the protected meters and \(n\) is the number of states. The campus estimates six feeders, so at least six meters must carry a tag. Of the 1716 sets of six meters, 256 leave no hidden attack, for example the six feeder meters. A tag on the main meter alone does not help: The attacker can raise B3 and lower B5 by the same amount.

A smaller goal needs fewer tags. With the B3 feeder meter tagged, every hidden shift of B3 must appear in the residual of that meter. The test then allows a shift of at most 3.07 kW, far below the 46.07 kW that the shedding needs. With the less accurate B3 building meter tagged instead, the bound is 13.33 kW.

DefenceWhat it stopsWhat it costs
Zones and conduits with firewallsAttackers from the office network and the internetDesign, rules and their upkeep
Tags and counters on the busForged and replayed commandsKeys in every device, 41.25 ms per poll cycle
Tagged meters with independent rows of HHidden injections into the state estimateAt least six meters with keys or protected links
Physical watermarkReplays of sensor dataA noisier frequency and more cycles of the battery
Local fallback and limits in the deviceThe worst effects of an attack that passesSome performance when the network fails

Check your understanding. How many protected meters does the campus need at least so that no hidden attack remains?

Open in Colab

Python code in the Colab notebook, Section 4. Open Section 4 of the Colab notebook and run it. The function secure_request adds a counter and a tag to a frame, and the class Inverter checks both. The code shows a genuine, a forged, a replayed and 2000 guessed frames and the poll cycle with and without tags. It then tests protected sets of meters with hidden_possible.

Left: The share of the sets of protected meters that leave no hidden attack, by the number of meters. Right: The poll cycle of the meter, the inverter and the battery management system with plain frames and with counter and tag.
Left: The share of the sets of protected meters that leave no hidden attack, by the number of meters. Right: The poll cycle of the meter, the inverter and the battery management system with plain frames and with counter and tag.
Discuss: Where to start
  1. With a budget for one defence this year, would you tag the bus of the battery or the meters of the control room? Argue with the numbers of this week.
  2. Which defence of the table also protects against honest mistakes, such as a wrongly wired meter?

Development templates of the week

The folder templates/ of the repository collects small working programs that carry out the methods of the course. Week 11 adds two of them, each with a description, its inputs and outputs and an example run.

TemplateWhat it does
fdi_attack_check.pyA weighted least-squares estimate with the chi-square test, hidden injections a = Hc and the rank test of protected meters; the example is the thirteen meters of the campus
authenticated_frames.pyModbus frames with a counter and an HMAC tag with SHA-256, a receiver that rejects damaged, forged and replayed frames, and the cost in bus time; the example is the battery inverter

The engineering side: Security over the life cycle

The devices of a cyber-physical system run for 15 to 30 years, far longer than office computers. A patch must be tested against the plant before it is installed, often in a planned outage. Security therefore cannot rely on updates alone. It starts with a list of every device and every connection, and it continues with daily practice [3].

PracticeWhy it matters on the campus
A complete list of devices, firmware versions and connectionsNobody can protect a Modbus gateway that nobody knows about
Separate accounts with the least rights that a task needsThe account of a technician should not change the setpoints of the battery
Logs of logins, changes and alarms, kept outside the control networkAfter an incident the logs show what happened, even if the attacker cleaned the controllers
Tested plans for an incident, with backups of every programThe campus can return to a known state within hours
Signed firmware and checked suppliersA forged update would bypass every other layer
Training of everyone who touches the systemMost attacks start with a phishing message, not with the bus
Discuss: People and machines
  1. Which practice of the table would have been the hardest to keep up on the campus, and why?
  2. Who should hold the keys of the bus of the battery, and what happens when that person leaves the university?

The campus microgrid, stage 11: Attacks and defences

Stage 11 runs the three attacks of the week against the campus and prices the defences. The forged command acts on the bus of the battery, the hidden injection on the control room, and the replay on the island.

QuestionResultMethod
Forged setpoint at 19:00Import 835.67 kW instead of 450.00 kW, 235.67 kW above the limitModbus frame with a correct CRC
One meter changed to shed B368.65 kW needed, J = 658.61: bad-data alarmChi-square test of Week 6
Hidden attack of +50 kWJ = 8.04, B3 estimated at 153.93 kW: B3 shedInjection along a column of H
Tagged meters against every hidden attackAt least 6; 256 of the 1716 sets of sixRank of the tagged rows of H
B3 feeder meter taggedAt most 3.07 kW of hidden shift of B3Variance of the residual (Week 6)
Replay without a watermarkThe island trips at 84.0 sIsland model of Weeks 2 and 5
Replay with a watermark of 2 kW and a window of 30 sAlarm at 72.7 s, jitter 6.81 mHz (5.53 mHz without)Response g to the watermark
Frames of the attacker on the authenticated busNone of 2002 acceptedHMAC with SHA-256 and a counter
Poll cycle at 19200 baud170.83 ms instead of 129.58 msTiming of Week 8

Each attack exploits trust that the earlier weeks took for granted, and each defence restores part of it at a price. Tags cost bus time and key management, protected meters cost hardware, and the watermark costs quality of the frequency. Week 12 builds a digital twin of the campus, a model that follows the measurements. It offers another check: A physical model that disagrees with the data is a reason to look closer.

The campus microgrid, stage 11. Left: The estimate of B3 without an attack, with one meter changed, with the hidden attack and with the hidden attack against six tagged meters. Right: The frequency of the island under the replay without and with the watermark of 2 kW. The values come from Section 5 of the Colab notebook.
The campus microgrid, stage 11. Left: The estimate of B3 without an attack, with one meter changed, with the hidden attack and with the hidden attack against six tagged meters. Right: The frequency of the island under the replay without and with the watermark of 2 kW. The values come from Section 5 of the Colab notebook.

Check your understanding. Why does a tag on the main meter alone not protect the estimate of B3?

Open lab Part D

Interactive lab, Part D. Stage 11 by hand: The test value of three readings and the estimate after a hidden attack. It ends with the response of the frequency to a watermark.

Open in Colab

Python code in the Colab notebook, Section 5. Open Section 5 of the Colab notebook and run it. The code collects the results of stage 11 in the dictionary STAGE11 and draws the estimate of B3 under the attacks and the island under the replay.

In the field: An unknown device on the network

An attack like the changed meter of this lecture needs a way into the network of the main switchboard. A managed switch keeps a table of the hardware addresses, the media access control (MAC) addresses, that it has seen on each port. An asset inventory lists the devices that belong there. Guides for the security of operational technology recommend such an inventory and the shutdown of unused ports [3].

A comparison of the table with the inventory shows a device that does not belong. Port security goes one step further: Each port accepts only the address of its device in the inventory, and a spare port accepts none. IEC 62443-3-3 asks a control system to identify and authenticate every device that connects to it [10]. A port bound to an address is a weak form of that, because an address can be copied, but it closes the easiest way in.

Open lab Part E

Interactive lab, Part E. The field task: The console of the managed switch and the asset inventory. Find the unknown device, cut it off and switch on port security.

Your application

Wherever a linear model links meters to quantities, an attacker who knows the model can hide false data in it. The Colab notebook holds an application switch with six systems. They are a water network, the roads into a city centre, a battery module, the zones of an office floor, a production line and a tram line.

Open in Colab

Python code in the Colab notebook, Section 6. Open Section 6 of the Colab notebook, set APP to one of the six names in the comment and run the cell. The function attack_report estimates the quantities of the system, builds the hidden attack on its target and searches for the smallest sets of meters that stop it.

Learning machines for attack detection

A hidden injection passes the chi-square test, but it may still look strange: The dormitory B3 rarely draws 154 kW on a mild spring evening. Machine learning can learn such patterns from many examples of normal and attacked readings. Ozay and colleagues compared several learning methods on test systems of the power grid. In their framework the methods detected attacks better than detectors that rely on state estimation [13].

A learned detector, however, can be attacked itself. Goodfellow and colleagues showed that small, carefully chosen changes of an input can flip the decision of a neural network [14]. An attacker who knows the detector can shape the injection so that it passes both the test and the network. Learned detectors therefore need their own defences, and the physics of the plant remains the anchor of the check.

A detector that is attacked itself

Suppose that the campus trains a network on a year of readings to flag unusual combinations. An attacker who obtains a copy of the network searches for a hidden injection that the network also accepts, for example by shifting load between buildings in small steps. The campus answers with tagged meters for the critical feeders and uses the network as one more layer, not as the only one.

Discuss: Learning against an adversary
  1. A detector learns from attacks of the past. Why is this harder against an attacker than against a fault?
  2. Which part of the campus would you never leave to a learned detector alone?

Review cards

Select a card to turn it over.

Confidentiality, integrity, availability
The three goals of information security; a cyber-physical system weighs integrity and availability highest [3].
Attack surface
All entry points through which an attacker can reach a system: Buses, brokers, meters, feeds and maintenance access.
Deception attack
Sends false readings or false commands [1].
Denial of service (DoS)
Blocks or delays the true readings or commands [1].
Attack space
The resources of an attacker: Model knowledge, disclosure and disruption [4].
False data injection (FDI)
Changes readings so that the state estimate moves [8].
Hidden injection
\(\mathbf{a} = H\mathbf{c}\): The estimate moves by \(\mathbf{c}\) and the residual stays the same, so the chi-square test sees nothing.
Critical meter
A meter that no combination of the other meters can replace; its residual is always 0.
Replay attack
Records readings of normal operation and plays them back while the attacker acts [9].
Physical watermark
A small secret random input whose response a replay cannot show [6].
Response g
The slope of the movement of the measurement against the watermark, divided by \(\beta\); about 1 in normal operation and 0 under a replay.
HMAC
The hash-based message authentication code: A tag that only holders of the secret key can compute [11].
Counter against replay
A number in every message that must exceed the last accepted one.
Protected meters
Meters that the attacker cannot change; no hidden attack remains when their rows of \(H\) reach full rank [12].
Zones and conduits
Groups of devices of equal trust and the defined paths between them [10].
Adversarial example
A small, crafted change of an input that flips the decision of a learned model [14].

References

[1] Cárdenas, A. A., Amin, S., & Sastry, S. (2008). Secure control: Towards survivable cyber-physical systems. In 2008 The 28th International Conference on Distributed Computing Systems Workshops (pp. 495-500). IEEE. https://doi.org/10.1109/ICDCS.Workshops.2008.40

[2] Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual. CreateSpace.

[3] Stouffer, K., Pease, M., Tang, C., Zimmerman, T., Pillitteri, V., Lightman, S., Hahn, A., Saravia, S., Sherule, A., & Thompson, M. (2023). Guide to Operational Technology (OT) Security (NIST Special Publication 800-82r3). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-82r3

[4] Teixeira, A., Shames, I., Sandberg, H., & Johansson, K. H. (2015). A secure control framework for resource-limited adversaries. Automatica, 51, 135-148. https://doi.org/10.1016/j.automatica.2014.10.067

[5] Langner, R. (2011). Stuxnet: Dissecting a cyberwarfare weapon. IEEE Security & Privacy, 9(3), 49-51. https://doi.org/10.1109/MSP.2011.67

[6] Mo, Y., Weerakkody, S., & Sinopoli, B. (2015). Physical authentication of control systems: Designing watermarked control inputs to detect counterfeit sensor outputs. IEEE Control Systems Magazine, 35(1), 93-109. https://doi.org/10.1109/MCS.2014.2364724

[7] Humayed, A., Lin, J., Li, F., & Luo, B. (2017). Cyber-physical systems security - A survey. IEEE Internet of Things Journal, 4(6), 1802-1831. https://doi.org/10.1109/JIOT.2017.2703172

[8] Liu, Y., Ning, P., & Reiter, M. K. (2009). False data injection attacks against state estimation in electric power grids. In Proceedings of the 16th ACM Conference on Computer and Communications Security (pp. 21-32). ACM. https://doi.org/10.1145/1653662.1653666

[9] Mo, Y., & Sinopoli, B. (2009). Secure control against replay attacks. In 2009 47th Annual Allerton Conference on Communication, Control, and Computing (Allerton) (pp. 911-918). IEEE. https://doi.org/10.1109/ALLERTON.2009.5394956

[10] International Electrotechnical Commission. (2013). Industrial communication networks - Network and system security - Part 3-3: System security requirements and security levels (IEC 62443-3-3:2013, Edition 1.0). IEC.

[11] Krawczyk, H., Bellare, M., & Canetti, R. (1997). HMAC: Keyed-Hashing for Message Authentication (RFC 2104). RFC Editor. https://doi.org/10.17487/RFC2104

[12] Kim, T. T., & Poor, H. V. (2011). Strategic protection against data injection attacks on power grids. IEEE Transactions on Smart Grid, 2(2), 326-333. https://doi.org/10.1109/TSG.2011.2119336

[13] Ozay, M., Esnaola, I., Yarman Vural, F. T., Kulkarni, S. R., & Poor, H. V. (2016). Machine learning methods for attack detection in the smart grid. IEEE Transactions on Neural Networks and Learning Systems, 27(8), 1773-1786. https://doi.org/10.1109/TNNLS.2015.2404803

[14] Goodfellow, I. J., Shlens, J., & Szegedy, C. (2015). Explaining and harnessing adversarial examples. In 3rd International Conference on Learning Representations (ICLR 2015). https://arxiv.org/abs/1412.6572