Skip to content

docs(runbooks): trim heimdall to a kiosk after its audit - #1708

Merged
Gerrrt merged 5 commits into
mainfrom
gerrrt/heimdall-kiosk-trim
Nov 24, 2026
Merged

Gerrrt merged 5 commits into
mainfrom
gerrrt/heimdall-kiosk-trim

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

What changed

docs/runbooks/build-heimdall.md now trims the office wall Pi to a kiosk. It adds Raspberry Pi's archive to unattended-upgrades and a nightly 04:30 reboot so upgrades actually run. It keeps the journal on the card (capped at 64 MB) and masks rpcbind, avahi, CUPS and Bluetooth. It purges the unused remote-desktop packages and removes the Imager's passwordless-sudo file and its seed files on the boot partition. It turns off sshd's X11 and TCP forwarding, runs Chromium under lwrespawn, and reads Wi-Fi without iw. docs/changelog.md records the audit and corrects the 2026-11-23 entry that said the IPMI purge was still to run.

Applied to heimdall on 2026-11-23, every step except removing 90-cloud-init-users, which needs the operator's password. A reboot at 21:26 confirmed them: Wi-Fi up without the seed files, the wall page under lwrespawn at 1080p, the journal keeping two boots, only 22 and 9100 listening, nothing failed, up 1.

Why

A read-only audit of heimdall on 2026-11-23 found:

  • Chromium was never upgraded unattended. Only Debian origins were allowed. Chromium, the kernel and the firmware come from archive.raspberrypi.com, and 10 such upgrades were pending, Chromium among them. ADR-0119 and §2 relied on this.
  • The always-logged-in kiosk user had root without a password.
  • The password hash and Wi-Fi passphrase were world-readable on the FAT boot partition.
  • rpcbind listened on 111 and avahi on 5353 on Hicks, with no host firewall.
  • Eight reboots left no cause, because the journal was kept in memory only.
  • The kiosk did not come back after a Chromium crash.

Judgement calls for review:

  • The nightly reboot at 04:30, rather than right after the ~06:00 upgrade run. The screen never goes dark while someone is looking, at the cost of up to a day's lag.
  • Mask, not purge, for nfs-common and cups, because the desktop's metapackages depend on them.
  • The Chromium extensions (h264ify, uBlock Origin Lite) are recorded but left as Raspberry Pi OS ships them.

Blast radius

heimdall only (Hicks, 10.0.50.15), and only once the runbook is re-run there. The worst case is the sudo step with a wrong password; the runbook holds a root shell open for exactly that. The nightly reboot darkens the wall for about a minute at 04:30. InstanceDown already excludes role="display", so nothing pages.

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

Verification

  • python3 scripts/check_docs.py: docs OK.

  • ./scripts/lint.sh: yamllint, shellcheck, ruff and actionlint pass. markdownlint, zizmor, packer, tofu and editorconfig-checker were skipped (no Docker daemon on the Mac). ansible-lint failed on a local uv/pip-args tool error unrelated to this change. CI runs them all.

  • Facts the steps rely on were read from the Pi, read-only:

    • apt-cache policy shows o=Raspberry Pi Foundation,n=trixie.
    • 40-rpi-volatile-storage.conf sets Storage=volatile.
    • /usr/bin/lwrespawn takes a command and its arguments.
    • Reverse dependencies: rpd-common needs nfs-common, the printer drivers need cups, and nothing needs realvnc-vnc-server, wayvnc or rpi-connect.
    • The reboot times came from node_boot_time_seconds on prometheus.
  • make validate was not run (it needs about 38 GB of images).

  • make validate passes

  • Deployed to the lab and confirmed working (applied and confirmed across a reboot, bar the sudo step)

  • Docs updated (docs/, service README, or docs/roadmap.md)

🤖 Generated with Claude Code

Gerrrt and others added 3 commits November 23, 2026 20:32
A read-only audit of heimdall found Chromium was never upgraded
unattended: Raspberry Pi's archive was not an allowed origin. It also
found the kiosk user had passwordless sudo, the Imager's seed files
were still on the boot partition, rpcbind and avahi listened, eight
reboots left no cause, and the kiosk had no respawn.

build-heimdall.md now adds the Raspberry Pi origin, a nightly 04:30
reboot, a persistent capped journal, masks the unused services,
removes the cloud-init sudoers file and seed files, turns off sshd
forwarding, runs Chromium under lwrespawn, and reads Wi-Fi without iw.
The changelog records the findings and corrects the entry that said
the purge was still to run. The Pi has not been re-run yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
markdownlint MD038 failed the Lint check on `/usr/bin/lwrespawn `.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt marked this pull request as ready for review November 24, 2026 04:43
Copilot AI balanced review requested due to automatic review settings November 24, 2026 04:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The runbook omits sudo journalctl --flush after restarting journald, so rebooting can discard current-boot logs still stored in /run.

1 open issue
What changed in this PR

Updates heimdall’s build runbook to address audit findings and harden the wall-display Pi as a kiosk. These are documented procedures only; the new steps have not yet been applied to the Pi.

Changes:

  • Adds Raspberry Pi package updates, nightly reboots, persistent logging, and Chromium crash recovery.
  • Removes unnecessary services and boot seed files, requires a sudo password, and disables SSH forwarding.
  • Records the audit and corrects the earlier changelog statement about the IPMI purge.
File Description
docs/​runbooks/​build-heimdall.md Adds kiosk hardening, update and recovery procedures, verification, and rollback guidance.
docs/​changelog.md Records the audit findings and corrects the prior purge status without rewriting history.

Review effort: Balanced

Comment thread docs/runbooks/build-heimdall.md Resolved
Restarting journald alone can leave the current boot's entries in /run,
and §3's reboot would then lose them. Review on #1708.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt enabled auto-merge (squash) November 24, 2026 04:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit 8cfb2bd into main Nov 24, 2026
9 of 10 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/heimdall-kiosk-trim branch November 24, 2026 05:11
Gerrrt added a commit that referenced this pull request Nov 24, 2026
…1712)

Completes the #1708 entry: the operator removed the cloud-init sudoers
file, and the 21:26 reboot came back with Wi-Fi, the respawned kiosk,
a kept journal and only 22 and 9100 listening.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants