diff --git a/docs/changelog.md b/docs/changelog.md index 4a070c3c..7d2d08b2 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,61 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-25 +- **`golem`'s §2 is whole, and the first nightly on the new release + backed up clean.** This closes most of the *not done* list in the entry + below. + - **Second factor.** `root@pam` has a TOTP entry, enrolled by the operator + in the web UI. + - **Alloy.** The operator redeployed it from the Mac by + `deploy-agent.sh --runtime native --monitoring-host 10.0.30.40`, and its + arrival check passed. `CUSTOM_ARGS` now carries `--disable-reporting`, + and the agent logged no error and no usage report in the half hour after. + - **`zfs-zed`.** It is disabled and stopped. `zpool list` said *no pools + available* first. §2 now does the same, so a rebuild repeats it. + - **The nightly.** The 21:00 PST job backed up all eight guests, 150–155, + 160 and 162. Each task ended OK, in 2 to 11 minutes, much as on earlier + nights. The collector, run afterwards, counted 0 unencrypted snapshots, + and its newest snapshot was `garuda`'s from that run. + - **Still open.** There is no host-firewall decision for `golem`, and no + test restore recorded since 2026-10-03. +- **`build-the-backup-guest.md` §2 is applied on `golem`, except the second + factor, and its pending updates are installed.** It closes most of what the + audit of 2026-11-13 found on the box. Until today that audit had changed the + runbook and nothing on `golem`. + - **`sshd`.** `/etc/ssh/sshd_config.d/10-golem.conf`, as §2 writes it. + Every login in the fourteen days before used a key, except two password + logins from `desktop-02` on 2026-11-13, a minute before its key was copied + in, so every host that logs in had a key first. `sshd -T` reads + `without-password`, `no`, `no`, and a password login is refused with + `Permission denied (publickey)`. + - **`rpcbind`.** `rpcbind.socket`, `rpcbind.service` and + `nfs-blkmap.service` are disabled and stopped. Nothing listens on `111`. + `22` and `8007` are the only ports on an address other than loopback. + - **Updates.** `apt full-upgrade` installed the 60 pending updates, 20 of + them from `trixie-security`, and the new kernel they pulled in. PBS moved + up a point release. No configuration file was replaced, and the drop-in + and the disabled units survived the upgrade. + - **Reboot.** `golem` rebooted onto the new kernel with no PBS task running, + two hours before the nightly job. Afterwards there were no failed units. + The datastore was mounted and readable, and `sshd` and `111` read as + above. The collector, run by hand, reported verify, prune and garbage + collection OK and no unencrypted snapshot. Alloy had logged no error. + - **Not done.** + - `root@pam` has no second factor, so the UI on `8007` still takes its + password alone. Enrolling TOTP needs the operator's authenticator. + - `golem`'s Alloy is older than `main`. Its config dates from 2026-11-12 + and lacks `--disable-reporting`, and it logged five failed usage + reports in the 24 hours before. The redeploy is from the Mac, by + `deploy-merged-changes.md`. + - `zfs-zed` still runs, with no pool to watch. + - No host firewall, and nothing decides either way for `golem`, as + ADR-0128 does for `prometheus`. + - The first nightly backup on the new release had not run when this was + written. + - **Corrects the 2026-11-15 entry on `alexander`'s `sshd`.** It says the + same weakness was "closed on `golem` by the audit of 2026-11-13". The + audit closed it in the runbook only. On the box it stayed open until this + entry. - **`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 diff --git a/docs/runbooks/build-the-backup-guest.md b/docs/runbooks/build-the-backup-guest.md index 0d27dbed..82f000b6 100644 --- a/docs/runbooks/build-the-backup-guest.md +++ b/docs/runbooks/build-the-backup-guest.md @@ -115,6 +115,14 @@ printf 'PermitRootLogin prohibit-password\nPasswordAuthentication no\nX11Forward systemctl disable --now rpcbind.socket rpcbind.service nfs-blkmap.service ``` +The installer also leaves ZFS's event daemon running, and `golem` has no +pool: its disk is ext4 on LVM, and the datastore is NFS. `zpool list` must say +*no pools available* first: + +```bash +systemctl disable --now zfs-zed.service +``` + After §5's mount exists, reboot once and check that `findmnt /mnt/datastore/erebor` still shows the share. And give `root@pam` a second factor in the web UI, *Configuration → Access Control → Two Factor diff --git a/docs/security.md b/docs/security.md index 86d466a9..8fd066fd 100644 --- a/docs/security.md +++ b/docs/security.md @@ -22,6 +22,7 @@ What this network is actually built to survive: | Someone who takes the sensor reaching beyond its traffic | **Closed by clearing the guest, and re-checked hourly for drift by accident.** `fenrir` is an appliance ([`build-the-sensor-guest.md`](runbooks/build-the-sensor-guest.md) §0): the sensor stack, the agent collectors, the repository checkout and the stack's age key, and nothing else. The audit of 2026-11-13 found it used as a workstation as well: dotfiles, a stored Claude Code login with npm MCP servers reaching the internet, a `gh` token, the 1Password CLI and development packages, 4.8 GB in `$HOME`. All of it was removed on 2026-11-17, and a read the same evening found none of it: no user services beyond the distribution's, no TCP connection on the host's own sockets but inbound SSH from Hicks, and 180 MB in `$HOME`, nearly all of it the checkout. That read covered the host's network namespace only. The sensor's own Alloy, in its container, still pushes logs and metrics to `alexander`, as it is meant to. Since #1577 an hourly collector on `fenrir` re-reads what the runbook leaves (`sshd`, the keys, accounts and groups, user units, snaps, apt sources, host listeners, the size of `$HOME`) and the lab's `ApplianceCheckFailed` names a check that fails. That catches drift by accident only: whoever has root on `fenrir` can make it read clean, and the lab's Prometheus pages no one (ADR-0020), so it is seen by someone looking at the lab | | Someone on the lab segment logging in to `alexander` | **Closed at `sshd`.** `alexander` holds the lab's only age key, and its `sshd` answers all of VLAN 30 with no host firewall. It is installed by hand from the ISO, so it does not inherit the template's `allow-pw: false`. [`build-the-lab-guest.md`](runbooks/build-the-lab-guest.md) §2 makes `sshd` key-only through a drop-in, refuses root and X11 forwarding, and keeps `garnet`'s `authorized_keys` to Hicks's key and `phoenix`'s; §7 checks it with `sshd -T`. A read on 2026-11-15 found it taking passwords; the step was applied the same day, and `sshd -T` read `no` for all four settings. The source address stays open: anyone on the segment can still offer a key | | Someone on the lab segment logging in to `odin` | **Closed at `sshd`.** `odin` holds the SOC's certificate authority key and its own age key, and its `sshd` answers all of VLAN 30 with no host firewall. It is installed by hand from the ISO, so OpenSSH's default of taking passwords stood. [`build-the-soc-guest.md`](runbooks/build-the-soc-guest.md) §2 makes `sshd` key-only through a drop-in that outranks cloud-init's, and refuses root and X11 forwarding; §10 checks it with `sshd -T`. A read on 2026-11-15 found it taking passwords and X11 forwarding; the step was applied on 2026-11-16, and `sshd -T` read `no` for all four settings. The source address stays open: anyone on the segment can still offer a key | +| Someone on the lab segment logging in to `golem` | **Closed at `sshd`, with a second factor on `root@pam`, since 2026-11-25. There is no host firewall and no decision on one.** `golem` can delete every backup the lab has; the TrueNAS snapshots of `erebor/pbs` are the copy it cannot. Its `sshd` and PBS's UI on `8007` answer all of VLAN 30 with no host firewall. It is installed by hand from the PBS ISO, whose installer lets root log in by password and starts `rpcbind` on every address. [`build-the-backup-guest.md`](runbooks/build-the-backup-guest.md) §2 does three things. A drop-in keeps root to keys and refuses passwords and X11 forwarding. `rpcbind` and `nfs-blkmap` are turned off. `root@pam` gets a TOTP second factor. The audit of 2026-11-13 found all of it open. The drop-in and the services were applied on 2026-11-25. `sshd -T` read `without-password`, `no`, `no`, a password login was refused with `Permission denied (publickey)`, and nothing listened on `111`. After a reboot the datastore was mounted again. The TOTP second factor was enrolled later the same day. The source address stays open: anyone on the segment can still offer a key or reach the login page | | Someone on the lab segment reading the domain's metrics | **Scoped, unauthenticated, and accepted.** `windows_exporter` listens on `9182` on all six of ADR-0029's guests, on the segment that exists to hold attackers. Each guest's Windows Firewall admits `10.0.30.40` (`alexander`) alone ([`build-the-lab-domain.md`](runbooks/build-the-lab-domain.md) §7). That rule is the difference between an endpoint a `/24` sweep finds and one you have to go looking for, and it is a residual, not a control: the exporter has no authentication, so whoever owns `alexander` reads every gauge. It has no write API, so what leaks is the shape of the host (services, disks, uptime, the licence clock), the same class as `node_exporter` on the NAS below | | Someone on the lab segment fetching a Velociraptor client package | **Scoped by address, and accepted.** `odin`'s `caddy` service (container `soc-agent-msi`) serves the two agent MSIs `ansible/` installs, and the two Debian packages `garuda` installs, on `8448` ([#1068](https://github.com/Gerrrt/HomeLab/issues/1068), [ADR-0092](adr/0092-enrol-garuda-in-odins-soc-with-debian-packages-staged-on-odin.md)). Its Caddyfile answers the six domain addresses, `.50`–`.55`, and `garuda`'s `.62`, and refuses everyone else, Hicks's route from VLAN 50 included. The Velociraptor MSI and the Velociraptor `.deb` each carry the client config: the server URL, its CA, and the enrolment nonce. Whoever holds either can enrol a rogue client, which is why #864 took the MSI out of SYSVOL. The residual: an address on this segment can be spoofed, and any of the seven can fetch either package. What the nonce buys is noise in Velociraptor's client list, the same class as the Wazuh enrolment password. Rotating it means a new server config, a rebuilt MSI with the role's pin moved, and the staged `.deb` deleted so that `scripts/stage-agent-msis.sh` builds it again. The two Wazuh packages carry no secret | | An OpenVAS plugin on `garuda` reaching a non-target | **Fenced at layer 2** ([ADR-0093](adr/0093-run-openvas-on-garuda-on-demand-scoped-to-the-domain-by-nftables.md)). OpenVAS scans the domain's six only. While a scan runs, the scanner runs in a network namespace whose one route to the segment is a macvlan, `scan0` at `10.0.30.63`, behind an nftables `netdev` egress hook that drops every frame — IP, ARP (`send_arp_request`) and raw (`send_frame`) — to anything but the six. So the AF_PACKET paths that bypass an IP filter are caught here. Proved: a GVM scan of an out-of-scope host raised the egress drop counter with 0 open ports, and an `arping` from the namespace to an out-of-scope host was dropped while an in-scope host answered. `gvmd`, `notus`, `redis` and `mosquitto` stay on the host; only MQTT crosses to the namespace, on a veth that routes nowhere else |