diff --git a/README.md b/README.md index e6fa28d2..a143d5e8 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ documents for different readers. at all. Every pinned digest is also scanned weekly for fixable HIGH and CRITICAL CVEs, and each image with findings has an open issue until a scan finds it clean. -- **Documented decisions and runbooks.** 138 ADRs covering what was chosen +- **Documented decisions and runbooks.** 139 ADRs covering what was chosen and what was rejected — including the costs accepted knowingly; 57 runbooks for the operations that are easy to get wrong at 1am, one of which is the handover page a successor reads first. Every critical alert links to @@ -236,7 +236,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology │ ├── architecture.md network.md hardware.md │ ├── observability.md security.md roadmap.md changelog.md │ ├── diagrams/ # the network diagram (SVG) and its predecessors -│ ├── adr/ # 138 ADRs — architecture decision records +│ ├── adr/ # 139 ADRs — architecture decision records │ ├── exercises/ # purple-team exercise records — see its README │ └── runbooks/ # 57 runbooks; successor-handover.md is the front door └── Makefile # make help diff --git a/docs/adr/0138-keep-gerrrt-as-smaugs-administrator-account.md b/docs/adr/0138-keep-gerrrt-as-smaugs-administrator-account.md index 435292df..74f63e0c 100644 --- a/docs/adr/0138-keep-gerrrt-as-smaugs-administrator-account.md +++ b/docs/adr/0138-keep-gerrrt-as-smaugs-administrator-account.md @@ -5,6 +5,14 @@ whose fourth decision opened SSH on `smaug` for `frodo` "and nothing else", and whose context said the host has "no repository checkout" +> [!NOTE] +> **Two consequences below are amended, 2026-11-25.** `ClaudeCode2` has a +> use, the TrueNAS MCP server on the operator's Windows desktop, and stays. +> The NUT monitor password printed into a transcript on 2026-11-13 is not +> rotated. Both are +> [ADR-0139](0139-keep-the-mcp-servers-api-key-on-smaug.md)'s. The rest of +> this decision is unchanged. + ## Context ADR-0045 turned SSH on for one user, `frodo`, the backup pull's read-only diff --git a/docs/adr/0139-keep-the-mcp-servers-api-key-on-smaug.md b/docs/adr/0139-keep-the-mcp-servers-api-key-on-smaug.md new file mode 100644 index 00000000..6c0085a5 --- /dev/null +++ b/docs/adr/0139-keep-the-mcp-servers-api-key-on-smaug.md @@ -0,0 +1,55 @@ +# ADR-0139: Keep the TrueNAS MCP server's API key on `smaug`, and leave the NUT password that reached a transcript as it is + +**Status:** Accepted · 2026-11 · amends +[ADR-0138](0138-keep-gerrrt-as-smaugs-administrator-account.md), whose last +consequence said the `ClaudeCode2` key was to be revoked and whose second +said a value that reaches a transcript is rotated + +## Context + +The read-only audit of `smaug` on 2026-11-13 found an API key, `ClaudeCode2`, +on `truenas_admin`: created 2026-09-29, with no expiry, and named in no +document. ADR-0138, written when its use was not known, said no session in +`gerrrt` used it and that it was to be revoked. + +It has a use. The TrueNAS MCP server on the operator's Windows desktop holds +it and reaches `smaug`'s API with it. That is how the operator works with +`smaug` from the desktop. It is a separate path from `gerrrt`'s SSH and from +Claude Code running on `smaug`. + +The same audit printed the NUT monitor password into a session's transcript, +by a `midclt` read on 2026-11-13. ADR-0138 made rotating any such value the +rule. + +## Decision + +**1. `ClaudeCode2` stays, for the TrueNAS MCP server, with no expiry.** It is +the second administrative path to `smaug` besides `gerrrt`, and the one that +bypasses sudo: the key alone acts as `truenas_admin`, with `FULL_ADMIN`. +What limits it is the source address. The API is served on the UI's port, +and [`build-the-nas.md`](../runbooks/build-the-nas.md) §6.13's allowlist +admits Hicks alone. That the allowlist refuses the API as well as the UI has +not been tested from another segment: the box admits its own address, so a +test from `smaug` proves nothing. A host on CasaBonita is the test. + +**2. The NUT monitor password is not rotated.** It logs a subscriber in as +`secondary`, which reads the UPS's state and cannot command a shutdown, and +only the subscribing hosts reach the server's `3493`. ADR-0138's rule still +holds for every other value: a session reads secrets by existence and +permissions only, and a value that reaches a transcript is rotated unless a +decision like this one says otherwise. + +## Consequences + +- **Whoever holds `ClaudeCode2` holds `smaug`, from any Hicks address.** It + lives on the Windows desktop, in the MCP server's configuration. A + compromise of that desktop is a compromise of `smaug`, as it already was + through `gerrrt`'s key and the `desktop-02` pass. Revoking the key under + *Credentials → API Keys* ends the path at once. If the MCP server's use + ends, revoke the key with it. +- **The NUT password stays in the transcript and in `erebor/apps`'s + snapshots** until the transcript is deleted and the snapshots age out, and + in the conversation's copy off the estate. The operator accepts that. +- **A future audit will find both and should not raise them again.** It + should check that the key is still the only one, still on `truenas_admin`, + and still used. diff --git a/docs/security.md b/docs/security.md index 7a9b52f9..e66a9599 100644 --- a/docs/security.md +++ b/docs/security.md @@ -34,7 +34,7 @@ What this network is actually built to survive: | A rooted range target reaching `gandalf` itself | **Dropped at `vmbr1`, before the host firewall.** The host has no address on the range bridge, but Linux answers ARP for its addresses on any interface and accepts a packet for them on any interface. So a target that adds an on-link route to `10.0.30.30` was reaching the host, and only the Proxmox firewall dropped it. `gandalf`'s own `pve-firewall-state` collector watches that firewall now ([ADR-0126](adr/0126-monitor-gandalf-now-that-it-stays-on.md), [#1651](https://github.com/Gerrrt/HomeLab/issues/1651)). A netdev `ingress` table on `vmbr1` now drops every frame the bridge passes up to the host, ARP included, without touching guest-to-guest traffic ([`build-the-playground.md`](runbooks/build-the-playground.md) §2, proved by §8 check four). Behind it, `gandalf` holds no estate credential, no GitHub login, no personal tooling and no third-party apt repository (§4, *Nothing else on `gandalf`*), so the host gives nothing beyond itself. The audits of 2026-11-13 and 2026-11-22 found credentials, then tooling and two third-party repositories. The credentials were gone by 2026-11-22 and the `.claude` footprint by 2026-11-23. **The `vmbr1` table is applied (verified live).** Root's SSH key is Proxmox's node key; the audit found it had reached github, so it was regenerated fresh on 2026-11-23, minutes after a too-broad deletion that day briefly broke self-SSH ([changelog](changelog.md)). The new key is not one github recognises, so no host credential reaches the repository — revoking the old key on github, if it was ever a deploy key, is off-host | | Someone on Winterfell or Hicks logging in to `trinity` | **Key-only `sshd` since 2026-11-20; no host firewall by decision.** `trinity` holds the household's data and the sensitive tier's age key, and its `sshd` answers Hicks (by [ADR-0031](adr/0031-narrow-hicks-to-a-named-list-on-winterfell-and-leave-the-lab-open.md)'s list) and every host on VLAN 99, between which pfSense never filters. [`build-the-sensitive-tier-host.md`](runbooks/build-the-sensitive-tier-host.md) §3 now makes `sshd` key-only through a drop-in that outranks cloud-init's, refuses root and X11 forwarding, and keeps `authorized_keys` to `prometheus`'s key and Hicks's. The audit of 2026-11-13 found it taking passwords, with X11 forwarding on and 17 keys imported from GitHub. The step was applied on 2026-11-20: a password-only login is refused with `Permission denied (publickey)`, and three keys remain, `prometheus`'s, Hicks's and the operator's laptop, the last kept by decision. Agent sessions run on `trinity` as the operator, by decision ([ADR-0123](adr/0123-keep-agent-sessions-on-trinity.md)). `ufw` is installed and stays disabled, unlike `phoenix`'s ([ADR-0117](adr/0117-give-phoenix-a-key-only-sshd-and-a-default-deny-inbound-policy.md)): the other two ports `trinity` answers, `443` and `53`, are published by Docker, whose rules run ahead of `ufw`'s, so a policy would govern `22` alone, which the drop-in already closes to anything without a key. Nothing routes through `trinity`, and as the spare firewall a host policy is one more thing to get in the way the day it stands in for `morpheus`. What reaches `443` and `53` is set by pfSense and by the stack's bind addresses | | Someone on Winterfell or Hicks logging in to `prometheus` | **Key-only `sshd` since 2026-11-23; no host firewall by decision.** `prometheus` holds the estate's CA key and the age key that opens every volume backup set, and converge runs as the operator, who is in `sudo` and `docker`. Its `sshd` answers all of Hicks (by `morpheus`'s pass for `22` to the segment) and every host on VLAN 99. The audit's root-only reads on 2026-11-23 found it taking passwords, with X11 forwarding on and `ufw` inactive. [ADR-0128](adr/0128-give-prometheus-a-key-only-sshd-and-no-host-firewall.md) makes `sshd` key-only through a drop-in that outranks cloud-init's, refusing root and X11 forwarding ([`restore-the-stack.md`](runbooks/restore-the-stack.md#make-sshd-key-only)). It adds no host firewall, because Docker's rules run ahead of `ufw`'s for the published ports, so a policy would cover `22` alone. Those ports stay fenced as before: by `morpheus` by destination, by the ingest proxy's tokens on `9090` and `3100`, and on `6514` by the syslog listener's pinned client certificate and its sender list. The step was applied the same day. `sshd -T` read `no` for all four settings, a password login and a keyboard-interactive login were each refused with `Permission denied (publickey)`, and a key login from Hicks succeeded after the reload. | -| Someone on Hicks or Winterfell logging in to `smaug` | **Key-only `sshd` since 2026-11-24.** `smaug` holds the household's media and the `erebor` pool. Two hosts reach its `22`, each by a host-scoped pass on `morpheus` ([`network.md`](network.md)): `prometheus`, as the read-only backup user `frodo`, and `desktop-02` on Hicks, as the administrator `gerrrt`. From 2026-11-13 `gerrrt` logged in by password, allowed both on the user and in the SSH service's *Password Login Groups*, while the documents said `frodo` was the only user. Both settings were cleared in the TrueNAS UI on 2026-11-24. `sshd_config` then had no `Match` block left, and a connection as `gerrrt` or `root` was offered `publickey` alone. `gerrrt` is kept by [ADR-0138](adr/0138-keep-gerrrt-as-smaugs-administrator-account.md): `FULL_ADMIN` and sudo for all commands, with the password asked every time, and a checkout of this repository that can neither push nor decrypt. Its key and its password together are root on `smaug`; that is the residual. | +| Someone on Hicks or Winterfell logging in to `smaug` | **Key-only `sshd` since 2026-11-24.** `smaug` holds the household's media and the `erebor` pool. Two hosts reach its `22`, each by a host-scoped pass on `morpheus` ([`network.md`](network.md)): `prometheus`, as the read-only backup user `frodo`, and `desktop-02` on Hicks, as the administrator `gerrrt`. From 2026-11-13 `gerrrt` logged in by password, allowed both on the user and in the SSH service's *Password Login Groups*, while the documents said `frodo` was the only user. Both settings were cleared in the TrueNAS UI on 2026-11-24. `sshd_config` then had no `Match` block left, and a connection as `gerrrt` or `root` was offered `publickey` alone. `gerrrt` is kept by [ADR-0138](adr/0138-keep-gerrrt-as-smaugs-administrator-account.md): `FULL_ADMIN` and sudo for all commands, with the password asked every time, and a checkout of this repository that can neither push nor decrypt. Its key and its password together are root on `smaug`; that is the residual. [ADR-0139](adr/0139-keep-the-mcp-servers-api-key-on-smaug.md) keeps `ClaudeCode2`, an API key on `truenas_admin` with no expiry, which the TrueNAS MCP server on the operator's Windows desktop uses. The key alone is `FULL_ADMIN` over the API. The UI allowlist is meant to limit it to Hicks, which has not been tested from CasaBonita. | | Someone with the trusted Wi-Fi key quietly joining | Kea's lease log reaches Loki; `UnknownDeviceOnTrustedSegment` fires the first time a MAC appears on VLAN 50 in seven days ([ADR-0019](adr/0019-read-device-joins-from-the-dhcp-server.md)) | | Losing visibility of a failure | 215 alert rules, 30 days of metrics and logs | | Someone on a reachable VLAN silencing an alert to hide a failure | Alertmanager binds to `127.0.0.1`; silences go through authenticated Grafana |