Chapter 32 — Information security: reliability
Lesson map
Lesson 32 published. Map, example, EX094.
flowchart TD
N0["Learning outcomes"]
N1["32.1 Restores as evidence"]
N2["32.2 The restore lab"]
N3["Lab — Verifying synthetic backup restores against SH"]
N4["32.3 Investigating failures"]
N5["32.4 Recovery objectives"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5
N5 --> EX["Worked example"]
EX --> Q["Exercise EX094"]
Logical drawing
flowchart LR
N0["Learning outcomes"]
N1["32.1 Restores as evidence"]
N2["32.2 The restore lab"]
N3["Lab — Verifying synthetic backup restores against SH"]
N4["32.3 Investigating failures"]
N5["32.4 Recovery objectives"]
N0 --> N1 --> N2 --> N3 --> N4 --> N5 --> Q["EX094"]
[Learning outcomes]
|
v
[32.1 Restores as evidence]
|
v
[32.2 The restore lab]
|
v
[Lab — Verifying synthetic backup restores against SH]
|
v
[32.3 Investigating failures]
|
v
[32.4 Recovery objectives]
|
v
[Worked example] --> [Exercise EX094]
Learning outcomes
You will (1) verify backup integrity with checksums; (2) measure restore success; (3) set recovery objectives.
32.1 Restores as evidence
Saltmarsh believes its backups work because backup jobs report success. Lindiwe explains that a successful backup job shows data were copied, not that they can be restored intact. She proposes regular restore tests that compare restored files against checksums recorded at backup time. If a file is missing or its checksum differs, the restore has failed for that file. Prof. Hale notes that only restore testing gives evidence for the insurer's requirement of tested backups. The security lead schedules the first restore test for the following month.
32.2 The restore lab
The lab creates 500 synthetic files, records a SHA-256 checksum for each using Python's hashlib module and simulates a restore. Five files are missing from the restore and three have checksum mismatches caused by a single flipped bit. That leaves 492 files verified, 98.4 percent. Lindiwe notes that the backup job would have reported success, and that without checksums the three corrupted files would look normal until someone opened them. She shows the security lead the list of missing and corrupted files, and the team agrees to run the same verification monthly on a rotating sample of folders from every server.
Lab — Verifying synthetic backup restores against SHA-256 checksums
"""Verify synthetic backup restores against SHA-256 checksums (stdlib only)."""
import hashlib, random
random.seed(12)
files = {f"file{i}": random.randbytes(256) for i in range(500)}
manifest = {k: hashlib.sha256(v).hexdigest() for k, v in files.items()}
restored = {}
for k, v in files.items():
r = random.random()
if r < 0.006: continue # missing from restore
if r < 0.014: v = v[:-1] + bytes([v[-1] ^ 1]) # one bit flipped
restored[k] = v
missing = [k for k in files if k not in restored]
bad = [k for k in restored if hashlib.sha256(restored[k]).hexdigest() != manifest[k]]
ok = len(files) - len(missing) - len(bad)
print(f"files {len(files)}; missing {len(missing)}; checksum mismatch {len(bad)}; verified {ok} ({ok/len(files):.1%})")
Run with python3 lab_restore.py. Verified output:
files 500; missing 5; checksum mismatch 3; verified 492 (98.4%)
32.3 Investigating failures
Lindiwe traces the five missing files to a folder added after the backup selection was configured, so it was never included. The three corrupted files come from a failing disk on the backup server. Both causes are fixable: the selection is changed to include all folders under a parent, and the disk is replaced. She learns that restore tests find configuration and hardware problems that monitoring of backup jobs alone cannot reveal. The next monthly restore test, run after both fixes, verifies every file in its sample.
32.4 Recovery objectives
Lindiwe helps Saltmarsh set recovery objectives: how much data the business can afford to lose and how quickly each system must return. Dispatch can lose at most an hour of data and must return within four hours; payroll can lose a day but must be back before pay runs. These objectives decide backup frequency and restore methods. Prof. Hale notes that objectives agreed with business owners turn backups from a technical habit into a commitment. The objectives are approved by the operations director and the finance director.
Worked example
Lindiwe verifies a synthetic restore of 500 files with SHA-256 checksums, finds 5 missing and 3 corrupted (492 verified, 98.4 percent), traces causes and sets recovery objectives.
Synthetic case. Files are synthetic; outputs come from lab_restore.py.
Errors and limits
A successful backup job does not prove data can be restored intact.
Exercises
- EX094 — Restore figures. How many files were verified? Rubric: 3 = 492, 98.4 percent;; 2 = partly correct;; 1 = wrong;; 0 = none.
- EX095 — Missing cause. Why were five files missing? Rubric: 3 = a folder added after selection was configured;; 2 = partly correct;; 1 = vague;; 0 = none.
- EX096 — Dispatch objectives. What are dispatch's recovery objectives? Rubric: 3 = lose at most an hour, return within four hours;; 2 = partly correct;; 1 = vague;; 0 = none.
Continue studying — lesson 32 (chapter 32 of 50)
← Chapter 31 · Course chapter index · Chapter 33 →
Continue to the next authored lesson.