diff --git a/docs/changelog.md b/docs/changelog.md index 48b9b4e5..ad950e15 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,16 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-26 +- **`build-heimdall.md` §2 masks `packagekit.service`.** A re-check of + `heimdall` after the 04:30 boot found Raspberry Pi OS's + `10-gui-pkinst.rules`, there since the build, which lets any `sudo` member + install or remove packages through PackageKit with no password, over SSH as + well. That undid part of 2026-11-25's "sudo asks for the password". The + same check found that the 06:04 unattended-upgrades run installed + `browser-choice` 0.4, a new dependency of `rpd-applications` 1.39: a + browser picker, harmless, but a reminder that the daily upgrades can add + packages as well as update them. Masked on the Pi the same day. + - **`phoenix` runs ADR-0135.** `build-the-jumpbox.md` §6a, merged in [#1756](https://github.com/Gerrrt/HomeLab/pull/1756), was applied on `phoenix`. `10-phoenix.conf` gained `DisableForwarding yes`, and cloud-init's diff --git a/docs/runbooks/build-heimdall.md b/docs/runbooks/build-heimdall.md index 0ec95359..f12df654 100644 --- a/docs/runbooks/build-heimdall.md +++ b/docs/runbooks/build-heimdall.md @@ -260,6 +260,30 @@ sudo systemctl mask --now systemd-rfkill.service systemd-rfkill.socket After §3's reboot, `ls /sys/class/bluetooth` prints nothing, and `systemctl --failed` lists nothing. +### No package installs without the password + +Removing cloud-init's sudoers file (§1) is not the only route to root. +Raspberry Pi OS ships a polkit rule, +`/usr/share/polkit-1/rules.d/10-gui-pkinst.rules`, that lets any member of +`sudo` install, remove and upgrade packages through PackageKit without +authenticating. Its one condition is that the caller's command line reads +`gui-pkinst`, which the caller chooses, and it does not require a local +session, so it holds over SSH too. With it, the SSH key alone could remove +`nftables`. The desktop's metapackages depend on `packagekit`, so mask it +rather than purge it. Nothing on the kiosk uses it: `unattended-upgrades` +calls apt directly. + +```bash +sudo systemctl mask --now packagekit.service +systemctl is-enabled packagekit.service # masked +gdbus call --system --dest org.freedesktop.PackageKit \ + --object-path /org/freedesktop/PackageKit \ + --method org.freedesktop.DBus.Peer.Ping # fails: the unit is masked +``` + +`packagekit.service` is started by D-Bus on demand, so masking it is what +stops it. The rule stays, with nothing left to answer it. + ### Nothing at the console but a login The Imager's desktop autologin also logs the user into a text shell on @@ -525,6 +549,8 @@ the roadmap's *Everything still to buy* and an ADR of its own. - **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. +- **PackageKit:** `sudo systemctl unmask packagekit.service`. The rule + above applies again. - **The radio and the apps:** restore `/boot/firmware/config.txt.bak`, `sudo systemctl unmask systemd-rfkill.service systemd-rfkill.socket`, and `sudo apt install firefox vlc`.