From 18fedac38e81778aff9c6d0f51dd45b9f1968bba Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Thu, 19 Nov 2026 20:50:21 -0800 Subject: [PATCH] fix(phoenix): key-only sshd and a default-deny ufw policy are applied ADR-0117 is applied on phoenix: the 10-phoenix.conf sshd drop-in and build-the-jumpbox.md section 6a's ufw rules. The current-state docs say so, the roadmap entry leaves, and the changelog records the checks from Hicks, alexander and the tunnel. Also corrects the tunnel's peer (the MacBook, whose WireGuard profile is named laptop-01) and the runbooks' expected ttl (62, through morpheus). Refs #1496 Co-Authored-By: Claude Opus 5.5 --- docs/architecture.md | 2 +- docs/changelog.md | 49 +++++++++++++++++++++++++++ docs/network.md | 13 ++++--- docs/roadmap.md | 10 ++---- docs/runbooks/build-the-jumpbox.md | 5 +-- docs/runbooks/open-the-remote-path.md | 12 ++++--- docs/security.md | 2 +- 7 files changed, 70 insertions(+), 23 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 8217c973..81e23ab4 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -204,7 +204,7 @@ hole from the monitoring VLAN into the monitored one. | `dot-gentoo` (10.0.30.96) | 🟢 30 | *(none — a test machine)* | Built 2026-10-09. Gentoo Linux on the 23.0 systemd profile, cloned from `tpl-gentoo` (908), which Packer made from Gentoo's own signed cloud image, for the dotfiles' Gentoo layer (whose default is OpenRC). Secure Boot is off. A guest on `Saruman`, VMID 196, tagged `on-demand` (ADR-0079) and off between runs, rolled back to its `clean` snapshot before each one ([#920](https://github.com/Gerrrt/HomeLab/issues/920), [ADR-0090](adr/0090-test-the-dotfiles-os-layers-on-on-demand-saruman-guests.md), [`test-the-dotfiles-layers.md`](runbooks/test-the-dotfiles-layers.md)). Standalone, not a domain member. No scrape, no backup: it is rebuilt from its template, and runs no Alloy | | `dot-nixos` (10.0.30.97) | 🟢 30 | *(none — a test machine)* | Built 2026-10-09. NixOS 26.05, cloned from `tpl-nixos` (909), which Packer installed from the minimal ISO with a committed `configuration.nix`, for the dotfiles' NixOS layer. Secure Boot is off. A guest on `Saruman`, VMID 197, tagged `on-demand` (ADR-0079) and off between runs, rolled back to its `clean` snapshot before each one ([#920](https://github.com/Gerrrt/HomeLab/issues/920), [ADR-0090](adr/0090-test-the-dotfiles-os-layers-on-on-demand-saruman-guests.md), [`test-the-dotfiles-layers.md`](runbooks/test-the-dotfiles-layers.md)). Standalone, not a domain member. No scrape, no backup: it is rebuilt from its template, and runs no Alloy | | `dot-windows` (10.0.30.98) | 🟢 30 | *(none — Windows)* | Built 2026-10-08. Windows 11 Pro, cloned from `tpl-win11-pro` (911) and left unactivated, for the dotfiles' Windows layer. A guest on `Saruman`, VMID 198, tagged `on-demand` (ADR-0079) and off between runs, rolled back to its `clean` snapshot before each one ([#920](https://github.com/Gerrrt/HomeLab/issues/920), [ADR-0090](adr/0090-test-the-dotfiles-os-layers-on-on-demand-saruman-guests.md), [`test-the-dotfiles-layers.md`](runbooks/test-the-dotfiles-layers.md)). Standalone, not a domain member. No scrape, no backup: it is rebuilt from its template, and runs no Alloy | -| `phoenix` (10.0.30.70) | 🟢 30 | *(none — a toolchain host, no Docker)* | The deployment host, built 2026-09-20: a Proxmox API token, an SSH key and a checkout, so that the Packer, OpenTofu and Ansible work after [#436](https://github.com/Gerrrt/HomeLab/issues/436) has somewhere to run from. A guest on `Saruman`, placed by [ADR-0043](adr/0043-keep-the-ca-on-prometheus-and-build-phoenix-as-the-deployment-host.md), which also decides that the estate's CA key stays on `prometheus` and does not follow the toolchain here. It holds no age key and runs no continuous convergence (what it configures, it configures on demand, below); it is the WireGuard endpoint of [ADR-0042](adr/0042-terminate-the-remote-path-on-the-lab-and-route-it.md), built 2026-09-22 ([#442](https://github.com/Gerrrt/HomeLab/issues/442)); the one thing it is meant to reach that no other guest does is `8006` on `Saruman`, by a single host-firewall rule — written 2026-09-20, when [#566](https://github.com/Gerrrt/HomeLab/issues/566) enabled the firewall the build had found disabled and narrowed the `local_network` alias that was admitting the whole segment underneath it. Its Alloy pushes to `alexander`, never to VLAN 99; the build is [`build-the-jumpbox.md`](runbooks/build-the-jumpbox.md). The first toolchain on it is [`packer/`](../packer/README.md), the lab's VM templates at VMIDs 901–912, with 903–909 for the dotfiles OS layers ([ADR-0090](adr/0090-test-the-dotfiles-os-layers-on-on-demand-saruman-guests.md)) ([ADR-0074](adr/0074-build-the-lab-templates-with-packer-from-phoenix.md), [`build-the-lab-templates.md`](runbooks/build-the-lab-templates.md)). The second is [`ansible/`](../ansible/README.md), which configures ADR-0029's six over SSH and touches nothing else ([ADR-0077](adr/0077-configure-the-lab-domain-with-ansible-from-phoenix.md), [#448](https://github.com/Gerrrt/HomeLab/issues/448)). Its own way in is decided by [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md): `sshd` takes keys only, and `ufw` admits `22` from Hicks and the tunnel's peers, the tunnel's port, and `8800` from VLAN 30 for the length of a Debian or Kali template build. Applying it on the host is [#1496](https://github.com/Gerrrt/HomeLab/issues/1496). Alloy agent (native package, `scripts/deploy-agent.sh`) | +| `phoenix` (10.0.30.70) | 🟢 30 | *(none — a toolchain host, no Docker)* | The deployment host, built 2026-09-20: a Proxmox API token, an SSH key and a checkout, so that the Packer, OpenTofu and Ansible work after [#436](https://github.com/Gerrrt/HomeLab/issues/436) has somewhere to run from. A guest on `Saruman`, placed by [ADR-0043](adr/0043-keep-the-ca-on-prometheus-and-build-phoenix-as-the-deployment-host.md), which also decides that the estate's CA key stays on `prometheus` and does not follow the toolchain here. It holds no age key and runs no continuous convergence (what it configures, it configures on demand, below); it is the WireGuard endpoint of [ADR-0042](adr/0042-terminate-the-remote-path-on-the-lab-and-route-it.md), built 2026-09-22 ([#442](https://github.com/Gerrrt/HomeLab/issues/442)); the one thing it is meant to reach that no other guest does is `8006` on `Saruman`, by a single host-firewall rule — written 2026-09-20, when [#566](https://github.com/Gerrrt/HomeLab/issues/566) enabled the firewall the build had found disabled and narrowed the `local_network` alias that was admitting the whole segment underneath it. Its Alloy pushes to `alexander`, never to VLAN 99; the build is [`build-the-jumpbox.md`](runbooks/build-the-jumpbox.md). The first toolchain on it is [`packer/`](../packer/README.md), the lab's VM templates at VMIDs 901–912, with 903–909 for the dotfiles OS layers ([ADR-0090](adr/0090-test-the-dotfiles-os-layers-on-on-demand-saruman-guests.md)) ([ADR-0074](adr/0074-build-the-lab-templates-with-packer-from-phoenix.md), [`build-the-lab-templates.md`](runbooks/build-the-lab-templates.md)). The second is [`ansible/`](../ansible/README.md), which configures ADR-0029's six over SSH and touches nothing else ([ADR-0077](adr/0077-configure-the-lab-domain-with-ansible-from-phoenix.md), [#448](https://github.com/Gerrrt/HomeLab/issues/448)). Its own way in is decided by [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md): `sshd` takes keys only, and `ufw` admits `22` from Hicks and the tunnel's peers, the tunnel's port, and `8800` from VLAN 30 for the length of a Debian or Kali template build. Applied on the host 2026-11-19 ([#1496](https://github.com/Gerrrt/HomeLab/issues/1496)). Alloy agent (native package, `scripts/deploy-agent.sh`) | | `golem` (10.0.30.80) | 🟢 30 | *(none — an appliance, no Docker)* | Proxmox Backup Server 4.2, built 2026-10-03 by [`build-the-backup-guest.md`](runbooks/build-the-backup-guest.md) ([#485](https://github.com/Gerrrt/HomeLab/issues/485)): the lab's backups, placed by [ADR-0053](adr/0053-run-pbs-on-saruman-with-its-datastore-on-smaug-over-nfs.md). A guest on `Saruman`, VMID 180, whose only datastore, `erebor`, is `smaug`'s `erebor/pbs` over NFSv4 through one `2049` pass, with `atime` on because garbage collection depends on it, and the mountpoint made immutable so an unmounted share cannot fill the OS disk. Every backup is encrypted on `Saruman` before it leaves, with a key made on `Saruman` and copied, on 2026-10-03, into `secrets/lab.sops.yaml` and onto paper (the runbook's §7), so a lost `Saruman` does not take the backups' readability with it; `Saruman` writes through a token that can back up and cannot prune. PBS prunes (7 daily, 4 weekly, 3 monthly), collects garbage on Saturdays and verifies on Sundays; TrueNAS keeps fourteen daily snapshots of the dataset as the copy PBS cannot prune. The nightly job takes `odin`, `garuda` and the domain's six, the guests tagged `backup`; `alexander`, `phoenix`, `fenrir` and `golem` itself are rebuilt from this repository and stay out, and so does `eden`, whose graph is one collection run from rebuilt (the runbook's §8). `scripts/collect-pbs-task-state.py` publishes every job's last outcome and the snapshots' verify state hourly, and seven rules in `stacks/lab` read them; the first nightly run, 2026-10-03, was verified the next morning. Its Alloy pushes to `alexander`, never to VLAN 99, since 2026-10-03. Alloy agent (native package, `scripts/deploy-agent.sh`) | | `oracle` (10.0.99.30) | 🔴 99 | [`stacks/wiki`](../stacks/wiki) | The Lemmiwinks wiki and its Postgres, since 2025-11-12 ([ADR-0011](adr/0011-keep-the-wiki-internal.md)), hand-run containers until [#251](https://github.com/Gerrrt/HomeLab/issues/251) wrote them down as a stack deployed by hand from `main`, like `smaug`'s. **Cut over 2026-10-07** ([#847](https://github.com/Gerrrt/HomeLab/issues/847), [ADR-0082](adr/0082-serve-the-wiki-over-tls-and-deploy-it-from-a-verified-checkout.md)): deployed by hand from a checkout whose signature is verified first, and served over https from a Caddy on a leaf from the estate's CA, with port 80 only redirecting ([`stacks/wiki/README.md`](../stacks/wiki/README.md#tls)); its database is pulled to `prometheus` nightly as a `pg_dump` (`make backup-wiki`, [ADR-0065](adr/0065-pull-the-wikis-database-to-prometheus-as-a-dump.md)); Alloy agent (Docker, `scripts/deploy-agent.sh`); the off-host copies of the firewall export (`make backup-firewall`), of the weekly volume sets (`make backup`, [#535](https://github.com/Gerrrt/HomeLab/issues/535)) of the media tier's state pulled off `smaug` (`make backup-nas`, [ADR-0045](adr/0045-pull-jellyfins-state-from-a-snapshot-over-ssh.md)), and of `trinity`'s nightly sensitive-tier volume sets and Immich's library ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)). The estate's host for small off-host jobs — [ADR-0015](adr/0015-give-oracle-the-off-host-jobs.md) | | `trinity` (10.0.99.40) | 🔴 99 | [`stacks/sensitive`](../stacks/sensitive) | ADR-0008's sensitive tier on the ProDesk 600 G4 of [ADR-0034](adr/0034-run-the-sensitive-tier-on-the-prodesk-and-make-it-the-spare-hardware.md). **Built and deployed 2026-09-28** ([#404](https://github.com/Gerrrt/HomeLab/issues/404), [`build-the-sensitive-tier-host.md`](runbooks/build-the-sensitive-tier-host.md)): Ubuntu 26.04 with both disks LUKS-encrypted and the root unlocked by the TPM ([ADR-0054](adr/0054-encrypt-trinitys-disks-and-seal-the-root-key-to-the-tpm.md)), all twelve containers healthy, and since that day AdGuard is the one forwarder behind `morpheus`'s resolver ([ADR-0055](adr/0055-forward-to-adguard-alone.md)). Holding real data since 2026-09-28, Immich's first 615 photographs, which passed the #404 step 10 gate while most of it was open. The library is copied nightly to `oracle`, off-host and not off-estate, until [#455](https://github.com/Gerrrt/HomeLab/issues/455) ([ADR-0064](adr/0064-copy-immichs-library-to-oracle-until-the-off-estate-copy-exists.md)). The stack: Caddy as the published HTTPS port and step-ca issuing beneath the tier's own root rather than the estate's, which is left untouched ([#129](https://github.com/Gerrrt/HomeLab/issues/129), [#130](https://github.com/Gerrrt/HomeLab/issues/130), [ADR-0037](adr/0037-give-the-sensitive-tier-its-own-root-and-issue-beneath-it-over-acme.md)), with AdGuard Home behind Caddy and publishing 53 to the firewall's forwarder alone ([#135](https://github.com/Gerrrt/HomeLab/issues/135), [ADR-0010](adr/0010-keep-the-resolver-on-the-gateway.md)); Home Assistant ([#134](https://github.com/Gerrrt/HomeLab/issues/134)), Immich — four containers behind Caddy with a memory limit on each ([#132](https://github.com/Gerrrt/HomeLab/issues/132)) — Paperless-ngx with a Postgres and a Valkey of its own ([#133](https://github.com/Gerrrt/HomeLab/issues/133)) and Vaultwarden ([#131](https://github.com/Gerrrt/HomeLab/issues/131)) run beside them, with the household's page of links to them at `home.matrix.elysium` and its live numbers on read-only tokens ([#137](https://github.com/Gerrrt/HomeLab/issues/137)) — Homepage until [ADR-0103](adr/0103-retire-homepage-and-serve-the-household-page-from-glance.md) made it a page of Glance's. ntfy ([#136](https://github.com/Gerrrt/HomeLab/issues/136)) is the in-house receiver for Alertmanager's three real channels, **deployed and cut over 2026-09-29** by [`verify-the-alert-path.md`](runbooks/verify-the-alert-path.md#cutting-over-to-the-in-house-ntfy), with `urgent` and `security` also sent to ntfy.sh for a phone away from home. Miniflux, a feed reader with a Postgres of its own, is the tier's first service beyond ADR-0008's nine, **deployed 2026-09-29** ([#147](https://github.com/Gerrrt/HomeLab/issues/147), [ADR-0057](adr/0057-add-miniflux-to-the-sensitive-tier-with-its-fetcher-kept-off-winterfell.md)): the one container here that reaches outward on a timer, with its fetcher refused every private address. Memos, the household's notes, is the second, decided by [ADR-0059](adr/0059-add-memos-to-the-sensitive-tier-for-notes-and-keep-documentation-in-docs.md) ([#145](https://github.com/Gerrrt/HomeLab/issues/145)) and deployed behind Caddy the same day, all sixteen containers healthy after that `make up`. Miniflux holds no real data; Memos holds the household's first real notes since 2026-10-22, ahead of ADR-0023's off-estate copy by the operator's accepted exception, with the nightly volume set on `oracle` its only copy off the host, since the household copy under [#455](https://github.com/Gerrrt/HomeLab/issues/455) does not carry `memos-data` yet. Mealie, the household's recipes at `recipes.matrix.elysium`, is the third, **deployed 2026-09-29** ([#146](https://github.com/Gerrrt/HomeLab/issues/146), [ADR-0060](adr/0060-add-mealie-to-the-sensitive-tier-as-recipes.md)), behind the same Caddy with no new rule, its URL import refused every private address. linkding, a bookmark manager, is the fourth, **deployed 2026-09-29** ([#144](https://github.com/Gerrrt/HomeLab/issues/144), [ADR-0061](adr/0061-add-linkding-to-the-sensitive-tier-behind-one-factor.md)). Actual ([#142](https://github.com/Gerrrt/HomeLab/issues/142)), the household's budget, is the fifth beyond ADR-0008's nine, **deployed 2026-09-29** ([ADR-0062](adr/0062-add-actual-to-the-sensitive-tier.md)), claimed from SOPS before its first start. It holds no real budget before #404 step 10. Stirling-PDF, the household's PDF editor at `pdf.matrix.elysium`, is the sixth, **deployed 2026-09-29** ([#143](https://github.com/Gerrrt/HomeLab/issues/143), [ADR-0063](adr/0063-add-stirling-pdf-to-the-sensitive-tier-and-keep-its-documents-in-memory.md)): its documents live on a tmpfs and never reach a disk. Glance, the operator's browser start page at `start.matrix.elysium`, is **deployed 2026-10-21** ([#1223](https://github.com/Gerrrt/HomeLab/issues/1223), [ADR-0098](adr/0098-add-glance-as-the-operators-start-page-beside-homepage.md)): the estate's alerts, probes and targets read from `prometheus` with the reader token, and feeds read from a Miniflux user of its own. Since [ADR-0100](adr/0100-grow-glance-into-a-homelab-page-and-keep-the-operators-lists-in-sops.md) it has a page per subject — Home, Read, Watch, Sports & Markets, Homelab, Network & Storage and Maintenance — the estate's read from `prometheus`, and the operator's own lists come from SOPS. It also serves the household's page at `home.matrix.elysium` ([ADR-0103](adr/0103-retire-homepage-and-serve-the-household-page-from-glance.md)), which took over from Homepage. The office wall page, static files under `wall/` that Caddy serves at `wall.matrix.elysium` with ten fixed Prometheus questions and twenty Home Assistant entities behind it (most of them template sensors from its own `wall_*.yaml` packages), is **deployed 2026-11-17** for `heimdall`'s kiosk ([ADR-0119](adr/0119-put-the-office-wall-dashboard-on-a-pi-5-on-hicks.md)), with its host override on `morpheus` and a blackbox probe, `wall`. Mosquitto and ring-mqtt bring the Ring Alarm into Home Assistant, the broker on an internal network that only those two join, **deployed 2026-10-22** ([ADR-0104](adr/0104-bring-the-ring-alarm-into-home-assistant-through-ring-mqtt.md)). Alloy agent (Docker, `scripts/deploy-agent.sh`), pushing to `prometheus` like `oracle`'s | diff --git a/docs/changelog.md b/docs/changelog.md index ea2d95fc..7e655d73 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,55 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-19 +- **`phoenix`'s own way in is closed: `sshd` takes keys only, and `ufw` is + default-deny inbound.** This applies + [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md) + with [`build-the-jumpbox.md`](runbooks/build-the-jumpbox.md) §6a. Before it, + `sshd -T` read `passwordauthentication yes`, `x11forwarding yes` and + `permitrootlogin prohibit-password`, with only cloud-init's drop-in, and + `ufw` was inactive, so `22` answered all of VLAN 30. + - **Who would have been shut out.** Thirty days of `sshd`'s journal showed + logins from Hicks only: the MacBook, wired and on Wi-Fi, by key, and + `desktop-02` by password, 22 times. `desktop-02` got a key and logged in + with it before passwords were turned off. `authorized_keys` now holds two + keys. + - **`sshd`.** `10-phoenix.conf` is in place. `sshd -T` reads `no` for + password, keyboard-interactive and root login and for X11 forwarding. A + fresh key login succeeds, and a client offering only a password gets + `Permission denied (publickey)`. + - **`ufw`.** The runbook's rules: `22` from `10.0.50.0/24`, `22` in on + `wg0` from the tunnel's subnet, the tunnel's port, and the one `route` + rule from `wg0` to `ens18`. The listen port was read from `wg` on the + host and is not written down here. Nothing else listened, and Alloy only + connects outward, so default-deny took nothing away. + - **Checked.** A fresh key login from Hicks succeeds. + `nc -zv -w 3 10.0.30.70 22` from `alexander` times out, and its three + SYNs are logged as `UFW BLOCK`. §4's `curl` lists 34 guests. + `phoenix-metrics` and `phoenix-alloy` stay `up`, with samples under a + minute old, and the logs keep arriving. One stray ACK on Alloy's + connection to `alexander` was blocked at the moment `ufw` came up. The + connection carried on. + - **Checked from the tunnel,** with the MacBook on a phone's hotspot and + the route table showing `10.0.30.70` through the tunnel. A key login to + `phoenix` succeeds and arrives from `172.31.0.2`. `ping 10.0.30.40` + answers at `ttl=62`, not the 63 the runbooks expected: a capture on + `phoenix` shows the request forwarded straight to `alexander` and the + reply coming back from `morpheus`, because `alexander` answers the tunnel + subnet through its default gateway, as ADR-0042's routed design has it. + Both runbooks now expect 62. With the client's `AllowedIPs` widened for + [`open-the-remote-path.md`](runbooks/open-the-remote-path.md) §8, + ten pings each to Winterfell, Hicks and CasaBonita all failed, while + `alexander` still answered. `morpheus`'s filterlog shows ten blocks from + `172.31.0.2` to each and no passes outside the lab. `AllowedIPs` went + back to the lab alone afterwards. + - **The tunnel's one peer is the MacBook, not the HP laptop.** This + corrects the 2026-09-22 entry "#442 The estate has a remote path, and it + reaches the lab and nothing else", which named the peer `laptop-01`. + That is the name of the WireGuard app's tunnel profile on the MacBook + (`laptop-02` in [`network.md`](network.md)), and it collides with the HP + Pavilion that `network.md` calls `laptop-01`. The MacBook's key is + already on `phoenix`, so no key was added for the tunnel. + - **`phoenix`, `alexander` and `odin` no longer run the Ubuntu template's unused services.** All three were cloned from template 901 before `prune.sh` existed, and still carried all eight services that it purges: diff --git a/docs/network.md b/docs/network.md index b7a94f64..2b3f8194 100644 --- a/docs/network.md +++ b/docs/network.md @@ -761,13 +761,12 @@ Where things get broken on purpose. [ADR-0042](adr/0042-terminate-the-remote-path-on-the-lab-and-route-it.md)'s WireGuard tunnel terminates, built 2026-09-22 ([#442](https://github.com/Gerrrt/HomeLab/issues/442)); the peers reach the - lab through it and nothing else. Its inbound policy is decided and not yet - applied: [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md) - makes it default-deny, with `22` admitting Hicks and the peers and nothing - else on this segment, and `8800` open to the segment only while a Debian or - Kali template builds. Until [#1496](https://github.com/Gerrrt/HomeLab/issues/1496) - applies it, `phoenix` has no host firewall and `22` answers the whole - segment. Its Alloy pushes to + lab through it and nothing else. Its inbound policy is + [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md)'s, + applied 2026-11-19 ([#1496](https://github.com/Gerrrt/HomeLab/issues/1496)): + `ufw` is default-deny, with `22` admitting Hicks and the peers and nothing + else on this segment, the tunnel's port open, and `8800` open to the segment + only while a Debian or Kali template builds. Its Alloy pushes to `alexander` and not to Winterfell, and it gets no pass out of this segment: a rule from it into 99 would make it the bastion ADR-0002 and ADR-0012 declined. Everything diff --git a/docs/roadmap.md b/docs/roadmap.md index c5aceb7f..4ca848ef 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -99,14 +99,8 @@ Closes when it is empty. `smaug`.** Decided by [ADR-0114](adr/0114-rip-discs-on-smaug-with-makemkv-started-only-to-rip.md): deploy it, measure what capabilities it needs, and create the `5800` pass. -- **[#1496](https://github.com/Gerrrt/HomeLab/issues/1496) Close `phoenix`'s - way in.** Decided by - [ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md): - give every workstation that logs in a key, then run - [`build-the-jumpbox.md`](runbooks/build-the-jumpbox.md) §6a on the host. - First of these, because `phoenix` owns the lab domain. - -The rest of the milestone has no order between its issues. + +The milestone has no order between its issues. ## trinity diff --git a/docs/runbooks/build-the-jumpbox.md b/docs/runbooks/build-the-jumpbox.md index 2a2f8230..e12f5962 100644 --- a/docs/runbooks/build-the-jumpbox.md +++ b/docs/runbooks/build-the-jumpbox.md @@ -512,8 +512,9 @@ it for its own length - From a VLAN 30 host, `alexander` for example: `nc -zv -w 3 10.0.30.70 22` times out. - From a peer, with the tunnel up: the same `ssh` succeeds. - `ping -c 1 10.0.30.40` answers at `ttl=63`, which shows `phoenix` still - forwards. Then run [`open-the-remote-path.md`](open-the-remote-path.md) §8's + `ping -c 1 10.0.30.40` answers at `ttl=62`, which shows `phoenix` still + forwards. The reply comes back through `morpheus`'s route for the tunnel + subnet, so two routers decrement it. Then run [`open-the-remote-path.md`](open-the-remote-path.md) §8's negative tests, which must still be blocked and logged on `morpheus`. - On `phoenix`: §4's `curl` still lists the guests, and §7's Alloy checks still pass. Both are outbound, and `ufw` allows outbound. diff --git a/docs/runbooks/open-the-remote-path.md b/docs/runbooks/open-the-remote-path.md index 09c3a3b9..9238c46e 100644 --- a/docs/runbooks/open-the-remote-path.md +++ b/docs/runbooks/open-the-remote-path.md @@ -17,7 +17,8 @@ is read rather than skimmed > **Status — 2026-09-22: the tunnel is up, and it reaches the lab and nothing > else.** §0's record was created 2026-09-21; the tunnel came up the next day. > -> One peer, `laptop-01`, pinned to `172.31.0.2/32`. The endpoint is ADR-0044's +> One peer, the MacBook (`laptop-02` in [`network.md`](../network.md); its +> WireGuard profile is named `laptop-01`), pinned to `172.31.0.2/32`. The endpoint is ADR-0044's > dynamic DNS record, verified by resolving it against a public resolver from > `morpheus` itself and comparing to the live WAN address, which is stronger > than the typed check §0 used to ask for. #566 was closed first, on @@ -454,9 +455,12 @@ netstat -rn -f inet | grep utun # deny. The original version of this runbook told you to ping it, which always # failed, which is exactly what hid the forwarding bug in §3 for an afternoon. ping -c2 -t3 10.0.30.40 # alexander. macOS; use -W3 on Linux -# expect a reply at ttl=63, one below its default. That decrement is the proof -# that phoenix FORWARDED it rather than answering for itself, which is the only -# thing that distinguishes a working jumpbox from one that only reaches itself. +# expect a reply at ttl=62, two below its default. alexander answers through +# its default gateway, and morpheus's §5 route hands the reply to phoenix, so +# two routers decrement it (measured 2026-11-19; the 2026-09-22 build read 63). +# Anything below 64 shows phoenix FORWARDED it rather than answering for +# itself, which is the only thing that distinguishes a working jumpbox from one +# that only reaches itself. ``` ### The negative check, and why it needs the client widened diff --git a/docs/security.md b/docs/security.md index 273c7d58..b9302aec 100644 --- a/docs/security.md +++ b/docs/security.md @@ -17,7 +17,7 @@ What this network is actually built to survive: | A lost or stolen tunnel peer | **Accepted.** A WireGuard peer is a device with a key and no second factor ([ADR-0042](adr/0042-terminate-the-remote-path-on-the-lab-and-route-it.md)); the firewall, not the key, bounds what it reaches — the lab and nothing else — with a `/32` pin on the server and a preshared key per peer. Revocation is a `wg0.conf` edit on `phoenix` ([runbook](runbooks/open-the-remote-path.md#rollback)), proportionate at two or three devices and recorded as the thing that stops being so | | An attacker on the lab segment reaching the hypervisor's BMC | **Accepted.** `shiva` stays on VLAN 30 by decision ([ADR-0033](adr/0033-keep-the-ilo-on-the-lab-segment.md)), hardened on 2026-09-09 — IPMI-over-LAN, SSH and Federation off, and its one path out of the segment deleted; a BMC compromise in the lab costs the lab, and the tripwire watches what it initiates | | 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 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. Applied 2026-11-19 ([#1496](https://github.com/Gerrrt/HomeLab/issues/1496)): `sshd -T` reads `no` for password, keyboard-interactive and root login, and `22` from `alexander` times out | | 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 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 |