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
32 changes: 32 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,38 @@ docstring gives: it is a record, not a claim about now.

## 2026-11-18

- **`fenrir` checks hourly that it is still an appliance, the last of its
audit's next steps.** "`fenrir` sheds the last of its audit's leftovers",
below, left a drift check as the one step open. Now
`homelab-appliance-state` reads, as root, what `build-the-sensor-guest.md`
leaves, and writes one 0-or-1 per check, eleven in all, to the lab's
Prometheus. The lab's `ApplianceCheckFailed` names a check that has failed
on two hourly runs, and `ApplianceStateStopped` covers a collector that
stops, for as long as it stays stopped.
- **Measured first.** The allowlists are what `fenrir` held on the day:
`sshd` and resolved and chrony on loopback, the sensor's Alloy on
`127.0.0.1:12345`, `core24` and `snapd`, and Docker's and Ubuntu's apt
sources. Listeners are exact pairs, loopback included, because the tools
the audit found would most likely have listened on localhost only. The
allowed keys' fingerprints stay on the guest, in
`/etc/homelab/appliance-key-fingerprints`.
- **A trap found while measuring.** An SSH session to `fenrir` still listed
`atreus` in `lxd`, though `/etc/group` did not, because a process keeps
the groups it started with. The groups check reads `id -nG atreus`,
which asks the database.
- **Proven.** Installed with `install-agent-collectors --only
appliance-state`, the first run read 1 for all eleven. A throwaway key
appended to `authorized_keys` was read at the next hourly run as
`FAILED: keys`, and `keys` read 0 in the lab's Prometheus; the key was
then removed. The two rules load on `alexander` at the next
`make up STACK=lab`.
- **What it does not do.** Whoever has root on `fenrir` can make every
check read 1, and the lab's Prometheus pages no one (ADR-0020). It
catches drift by accident, the kind the audit found. Letting one bit of
it cross to the estate, as ADR-0088 lets a service's health cross, was
not decided here.

With this, every next step of `fenrir`'s audit of 2026-11-13 is done.
- **The wall's Home row reads the thermostat and the Litter-Robot.** The
second of the wall's five steps. The row gains the hallway thermostat's
temperature and humidity, and "heating" or "cooling" while it is, read
Expand Down
35 changes: 35 additions & 0 deletions docs/runbooks/build-the-sensor-guest.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,41 @@ It must end with `apt-patch-state.prom written, mode 644`. Until 2026-11-17
this step was missing, and a libc6 upgrade waited four days for a reboot with
nothing saying so.

