◇ OpenCyber Academy
Technical · Chapter 7 · English

Chapter 7 — Updates on the shop floor

Open, free learning for anyone who wants to protect people and technology. No account is required to read this text or its worked answers.

Chapter 7 — Updates on the shop floor

Lesson map

Lesson 07 published. Map, example, EX025.

flowchart TD
  N0["Learning outcomes"]
  N1["7.1 Why updates matter"]
  N2["7.2 The update lab"]
  N3["Lab — Devices not updated for over thirty days, by d"]
  N4["7.3 Finding causes"]
  N5["7.4 Fixing"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5
  N5 --> EX["Worked example"]
  EX --> Q["Exercise EX025"]

Logical drawing

flowchart LR
  N0["Learning outcomes"]
  N1["7.1 Why updates matter"]
  N2["7.2 The update lab"]
  N3["Lab — Devices not updated for over thirty days, by d"]
  N4["7.3 Finding causes"]
  N5["7.4 Fixing"]
  N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> Q["EX025"]
[Learning outcomes]
    |
    v
[7.1 Why updates matter]
    |
    v
[7.2 The update lab]
    |
    v
[Lab — Devices not updated for over thirty days, by d]
    |
    v
[7.3 Finding causes]
    |
    v
[7.4 Fixing]
    |
    v
[Worked example] --> [Exercise EX025]

Learning outcomes

You will (1) explain why updates matter; (2) find devices that have missed updates; (3) help fix update problems.

7.1 Why updates matter

Software makers release updates to fix security weaknesses. Criminals study these fixes and target devices that have not installed them. Chloe learns that keeping devices updated is one of the simplest and most effective protections. At Westfield, tills are updated by the till supplier, laptops by automatic updates and tablets by their owners when prompted. Mr. Doyle suspects the tablets lag behind, because staff often dismiss update messages while doing stock checks. Mr. Doyle asks Chloe to check the update dates for every device.

7.2 The update lab

The lab reads synthetic data for Westfield's 64 devices and counts those not updated for more than thirty days. None of the 22 tills are late, 2 of the 18 laptops are late, 11.1 percent, and 4 of the 24 tablets are late, 16.7 percent. In total, 6 of 64 devices need attention. Chloe notes that Mr. Doyle's suspicion is supported: tablets have the highest share of late updates, though some laptops lag too. She shows Mr. Doyle the results in a short table with each late device listed by centre, so he can plan which centres to visit first. He agrees the tablets need attention.

Lab — Devices not updated for over thirty days, by device type

"""Find synthetic devices with no update for more than 30 days, by device type (stdlib only)."""
import random
from collections import Counter
random.seed(18)
devices = []
for kind, n, mean in [("till", 22, 9), ("laptop", 18, 14), ("tablet", 24, 26)]:
    for i in range(n):
        devices.append((kind, int(random.expovariate(1 / mean))))
total = Counter(k for k, _ in devices)
late = Counter(k for k, d in devices if d > 30)
for k in total:
    print(f"{k}: {late[k]} of {total[k]} not updated for over 30 days ({late[k]/total[k]:.1%})")
print(f"all devices: {sum(late.values())} of {len(devices)}")

Run with python3 lab_updates.py. Verified output:

till: 0 of 22 not updated for over 30 days (0.0%)
laptop: 2 of 18 not updated for over 30 days (11.1%)
tablet: 4 of 24 not updated for over 30 days (16.7%)
all devices: 6 of 64

7.3 Finding causes

Chloe visits two centres and checks the late tablets. Two have been kept in a drawer for weeks as spares, so they never connected to install updates. One has too little free storage for the update. One belongs to a manager who keeps postponing restarts. The two late laptops are used only occasionally. She learns that different causes need different fixes, and that finding the cause is quicker than guessing. She records each cause next to the device in her notebook, together with the date she checked it and the person she spoke to.

7.4 Fixing

Chloe charges and updates the spare tablets, then sets a monthly reminder for centre managers to switch on spares. She frees storage on the full tablet by removing old photos after checking with the user. Mr. Doyle sets the tablets to install updates automatically overnight while charging. The occasional laptops are scheduled for updates at the start of each month. She reruns the check a week later and finds all six devices up to date. Mr. Doyle thanks her for checking the fix worked.

Worked example

Chloe finds 6 of 64 synthetic devices not updated for over thirty days (tablets 16.7 percent, laptops 11.1 percent, tills none), finds the causes and fixes each.

Synthetic case. Devices are synthetic; outputs come from lab_updates.py.

Errors and limits

Spare devices kept switched off miss updates without anyone noticing.

Exercises

Continue studying — lesson 07 (chapter 07 of 18)

← Chapter 06 · Course chapter index · Chapter 08 →

Continue to the next authored lesson.