Check 1.0.13-beta.1's hardening in the beta-check script #151

Merged
aluminum-ice merged 1 commit from beta-check-1.0.13b1 into main 2026-11-01 23:59:53 +00:00
Owner

What this PR does

Updates tools/beta-check/beta-check-device.sh for the 1.0.13-beta.1 checklist (#150). Its new sections 2–7 cover this beta, and 1.0.12's checks follow as regressions, renumbered 8–14 to match the issue.

  • 2. Privileged helpers (#145):
    • 2.1: updates' beta/timeout/backup_timeout_seconds and remote-train's agent_dir are declared root-only.
    • 2.2: each is refused through the settings channel. This runs in the throwaway-config harness; the real file is checksummed.
    • 2.3: the settings pages show them read-only, with no form field.
    • 2.4: any trigger file present is a regular, single-link file owned by the device user. Its metadata is read as that user.
    • 2.5: /run/kestrel-auth is root 0700, and fails.json is 0600.
  • 3. Dashboard (#146):
    • 3.1: the daemon's unit and its running process have PrivateTmp and 4096 open files.
    • 3.2: a 70 KB POST to the loopback sign-in form gets 413. It sends no credentials.
    • 3.3: /guide/all renders with its section headings.
    • 3.4, run last: wrong Basic credentials over loopback until a 429 with Retry-After. The verified login still gets in, and the journal has a failure line. Only the count is taken.
  • 4. Updates (#148): the installed engine's redirect policy and the CLI's no-redirect token clone, checked by markers.
  • 5. Census (#141, #147):
    • 5.1: the Census page's Status lines: tether, reach, push and read, plus how many dated times.
    • 5.2: the installed per-slot and per-day bounds, and the reply matcher.
    • 5.3: no day in seen.json is over 12,544 entries. Counts only.
  • 6. Plugin pages (#142–#144):
    • 6.1: every HTML page a loaded plugin's GET row button opens carries the links back.
    • Not opened: downloads, which serves capture files, and wpa-sec, which shows passphrases.
  • By hand: 1.6, 2.6, 2.7, 3.5–3.7, 4.3, 5.4, 6.2 and 7.1 are MANUAL, and the by-hand list at the end of the report is rewritten for them.

Checklist

  • Lint passes — make lint (ansible --syntax-check, yamllint, shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.
  • Tests pass — make test (the kestrel_pi pytest suite and the real-data check's tests). The Test workflow runs this on the PR.
  • Nothing real: no secrets, no personal information, no real data. This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, .env files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.
  • Consent gates intact. Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced.
  • Docs updated in the same PR, if this changes something an operator sees or configures: the README package table, the relevant page under docs/, and the on-device operator guide (GUIDE_MD in kestrel_pi/userguide.py) where it applies.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — changes only files the in-place update engine carries: the kestrel_pi package, plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine's LIB_SCRIPTS, or the CLI.
  • Reflash-class — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / config.txt / cmdline, kernel modules, the base image or partition size, builder/config.json, builder/config.yml, the Makefile, the Release workflow (.forgejo/workflows/main.yml), a shipped config default (config.toml / default.conf), or a brand-new lib script.

(The scripts aren't shipped in the image, so this doesn't affect any release.)

Notes for review

  • The README's rules are kept:
    • Read-only: it never touches the management link or starts or stops a service. Config writes happen only in the throwaway harness. Files owned by the device user are read as that user. Nothing reads capture content.
    • Only loopback: the only network use is the loopback dashboard.
    • What 3.4 leaves behind: a handful of failed sign-ins from 127.0.0.1. For a few minutes afterwards the dashboard may ask a browser on the device itself to wait, and the root helper paces new password checks for up to its usual few seconds. The checklist says so.
  • Checked off the device:
    • Harness, real copy: run against staged copies of plugins-ctl, config-set, the plugins and config.toml from this branch. 2.1, 2.2, 9.2, 9.3, 13.5–13.9 and 13.22 pass.
    • Harness, weakened copy: a plugins-ctl that accepts root-only settings and skips the network acknowledgment fails 2.2 (all four accepted) and 9.3.
    • Dashboard markers: checked against the real rendering code (_plugin_back_links with and without a token, _option_field for root-only bool and str options, and the Census Status lines after escaping). The embedded dashboard Python compiles.
    • 5.3's counter: run on an invented seen.json and on a missing one.
    • Redactor: given an invented report with the new checks' lines plus a placeholder MAC, addresses, a fake token, an account name, a capture file name with a space and coordinates; everything is masked.
  • Renumbering: every changed id was reviewed; no version, timing or other number was touched.
  • First real test: the first run on the device is these checks' first real test.

🤖 Generated with Claude Code

## What this PR does Updates `tools/beta-check/beta-check-device.sh` for the 1.0.13-beta.1 checklist (#150). Its new sections 2–7 cover this beta, and 1.0.12's checks follow as regressions, renumbered 8–14 to match the issue. - **2. Privileged helpers (#145):** - **2.1:** `updates`' `beta`/`timeout`/`backup_timeout_seconds` and `remote-train`'s `agent_dir` are declared root-only. - **2.2:** each is refused through the settings channel. This runs in the throwaway-config harness; the real file is checksummed. - **2.3:** the settings pages show them read-only, with no form field. - **2.4:** any trigger file present is a regular, single-link file owned by the device user. Its metadata is read as that user. - **2.5:** `/run/kestrel-auth` is root 0700, and `fails.json` is 0600. - **3. Dashboard (#146):** - **3.1:** the daemon's unit and its running process have `PrivateTmp` and 4096 open files. - **3.2:** a 70 KB POST to the loopback sign-in form gets 413. It sends no credentials. - **3.3:** `/guide/all` renders with its section headings. - **3.4, run last:** wrong Basic credentials over loopback until a 429 with `Retry-After`. The verified login still gets in, and the journal has a failure line. Only the count is taken. - **4. Updates (#148):** the installed engine's redirect policy and the CLI's no-redirect token clone, checked by markers. - **5. Census (#141, #147):** - **5.1:** the Census page's Status lines: tether, reach, push and read, plus how many dated times. - **5.2:** the installed per-slot and per-day bounds, and the reply matcher. - **5.3:** no day in `seen.json` is over 12,544 entries. Counts only. - **6. Plugin pages (#142–#144):** - **6.1:** every HTML page a loaded plugin's GET row button opens carries the links back. - **Not opened:** `downloads`, which serves capture files, and `wpa-sec`, which shows passphrases. - **By hand:** 1.6, 2.6, 2.7, 3.5–3.7, 4.3, 5.4, 6.2 and 7.1 are `MANUAL`, and the by-hand list at the end of the report is rewritten for them. ## Checklist - [x] **Lint passes** — `make lint` (ansible `--syntax-check`, `yamllint`, `shellcheck --severity=error`, and the real-data check). The **Lint** workflow runs this on the PR. - [x] **Tests pass** — `make test` (the `kestrel_pi` pytest suite and the real-data check's tests). The **Test** workflow runs this on the PR. - [x] **Nothing real: no secrets, no personal information, no real data.** This is a public repository. The diff contains no real account passwords or hashes, Wi-Fi passphrases, private keys, API tokens, `.env` files, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you. - [x] **Consent gates intact.** Capture and network plugins still ship disabled, enabling them still takes the authorized-use acknowledgment (never pre-ticked or given by code), and the capture whitelist is still enforced. - [x] **Docs updated in the same PR**, if this changes something an operator sees or configures: the README package table, the relevant page under `docs/`, and the on-device operator guide (`GUIDE_MD` in `kestrel_pi/userguide.py`) where it applies. - [x] Commit messages are short and imperative. ## Release impact - [x] **App-layer-safe** — changes only files the in-place update engine carries: the `kestrel_pi` package, `plugins/*.py`, systemd units, the journald drop-in, a lib script already in the engine's `LIB_SCRIPTS`, or the CLI. - [ ] **Reflash-class** — touches a build input the engine does not carry onto a running device: apt or pip packages, boot options / `config.txt` / `cmdline`, kernel modules, the base image or partition size, `builder/config.json`, `builder/config.yml`, the `Makefile`, the Release workflow (`.forgejo/workflows/main.yml`), a shipped config default (`config.toml` / `default.conf`), or a brand-new lib script. (The scripts aren't shipped in the image, so this doesn't affect any release.) ## Notes for review - **The README's rules are kept:** - **Read-only:** it never touches the management link or starts or stops a service. Config writes happen only in the throwaway harness. Files owned by the device user are read as that user. Nothing reads capture content. - **Only loopback:** the only network use is the loopback dashboard. - **What 3.4 leaves behind:** a handful of failed sign-ins from 127.0.0.1. For a few minutes afterwards the dashboard may ask a browser on the device itself to wait, and the root helper paces new password checks for up to its usual few seconds. The checklist says so. - **Checked off the device:** - **Harness, real copy:** run against staged copies of `plugins-ctl`, `config-set`, the plugins and `config.toml` from this branch. 2.1, 2.2, 9.2, 9.3, 13.5–13.9 and 13.22 pass. - **Harness, weakened copy:** a `plugins-ctl` that accepts root-only settings and skips the network acknowledgment fails 2.2 (all four accepted) and 9.3. - **Dashboard markers:** checked against the real rendering code (`_plugin_back_links` with and without a token, `_option_field` for root-only bool and str options, and the Census Status lines after escaping). The embedded dashboard Python compiles. - **5.3's counter:** run on an invented `seen.json` and on a missing one. - **Redactor:** given an invented report with the new checks' lines plus a placeholder MAC, addresses, a fake token, an account name, a capture file name with a space and coordinates; everything is masked. - **Renumbering:** every changed id was reviewed; no version, timing or other number was touched. - **First real test:** the first run on the device is these checks' first real test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Check 1.0.13-beta.1's hardening in the beta-check script
All checks were successful
Test / test (pull_request) Successful in 32s
Lint / lint (pull_request) Successful in 33s
Lint / lint (push) Successful in 34s
Test / test (push) Successful in 36s
2a47877705
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch beta-check-1.0.13b1 2026-11-01 23:59:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!151
No description provided.