**Check that the guest stays an appliance** (#1577). `homelab-appliance-state`
reads, hourly, what §0 and §3 leave: `sshd`'s settings, the authorized keys,
root's keys, `sudoers.d`, the login accounts, `atreus`'s groups, user units and
lingering, the snaps, the apt sources, what listens in the host's network
namespace, and the size of `$HOME`. The lab's `ApplianceCheckFailed` names a
check that fails. It catches drift by accident; whoever has root here can make
it read clean, and the collector's header says so.

The keys check needs to know which keys are allowed, and that list stays on the
guest. After §3 has trimmed `authorized_keys` to the machines that administer
the guest, record their fingerprints, on `fenrir`:

```bash
sudo install -d -m 0755 /etc/homelab
ssh-keygen -lf ~/.ssh/authorized_keys | awk '{print $2}' \
| sudo tee /etc/homelab/appliance-key-fingerprints >/dev/null
sudo chmod 0644 /etc/homelab/appliance-key-fingerprints
```

Then, from the checkout on Hicks:

```bash
make install-agent-collectors AGENT=atreus@10.0.30.90 ARGS='--only appliance-state'
```

It must end with `appliance-state.prom written, mode 644`, and every check must
read 1:

```bash
cat /var/lib/node_exporter/textfile_collector/appliance-state.prom
```

A key added later is a change to that file in the same sitting, or the check
fails within the hour, which is the point.

**On a `fenrir` built before #850**, remove the cron line the timer replaces,
so the two do not both prune:

Expand Down
2 changes: 1 addition & 1 deletion docs/runbooks/schedule-maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ runs Alloy but has no checkout of this repository — `oracle` — gets the
collectors and their own timers installed directly, by `make
install-agent-collectors AGENT=user@host`. It ships every collector the script's
`COLLECTORS` table names — `patch-state`, `smart-state`, `pve-version`, `cert-expiry`,
`guest-state`, `thin-pool-state`, `guest-disk-state`, `guest-service-state`, `pve-firewall-state`, `iso-store-state`, `zeek-mirror-state`, `pbs-task-state` and `drift-check`, plus the two
`guest-state`, `thin-pool-state`, `guest-disk-state`, `guest-service-state`, `pve-firewall-state`, `iso-store-state`, `zeek-mirror-state`, `pbs-task-state`, `drift-check` and `appliance-state`, plus the two
rows that collect nothing, `zeek-mirror` and `prune-images`, and one scheduled job, `zeek-archive-prune` — and checks each host's requirements **per
collector**, so a host without apt still gets SMART and the one it cannot have
is reported rather than skipped silently. `ARGS='--only smart-state'` narrows
Expand Down
2 changes: 1 addition & 1 deletion docs/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ What this network is actually built to survive:
| An attacker on the lab segment reaching the hypervisor's management plane | **Closed at the host, and watched.** `Saruman`'s Proxmox firewall admits `8006` and `22` from Hicks and `8006` from the deployment host only ([ADR-0014](adr/0014-put-ifrit-on-imaginationlan-and-give-the-targets-no-route.md), [ADR-0043](adr/0043-keep-the-ca-on-prometheus-and-build-phoenix-as-the-deployment-host.md)). It was found disabled and turned on on 2026-09-20 ([#566](https://github.com/Gerrrt/HomeLab/issues/566)); since [#576](https://github.com/Gerrrt/HomeLab/issues/576) `homelab_pve_firewall_enabled` is read every five minutes and `PveFirewallDisabled` pages after ten, so a `pve-firewall stop` left in place is noticed rather than found. `PveFirewallPolicyAccept` does the same for `policy_in` left at `ACCEPT`, which reads as enabled and admits the whole segment |
| Someone on the lab segment reaching the domain's configuration path | **Scoped, key-only, and accepted for `phoenix` itself.** Each of ADR-0029's six listens on `22` for `ansible/` ([ADR-0077](adr/0077-configure-the-lab-domain-with-ansible-from-phoenix.md)). The rule admits `10.0.30.70` alone, `sshd` refuses passwords, and the only administrators' key is `phoenix`'s, installed by the template and never by hand on a clone. The residual: whoever owns `phoenix` owns the lab domain. That was already true through its Proxmox token, so it adds reach to nothing. Host keys are not pinned, because every rebuild replaces them. `phoenix`'s own way in is narrowed to match by [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md): its `sshd` takes keys only, and its `ufw` admits `22` from Hicks and the tunnel's peers and nothing from the rest of VLAN 30. Until [#1496](https://github.com/Gerrrt/HomeLab/issues/1496) applies it on the host, the installer's password login and an open segment are what stand there |
| Someone on the lab segment logging in to the sensor | **Closed at `sshd`.** `fenrir` sees every frame on `Saruman`'s lab bridge, and its `sshd` answers all of VLAN 30 with no host firewall. [`build-the-sensor-guest.md`](runbooks/build-the-sensor-guest.md) §3 makes `sshd` key-only for one user through a drop-in that outranks cloud-init's, refuses root and X11 forwarding, and keeps `authorized_keys` to the machines that administer the guest. The audit of 2026-11-13 found it very likely taking passwords, with X11 forwarding on and 18 distinct keys authorized, most imported from GitHub. The step was applied on 2026-11-17: `sshd -T` read `no` for all four settings with `allowusers atreus`, and `authorized_keys` went from 20 lines to the 2 keys that had logged in. The source address stays open: anyone on the segment can still offer a key |
| Someone who takes the sensor reaching beyond its traffic | **Closed by clearing the guest, and kept by the runbook alone.** `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. Nothing re-checks this; a tool installed on `fenrir` again would be found only by the next audit |
| 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 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 |
Expand Down
1 change: 1 addition & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ they describe. The rest are installed on the host they describe by
| `collect-zeek-mirror-state.sh`, `zeek-mirror.sh` | The `tc` mirror to the Zeek sensor: build it, and whether it carries packets ([ADR-0068](../docs/adr/0068-mirror-the-lab-bridge-to-zeek-with-tc-not-open-vswitch.md)) |
| `collect-pbs-task-state.py` | What `golem`'s Proxmox Backup Server last did: verify, prune and garbage-collection outcomes, and its snapshots by verify state and encryption ([ADR-0053](../docs/adr/0053-run-pbs-on-saruman-with-its-datastore-on-smaug-over-nfs.md)) |
| `collect-drift-check.sh` | The wiki's drift check and what it found |
| `collect-appliance-state.sh` | Whether `fenrir` is still the appliance its runbook leaves, one pass-or-fail per check ([#1577](https://github.com/Gerrrt/HomeLab/issues/1577)) |
| `mark-clean-shutdown.sh` | Clean stops by kind, so a disk-fault page can tell a power cut from a shutdown |

## Live-host checks
Expand Down
Loading