diff --git a/SECURITY.md b/SECURITY.md index c91892de..bd36c992 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -39,12 +39,12 @@ is a very different thing from an overlooked one. Full detail in | What | Status | | --- | --- | | A used server arrived with Intel AMT enabled on the factory-default credential | Found 2026-09-16 on `smaug`, the ThinkServer TS150 of [#413](https://github.com/Gerrrt/HomeLab/issues/413), during the pre-build firmware pass: the MEBx accepted Intel's default `admin`, so no password had ever been set, and `Manageability Feature Selection` read `Enabled`. The ME network name and domain were blank, which is evidence it had never been provisioned rather than proof. **Closed the same day and before the host carried anything**: a new ME password, `Unconfigure Network Access` → `Full Unprovision` while the feature was still enabled, then the feature disabled, verified by the `` prompt no longer being offered at boot. Disabled rather than hardened, unlike `shiva` under [ADR-0033](docs/adr/0033-keep-the-ilo-on-the-lab-segment.md): that BMC serves a headless hypervisor in a rack, where a remote console earns its keep; this is a tower with a monitor beside it, and an out-of-band plane on the segment with the televisions buys it nothing. The general lesson is the one [`hardware.md`](docs/hardware.md) already records for the CRS326 — a second-hand device arrives carrying whatever its last owner left on it, and the management plane is the part nobody thinks to look at. | -| SNMP community committed in plaintext, shared across firewall, switch, UPS and BMC | Removed from `HEAD` and replaced with four distinct per-device SOPS-encrypted values. Rotated on all four devices; each answers to its own new community. The firewall, the UPS and the BMC additionally refuse the old one — and **neither the BMC nor the UPS card answers a community at all any more**, both being polled over SNMPv3 authPriv with SNMPv1 switched off and the former community proved refused, the BMC on 2026-09-20 and the card on 2026-09-21 ([#85](https://github.com/Gerrrt/HomeLab/issues/85)). Two of the four values this row is about are therefore retired rather than rotated. **The switch serves GETBULK to any short community without checking, so whether it still holds the previous one is unverified** — see below. The original shared string has been purged from git history, though it must still be treated as public — it was reachable in a public repository and cannot be un-seen. | +| SNMP community committed in plaintext, shared across firewall, switch, UPS and BMC | Removed from `HEAD` and replaced with four distinct per-device SOPS-encrypted values. Rotated on all four devices; each answers to its own new community. The firewall, the UPS and the BMC additionally refuse the old one — and **neither the BMC nor the UPS card answers a community at all any more**, both being polled over SNMPv3 authPriv with SNMPv1 switched off and the former community proved refused, the BMC on 2026-09-20 and the card on 2026-09-21 ([#85](https://github.com/Gerrrt/HomeLab/issues/85)). Two of the four values this row is about are therefore retired rather than rotated. **The switch's copy closed on 2026-11-05 by the hardware leaving, not by a measurement:** the MokerLink served GETBULK to any short community without checking, so whether it still held this original string was never measured, and the CRS326 that replaced it has no enabled v2c community. The 2026-11-07 refusal test below is of the later per-device value, not this one — see below. The original shared string has been purged from git history, though it must still be treated as public — it was reachable in a public repository and cannot be un-seen. | | The pfSense and MokerLink SNMP communities, in local Claude Code session transcripts | Found 2026-09-21, at the moment it happened: a command inspecting one auth block printed the whole of `snmp-exporter/.rendered/snmp.yaml`, whose redaction covered the `password` fields and not the `community` ones, putting both live v2c values into this repository's session transcript and a cached tool-result file. A value-level sweep of `~/.claude/projects` found them in a third file as well — a session from an unrelated project, which predates 2026-09-21 and makes the exposure older than the command that revealed it. All three were redacted in place and set to mode 600, and a re-sweep finds nothing. Never committed, never synced, never off the host. **Deliberately not rotated.** The MokerLink's value retires with the hardware within days, on the reasoning the row below already sets out; the firewall's stays, its blast radius being what the *SNMPv2c* section of [`docs/security.md`](docs/security.md) describes for a poll that never leaves Winterfell. The two SNMPv3 devices were unaffected — their four passphrases were checked individually against every file under `~/.claude/projects` and appear in none. | | Grafana `admin`/`admin` with anonymous Admin access enabled | Fixed — anonymous auth off, password from SOPS | | Passphrase-encrypted TLS private keys under `certificates/` | Removed from `HEAD` and purged from history. A new CA and leaf have been generated with [`scripts/gen-certs.sh`](scripts/gen-certs.sh); the old keys are superseded and should be treated as compromised wherever they were ever trusted. | | Decrypted secrets in editor undo files, written by `make secrets-edit` | Found 2026-08-20: three files under `~/.local/state/nvim/undodir/` holding the live pfSense, APC and iLO SNMP communities in plaintext, mode 664. Shredded. `make secrets-edit` now hardens `$EDITOR` before handing it plaintext, so it cannot recur. Never committed and never left the host, so those three communities were not rotated on that basis. | -| Alertmanager webhook URL and the MokerLink SNMP community, in a local Claude Code session transcript | Found 2026-08-20 by a value-level sweep of the host. Redacted in place; mode 600, never committed or synced. The webhook topic was rotated — on the public ntfy instance the topic name *is* the credential, there is nothing to revoke — and delivery re-verified end to end. The switch community deliberately was not: rotating it means the `neo` residual above all over again. **That reasoning is spent, and this value now retires with the hardware.** The overwrite it was afraid of was done on 2026-09-12 and persisted, and the MokerLink is being replaced by a switch commissioned with SNMP v2c off entirely — so what retires this community is not a fresh community but the absence of one. The thing that must not be carried across is any value the MokerLink held, passphrases included. **Retired 2026-11-05**, when the CRS326 replaced it with no v2c community at all and v3 passphrases generated fresh ([#444](https://github.com/Gerrrt/HomeLab/issues/444)); the switch section above has the proof. | +| Alertmanager webhook URL and the MokerLink SNMP community, in a local Claude Code session transcript | Found 2026-08-20 by a value-level sweep of the host. Redacted in place; mode 600, never committed or synced. The webhook topic was rotated — on the public ntfy instance the topic name *is* the credential, there is nothing to revoke — and delivery re-verified end to end. The switch community deliberately was not: rotating it means the `neo` residual above all over again. **That reasoning is spent, and this value now retires with the hardware.** The overwrite it was afraid of was done on 2026-09-12 and persisted, and the MokerLink is being replaced by a switch commissioned with SNMP v2c off entirely — so what retires this community is not a fresh community but the absence of one. The thing that must not be carried across is any value the MokerLink held, passphrases included. **Retired 2026-11-05**, when the CRS326 replaced it with no enabled v2c community and v3 passphrases generated fresh ([#444](https://github.com/Gerrrt/HomeLab/issues/444)); the switch section above has the proof. | | Pre-purge objects still served by GitHub after the history rewrite | The 2026-08-19 rewrite (`021d2b6`) removed both secrets above from every *reachable* commit, but GitHub still serves the orphaned objects by SHA. Verified 2026-08-26: `647d90a`, `21afcad`, `efb2632` and `ee3d443` all still resolve through the API, and the tree at `21afcad` still lists `certificates/Gandalf.Gondor.Lab/ca-key.pem` and `cert-key.pem`. Garbage collection requested from GitHub Support on 2026-08-26 — **pending**; this is the [purge runbook](docs/runbooks/purge-git-history.md)'s *Afterwards* step, and it is the last one outstanding. The repository has no forks and a network count of 0, so nothing else is perpetuating them. Both credentials were rotated *before* the rewrite, so this changes nothing about their status: the old keys and the old community remain superseded and must still be treated as public. Re-check with `gh api repos/Gerrrt/HomeLab/commits/647d90a --jq .sha` — a `404` means GitHub has collected them. | | Alertmanager published on `0.0.0.0`, letting anyone who could reach it silence an alert | Fixed 2026-08-30 — 9093 now binds to `127.0.0.1` ([#70](https://github.com/Gerrrt/HomeLab/issues/70), [ADR-0012](docs/adr/0012-publish-only-ports-with-an-off-host-consumer.md)). This was the sharpest of the three because a silence switches off monitoring and the record of it lives in the system being switched off. Nothing off-host ever used the port: silences are reached through Grafana, which proxies Alertmanager over the compose network behind a login, so closing it cost no capability. | | Prometheus and Loki published on `0.0.0.0` with no authentication | Fixed — [#182](https://github.com/Gerrrt/HomeLab/issues/182), [ADR-0067](docs/adr/0067-authenticate-the-ingest-ports-with-a-token-per-client.md). Until then anything that could route to `10.0.99.20:9090` or `:3100` could read every metric and log line, inject metrics through the remote-write receiver, and delete log ranges through Loki's delete API, with firewall default-deny as the whole control. Prometheus and Loki now publish on `127.0.0.1` only. The host's address on both ports is an ingest proxy that serves a push to one token per agent (`oracle`, `trinity`, `Saruman`), a query to one reader token (Glance, Home Assistant, the deploy script's arrival check), and the admin and delete APIs to nobody. `IngestAuthNotEnforced` pages if the published address ever answers a token-less request with anything but the proxy's 401. The tokens no longer cross the wire in cleartext: both ports serve TLS under the estate CA, and every client verifies it ([#764](https://github.com/Gerrrt/HomeLab/issues/764), [ADR-0086](docs/adr/0086-serve-the-ingest-ports-over-tls-under-the-estate-ca.md)). **One thing remains, deliberately:** loopback is unauthenticated, because a local user on the monitoring host already holds the SOPS key. The firewall still narrows who can try: Winterfell (99) itself and `Saruman`'s one pass from `10.0.30.20`. | @@ -71,7 +71,8 @@ that lets only `10.0.99.20` reach UDP/161 on the switch, with the replacement as the fix. The replacement is a MikroTik CRS326-24G-2S+RM on RouterOS 7.24.6, under the -same name and address. It has no v2c community at all: SNMP is v3 authPriv for +same name and address. It has no enabled v2c community (RouterOS's default +`public` row cannot be removed, so it is there and disabled): SNMP is v3 authPriv for one user, `prometheus` (SHA/AES), and the agent answers only `10.0.99.20`. The passphrases were generated fresh at the bench on 2026-10-05; nothing the MokerLink held was carried across, so the community that leaked on 2026-08-20 diff --git a/docs/security.md b/docs/security.md index a10b246c..f1bd74bd 100644 --- a/docs/security.md +++ b/docs/security.md @@ -819,7 +819,7 @@ repository must be treated as compromised: | What | Where | Status | | --- | --- | --- | -| SNMP community shared across all four devices | `snmp.yaml`, from commit `ee3d443` (now rewritten) | Purged from history. Replaced with four distinct per-device values, SOPS-encrypted. Rotated on all four. `morpheus`, `mjolnir` and `shiva` verified answering the new community and refusing the old. `neo` answers the new one; whether it still holds the previous one is **unverified**, not confirmed. Its agent serves GETBULK to any community of sixteen characters or fewer without consulting the table (measured 2026-09-12), which is what the 2026-09-06 and 2026-09-09 sightings of the old string and the stock `public` and `private` actually were; those measurements are withdrawn. Over GET, which it does check, both stock strings and a junk string were refused — the previous community's row was the one thing never measured, because that string was purged from history and is not to hand. **Closed 2026-11-05:** the MokerLink left service as `neo`, and the CRS326 that replaced it has no v2c at all ([`SECURITY.md`](../SECURITY.md), [#444](https://github.com/Gerrrt/HomeLab/issues/444)). The MokerLink was factory-reset before it was reused as a plain switch at U14, which cleared its table (reported by the owner, 2026-11-07) | +| SNMP community shared across all four devices | `snmp.yaml`, from commit `ee3d443` (now rewritten) | Purged from history. Replaced with four distinct per-device values, SOPS-encrypted. Rotated on all four. `morpheus`, `mjolnir` and `shiva` verified answering the new community and refusing the old. `neo` answers the new one; whether it still holds the previous one is **unverified**, not confirmed. Its agent serves GETBULK to any community of sixteen characters or fewer without consulting the table (measured 2026-09-12), which is what the 2026-09-06 and 2026-09-09 sightings of the old string and the stock `public` and `private` actually were; those measurements are withdrawn. Over GET, which it does check, both stock strings and a junk string were refused — the previous community's row was the one thing never measured, because that string was purged from history and is not to hand. **Closed 2026-11-05:** the MokerLink left service as `neo`, and the CRS326 that replaced it has no enabled v2c community; RouterOS's default `public` row cannot be removed and is disabled ([`SECURITY.md`](../SECURITY.md), [#444](https://github.com/Gerrrt/HomeLab/issues/444)). The MokerLink was factory-reset before it was reused as a plain switch at U14, which cleared its table (reported by the owner, 2026-11-07) | | Grafana `admin` / `admin` with anonymous Admin access | compose file | Fixed: password from SOPS, anonymous auth disabled | | Decrypted secrets in editor undo files | `~/.local/state/nvim/undodir/`, written by `make secrets-edit` | Found 2026-08-20: three files holding the live pfSense, APC and iLO SNMP communities in plaintext, mode 664, on an unencrypted disk. Shredded. `make secrets-edit` now hardens the editor first, so it cannot recur. Never committed, never left the host, so the communities were not rotated on that basis | | Alertmanager webhook URL and the MokerLink SNMP community | a local Claude Code session transcript under `~/.claude/projects/` | Found 2026-08-20 by a value-level sweep of the host. Redacted in place; mode 600, never committed or synced. The webhook was rotated because it is a one-line regenerate; the switch community was not, because rotating it means the `neo` residual below all over again. That reasoning is spent — the overwrite it was afraid of was done on 2026-09-12 and persisted — and the value retires with the MokerLink hardware, which is replaced by a switch commissioned with v2c off entirely; no value the MokerLink held is carried across. **Retired 2026-11-05**, when the CRS326 took over; the MokerLink was factory-reset before its reuse as a plain switch (owner's report, 2026-11-07) | diff --git a/stacks/observability/snmp-exporter/generator.yaml b/stacks/observability/snmp-exporter/generator.yaml index 2afd8da5..0b6fb5dd 100644 --- a/stacks/observability/snmp-exporter/generator.yaml +++ b/stacks/observability/snmp-exporter/generator.yaml @@ -76,7 +76,8 @@ auths: # neo moved on 2026-11-05 (#444): the CRS326 replaced the MokerLink, and its # v3 user was created at the bench on 2026-10-05 with the agent limited to - # 10.0.99.20 and no v2c community at all (ADR-0041 decision 4). + # 10.0.99.20 and no enabled v2c community (ADR-0041 decision 4). RouterOS's + # default community row cannot be removed; it is disabled. auth_neo: community: "" username: prometheus