Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ docstring gives: it is a record, not a claim about now.

## 2026-11-25

- **`build-heimdall.md` closes what a second audit of `heimdall` could
still raise.** A full re-check on 2026-11-24 at 21:25 found every
finding of the first audit still fixed, and five hardening gaps nobody
had raised. None is reachable from the network today. §2 now:
- **Adds a host firewall.** `nftables` was installed with an empty
ruleset, so only the absence of other listeners kept the Pi at 22 and
9100. The ruleset drops everything but SSH, the scrape from
`10.0.99.20` alone, ICMP and DHCP replies. It is loaded live first, and
enabled at boot only after a new SSH login and the scrape both work.
- **Ends the `tty1` shell.** The Imager's desktop autologin also logged
the user into a text shell on `tty1`. Since 2026-11-23 sudo asks for a
password, so a keyboard gave the user and not root, but the kiosk only
needs lightdm's autologin on `vt7`.
- **Masks the serial console** on `ttyAMA10`, the debug UART, which
nothing uses.
- **Turns the radio off** with `dtoverlay=disable-bt`. Masking
`bluetooth.service` had left `hci0` up.
- **Purges Firefox and VLC.** On 2026-11-24, 16 of the Pi's 18 pending
upgrades were VLC's. About 40 packages go with them.

`security.md`'s paragraph on the Hicks pass now names the firewall. The
steps need the operator's password at the Pi, so they are written here
and not yet applied.

- **The operator's Windows PC trusts both roots.** Every lab site warned
again after its warning had been accepted, because the PC trusted neither
root. A click-through covers one leaf, and Caddy renews the tier's
Expand Down
90 changes: 88 additions & 2 deletions docs/runbooks/build-heimdall.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ After §3's reboot, `journalctl --list-boots` lists more than one boot.

### Only 22 and 9100 listen

The desktop brings services a kiosk does not use, and the Pi has no host
firewall, so anything on Hicks reaches what they publish. rpcbind, from
The desktop brings services a kiosk does not use, and until the firewall
below, anything on Hicks reached what they publish. rpcbind, from
`nfs-common`, listens on 111, and avahi on 5353. Bluetooth is on and
pairable, CUPS listens locally, and three remote-desktop packages are
installed. The desktop's metapackages depend on `nfs-common` and `cups`, so
Expand All @@ -235,6 +235,85 @@ sudo apt autoremove --purge -y # the libraries they leave behind
sudo ss -tulnH | awk '{print $1, $5}' | sort -u # tcp 22 and 9100, nothing else
```

### No radio and no unused desktop apps

Masking `bluetooth.service` leaves the radio itself on. The overlay turns it
off at boot. Firefox and VLC come with the desktop, and the kiosk uses
neither. They are most of the Pi's updates: on 2026-11-24, 16 of its 18
pending upgrades were VLC's. The desktop's `rpd-applications` only
recommends them, so purging them removes nothing else the Pi uses.
`--autoremove` takes their libraries with them, about 40 packages:

```bash
sudo cp /boot/firmware/config.txt /boot/firmware/config.txt.bak
printf '\ndtoverlay=disable-bt\n' | sudo tee -a /boot/firmware/config.txt # last section is [all]
sudo apt purge -y --autoremove firefox vlc
```

After §3's reboot, `ls /sys/class/bluetooth` prints nothing.

### Nothing at the console but a login

The Imager's desktop autologin also logs the user into a text shell on
`tty1`. The kiosk only needs the desktop's autologin, which is lightdm's on
`vt7`. With the shell, a keyboard at the Pi and Ctrl+Alt+F1 is a logged-in
shell. Without it, `tty1` asks for the password. The serial console on
`ttyAMA10`, the Pi 5's debug UART, asks for it already. Nothing uses it, so
mask that too:

```bash
sudo rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
sudo systemctl daemon-reload
sudo systemctl restart getty@tty1.service # ends the tty1 shell, not the desktop
sudo systemctl mask --now serial-getty@ttyAMA10.service
loginctl list-sessions --no-legend # no session on tty1; lightdm's is still there
```

### A firewall that admits only those two

Only 22 and 9100 listen, but nothing holds it there: a service that starts
listening later is open to all of Hicks. `nftables` is installed and empty.
This ruleset admits SSH, the scrape from `prometheus` alone, and what the
Pi's own traffic needs to come back:

```bash
sudo tee /etc/nftables.conf >/dev/null <<'NFT'
#!/usr/sbin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority filter; policy drop;
iif lo accept
ct state established,related accept
ct state invalid drop
meta l4proto { icmp, ipv6-icmp } accept
udp sport 67 udp dport 68 accept # DHCPv4 replies
udp sport 547 udp dport 546 accept # DHCPv6 replies
tcp dport 22 accept
ip saddr 10.0.99.20 tcp dport 9100 accept
}
chain forward {
type filter hook forward priority filter; policy drop;
}
chain output {
type filter hook output priority filter;
}
}
NFT
sudo nft -c -f /etc/nftables.conf # parses, changes nothing
sudo nft -f /etc/nftables.conf # live, but not yet at boot
```

Keep this session open, and from the Mac open a new one with
`ssh -o ControlPath=none <user>@10.0.50.15`. From `prometheus`,
`curl -s 10.0.50.15:9100/metrics | grep -c ^node_` is more than 0. If either
fails, power-cycle the Pi: the ruleset is not loaded at boot yet, so it comes
back open. Once both work:

```bash
sudo systemctl enable nftables.service
```

## 3. The reservation

On `morpheus`, under Services → DHCP Server → Hicks, add a static mapping:
Expand Down Expand Up @@ -433,5 +512,12 @@ the roadmap's *Everything still to buy* and an ADR of its own.
- **The masked services:** `sudo systemctl unmask` the units §2 masked, then
`enable --now` them. The purged remote-desktop packages are reinstalled with
`apt`.
- **The firewall:** `sudo systemctl disable --now nftables.service`, then
`sudo nft flush ruleset`.
- **The console:** `sudo systemctl unmask --now serial-getty@ttyAMA10.service`.
`sudo raspi-config nonint do_boot_behaviour B4` writes the `tty1`
autologin back, along with the desktop's.
- **The radio and the apps:** restore `/boot/firmware/config.txt.bak`, and
`sudo apt install firefox vlc`.
- **sudo without a password, and the seed files:** neither comes back. A
fresh card from the Imager has both.
9 changes: 6 additions & 3 deletions docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,12 @@ unprivileged datagram socket, not a raw one.
([ADR-0119](adr/0119-put-the-office-wall-dashboard-on-a-pi-5-on-hicks.md)):
`prometheus` to `heimdall`, the office wall dashboard, at
`10.0.50.15:9100/tcp`, for `node_exporter`. It carries the same residual as
`smaug`'s below. The endpoint is unauthenticated, so anything on Hicks can
read the Pi's own counters. The Pi itself holds no credentials: the pages it
shows are served by `trinity`, and their tokens are added there.
`smaug`'s below. The endpoint is unauthenticated, but the Pi's own
`nftables` admits 9100 from `10.0.99.20` alone, and drops everything but SSH
besides (`build-heimdall.md` §2), once that step is applied. Until then,
anything on Hicks can read the Pi's own counters. The Pi itself holds no
credentials: the pages it shows are served by `trinity`, and their tokens are
added there.

One of CasaBonita's passes is a monitoring pass, and it carries a residual worth
naming. `10.0.99.20 → 10.0.40.30:9100` lets Prometheus scrape `node_exporter`
Expand Down