interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / TRUST-1-GATE2-EXPERIMENTS.md

136 lines · 9497 bytes Raw Blame History Rendered
1# TRUST-1 Gate 2: one-change-at-a-time experiments
2
3Written for Drake, who runs these at the keyboard of the Spark (Machine 1).
4Companion to `docs/TRUST-1-OPERATOR-STEPS.md` (Steps 1, 2, 7) and Gate 2 in
5`docs/TRUST-1-IMPLEMENTATION-PLAN.md`. Baseline evidence is in
6`evidence/trust1_gate2_baseline_2026-10-03/`.
7
8## Where things stand
9
10Four boots are captured (see the README in that evidence folder). Cold boots
11(powered fully off, then the power button) gave identical measurements. One warm
12restart (`sudo reboot`) gave a different PCR1 and PCR10. A "PCR" is one of the
13TPM chip's numbered logbook slots that record what started up. I now change
14exactly ONE thing at a time and see which slots move. That tells me which slots
15mean something about security and which just wobble.
16
17## What Gate 2 requires (from the plan)
18
19Acceptance as the plan defines it: "Baseline repeated cold boots produce stable
20measurements or variation explained. Each experiment changes exactly one
21variable ... with before, mutation, PCR/event result, after, rollback,
22post-rollback measurements recorded. Final report explains why each candidate
23PCR contributes to security; no PCR selected by convention."
24Stop condition in the plan: any unexplained PCR change goes to the
25UnexpectedState protocol (Gate 9) and no policy is chosen.
26
27**Gate 2 PASS criterion: the plan gives the acceptance test above but no single
28numeric line, so for the pass/fail count: DOCS SILENT.** Proposal (not yet
29accepted): Gate 2 PASSES when (1) the baseline shows cold boots identical
30(already met: boot2 vs boot3 changed=0), (2) every experiment below has a
31before, after and post-rollback capture, with post-rollback equal to before on
32every PCR (otherwise the receipt says `STOP_UNEXPECTED_STATE`), (3) every PCR
33that moved in any experiment has a written reason, and (4) the final report
34names which PCRs the policy may use and why.
35
36## Rules for every experiment
37
38- Run from the repo folder: `cd ~/workspace/aienos-recovery-gate`
39- Do ONE experiment per sitting, in the order below. Never combine two.
40- Always cold boot (`sudo poweroff`, wait 30 seconds, power button) unless the
41 experiment says otherwise, because cold boots are the stable reference.
42- Do not update firmware, change Secure Boot or touch the TPM during this
43 campaign. If anything unexpected moves, stop and tell the orchestrator.
44- Each experiment has a "before" snapshot, the one change, an "after"
45 snapshot, an undo, and a "post-rollback" snapshot that must match "before".
46
47The capture and compare commands are the same each time. Replace `EXPn` with the
48experiment name (for example `exp1`):
49
50```bash
51# before the change
52bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/EXPn-before EXPn-before
53# ... make the one change, restart as the experiment says ...
54bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/EXPn-after EXPn-after
55bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/EXPn-before ~/trust1-evidence/EXPn-after
56# ... undo, cold boot ...
57bash scripts/tpm_measurement_campaign.sh capture ~/trust1-evidence/EXPn-rollback EXPn-rollback
58bash scripts/tpm_measurement_campaign.sh compare ~/trust1-evidence/EXPn-before ~/trust1-evidence/EXPn-rollback
59```
60
61*What it does:* reads the startup measurements and saves them in a folder.
62*Changes:* nothing on the machine. *Success:* each `compare` ends with
63`compared=... changed=...`; for the rollback compare I want `changed=0` apart
64from clearly named non-PCR items (event log bytes, timer state).
65Optionally the orchestrator builds the signed receipt with the tool's `receipt`
66subcommand (`--variable EXPn --before ... --after ... --post-rollback ...`, and
67`--prev` pointing at the previous experiment's receipt); you do not need to.
68
69Which PCR means what is UNVERIFIED in this document (I have not cited the TCG
70specification here), so "expected effect" lines are guesses to be checked
71against the results, not facts. Confidence is stated on each.
72
73---
74
75## Experiment 1. A second warm restart (is the warm value stable?)
76
77Question: the warm restart changed PCR1; is the new value always the same?
78This resolves the one [UNKNOWN] from the baseline.
79
80- **The one change:** none to the machine. Use `sudo reboot` twice, one capture after each.
81- **Before:** use `boot2-after` or `boot3-after` (cold) as the reference, no new capture needed.
82- **Steps:** `sudo reboot`; capture into `~/trust1-evidence/exp1-warmA`; `sudo reboot` again; capture into `~/trust1-evidence/exp1-warmB`; compare `exp1-warmA` with `exp1-warmB`, and each with `boot1-after`.
83- **Expected effect (UNVERIFIED, confidence medium):** warmA, warmB and `boot1-after` agree on PCR1; PCR10 may differ.
84- **Success:** you have a line for each compare. Either result is evidence.
85- **Undo:** nothing to undo. Finish with a cold boot (`sudo poweroff`, power button) and capture `exp1-cold`; compare to `boot3-after`, expect the cold values back.
86
87## Experiment 2. Turn the firmware-update checker back on
88
89Question: does Ubuntu's background firmware-update check change any measurement?
90
91- **The one change:** `sudo systemctl enable --now fwupd-refresh.timer` (the undo of Step 2).
92- **Changes:** one Ubuntu setting; no firmware is touched. You should see a line saying a link was created.
93- **Steps:** before capture (system as it is now, timer off), run the command, cold boot, after capture, compare.
94- **Expected effect (UNVERIFIED, confidence medium):** no PCR change; only the `fwupd_refresh_timer` item flips from disabled to enabled and the event log bytes may differ. This matches the boot0 vs boot3 result, where that timer was the only non-event-log difference and all PCRs were identical [OBSERVED].
95- **Risk:** if a firmware update is actually applied during this window, STOP and report: the plan forbids it during the campaign.
96- **Undo:** `sudo systemctl disable --now fwupd-refresh.timer`, cold boot, rollback capture.
97
98## Experiment 3. Cold boot with a USB stick plugged in
99
100Question: does merely having a USB storage device present change a measurement?
101(No spare sticks existed on 2026-10-03, so this experiment waits until one is available. Use any stick with nothing needed on it, never the recovery stick.)
102
103- **The one change:** plug in one blank or unimportant USB stick before powering on; do not select it to boot from.
104- **Steps:** before capture; `sudo poweroff`; plug in the stick; wait 30 seconds; power button; let Ubuntu start normally; after capture; compare.
105- **Expected effect (UNVERIFIED, confidence low):** probably none on PCR 0/2/3/4/7; it might change PCR1 or the event log if the firmware records device or boot-entry data.
106- **Undo:** `sudo poweroff`, remove the stick, wait 30 seconds, power button, rollback capture.
107
108## Experiment 4. Visit the firmware setup screen and leave without changing anything
109
110Question: does just entering the setup menu (and saving nothing) change a measurement?
111
112- **The one change:** enter the firmware setup screen during startup and exit with "discard changes" / "exit without saving".
113- **Steps:** before capture; `sudo poweroff`; power button; press the setup key shown on the startup screen (typically Delete or F2: UNVERIFIED for this machine, read what the screen says); look, change NOTHING, choose exit without saving; Ubuntu starts; after capture; compare.
114- **Safety:** do not change any setting, and do not touch Secure Boot or key menus. If you are unsure you changed something, tell the orchestrator before the next boot.
115- **Expected effect (UNVERIFIED, confidence low):** no PCR change; some firmware measure the configuration (PCR1) on a setup visit, so PCR1 is the one to watch.
116- **Undo:** nothing was changed; do a cold boot and a rollback capture to prove it.
117
118## Experiment 5. Cold boot with the recovery stick first in the boot order
119
120Question: does changing boot order, without actually booting from the stick, change measurements? (This also exercises Gate 1's stick.)
121
122- **The one change:** put the recovery stick (AIENOSRECOV) first in the boot menu; the plan lists "boot order" and "recovery boot" as separate Q15 variables, so this is only boot order, with the stick's boot entry unable to succeed or being skipped if it fails (UNVERIFIED how this firmware behaves, confidence low).
123- **Steps:** needs an approved stick and an approved way to change boot order. The orchestrator will give exact written steps for the current boot-order tool before you do this. Do not improvise here: boot-order changes touch firmware variables.
124- **Expected effect (UNVERIFIED, confidence medium):** `BootOrder` item changes in capture; PCR1 may change (boot variables are measured; compare the `EV_EFI_VARIABLE_BOOT` digests).
125- **Undo:** restore the original order (the boot-order line in `boot0-before/boot_entries.txt` is the reference), cold boot, rollback capture must match `exp5-before`.
126- **Status:** blocked until a stick exists and the orchestrator posts the exact steps.
127
128## Order and stop rule
129
130Run 1, 2, 4 first (no hardware needed), then 3 and 5 when sticks exist. After
131each, send the compare lines to the orchestrator. If any rollback compare shows
132a PCR that does not return to its "before" value, STOP: that is the plan's
133UnexpectedState case, no PCR is chosen, and the orchestrator writes it up.
134The Q15 list in the plan has more variables (kernel, init image, loader
135and so on); those are not in this first set because they change software I
136build, and need their own written steps.