Skip to content

Commit 933355d

Browse files
Gerrrtclaude
andauthored
fix(backup): the age-key proof has no deadline and no alert (ADR-0120) (#1592)
SecretsKeyBackupUnproven and SecretsKeyRecipientsUnrecorded are removed with their tests, verify-key-backup and verify-key-backup-sensitive leave install-timers.sh, and Glance stops listing the proof. The stale-job rules and ScheduledJobNeverRan skip both names so an older homelab-jobs.prom stays quiet. make secrets-verify-backup stays as an optional check. Closes #671. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent fcf3fa4 commit 933355d

23 files changed

Lines changed: 275 additions & 668 deletions

‎Makefile‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -503,9 +503,9 @@ recipient-state: ## Record which age recipients can open the secrets, and when e
503503
@# Reads the recipient list out of the encrypted file's own metadata and
504504
@# writes one series per recipient into the textfile dir, carrying every
505505
@# existing proof timestamp forward and setting none. Needs no key: the
506-
@# `sops:` block is plaintext. This is what SecretsKeyBackupUnproven reads;
507-
@# without it a host that proved its key before ADR-0024 has no series and
508-
@# the ninety-day nag is silent. secrets-verify-backup is what sets a proof.
506+
@# `sops:` block is plaintext. No alert reads it since ADR-0120; it is the
507+
@# recipient list remove-recipient.sh checks against. secrets-verify-backup
508+
@# is what sets a proof.
509509
./scripts/key-recipients.sh --record --stack $(STACK)
510510

511511
.PHONY: ca-key-state
@@ -741,15 +741,11 @@ secrets-verify-backup: ## Check a backup age key decrypts the secrets (KEY=/path
741741
printf 'See docs/runbooks/back-up-the-age-key.md\n' >&2; \
742742
exit 2; \
743743
}
744-
@# Wrapped, even though a human runs it, and that is the whole point of #77.
745-
@# This is the one job that cannot be put on a timer — verify-key-backup.sh
746-
@# refuses the live key by device:inode precisely so that what gets tested is
747-
@# a copy on removable media, and no timer can mount that. So the schedule is
748-
@# enforced from the other end: a successful run records its timestamp, and
749-
@# SecretsKeyBackupUnproven fires when that proof passes ninety days old.
750-
@# Nagging is not as good as running it, but it beats remembering.
751-
@# STACK=sensitive records verify-key-backup-sensitive, trinity's row in
752-
@# install-timers.sh: a job name may be declared on one host only.
744+
@# Optional since ADR-0120: run it when you want to know a copy of the key
745+
@# still opens the secrets. Nothing waits for it and no alert fires if it
746+
@# is never run. verify-key-backup.sh refuses the live key by device:inode,
747+
@# so what gets tested is a copy. Wrapped so the run is still recorded;
748+
@# STACK=sensitive records it as verify-key-backup-sensitive.
753749
./scripts/run-scheduled.sh --job verify-key-backup$(if $(filter sensitive,$(STACK)),-sensitive) --lock keys \
754750
-- ./scripts/verify-key-backup.sh "$(KEY)" $(STACK)
755751

‎README.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ documents for different readers.
101101
can't run an agent (firewall, switch, UPS, iLO). One agent config, deployed
102102
identically everywhere. [How](docs/architecture.md#observability-data-flow)
103103
- **Dashboards and alerting as code.** 8 provisioned dashboards, 156 panels, and
104-
185 alert rules — 164 metric-based in Prometheus, 21 log-based in Loki — sharing
104+
183 alert rules — 162 metric-based in Prometheus, 21 log-based in Loki — sharing
105105
one Alertmanager routing tree. No dashboard exists only in a database.
106106
- **Secrets encrypted in-repo with SOPS + age.** Per-device credentials,
107107
decrypted at deploy time into gitignored paths, with `git log` showing which
@@ -136,7 +136,7 @@ documents for different readers.
136136
at all. Every pinned digest is also scanned weekly for fixable HIGH and
137137
CRITICAL CVEs, and each image with findings has an open issue until a scan
138138
finds it clean.
139-
- **Documented decisions and runbooks.** 119 ADRs covering what was chosen
139+
- **Documented decisions and runbooks.** 120 ADRs covering what was chosen
140140
and what was rejected — including the costs accepted knowingly; 55
141141
runbooks for the operations that are easy to get wrong at 1am, one of which
142142
is the handover page a successor reads first. Every critical alert links to
@@ -207,7 +207,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology
207207
.
208208
├── stacks/
209209
│ ├── observability/ # the estate's stack on prometheus — ten services
210-
│ │ ├── prometheus/ # config, file_sd targets, 164 alert rules
210+
│ │ ├── prometheus/ # config, file_sd targets, 162 alert rules
211211
│ │ ├── alertmanager/ # routing and inhibition
212212
│ │ ├── loki/ # single-binary config + 21 LogQL rules
213213
│ │ ├── alloy/ # the agent config directory, shipped to every host
@@ -236,7 +236,7 @@ inbound passes may still reach it. Data flow and the maintained Mermaid topology
236236
│ ├── architecture.md network.md hardware.md
237237
│ ├── observability.md security.md roadmap.md changelog.md
238238
│ ├── diagrams/ # the network diagram (SVG) and its predecessors
239-
│ ├── adr/ # 119 ADRs — architecture decision records
239+
│ ├── adr/ # 120 ADRs — architecture decision records
240240
│ ├── exercises/ # purple-team exercise records — see its README
241241
│ └── runbooks/ # 55 runbooks; successor-handover.md is the front door
242242
└── Makefile # make help
@@ -320,9 +320,11 @@ $ make help
320320
The timers are what stop `backup`, `backup-firewall`, `snmp-verify` and now
321321
deployment itself being things someone has to remember, and the alert rules that come with them fire on a
322322
job having *stopped being run* rather than only on one that failed
323-
([#77](https://github.com/Gerrrt/HomeLab/issues/77)). One job deliberately has no
324-
timer: `secrets-verify-backup` needs a human to mount removable media, so it gets
325-
a ninety-day deadline and an alert instead. See
323+
([#77](https://github.com/Gerrrt/HomeLab/issues/77)). The human proofs that need
324+
removable media, such as `certs-verify-backup`, have no timer and get a
325+
ninety-day deadline and an alert instead. `secrets-verify-backup` is optional
326+
and has no deadline
327+
([ADR-0120](docs/adr/0120-drop-the-age-key-proof-deadline.md)). See
326328
[`docs/runbooks/schedule-maintenance.md`](docs/runbooks/schedule-maintenance.md).
327329

328330
## Dashboards

‎docs/adr/0024-hold-a-second-age-recipient-and-prove-each-one-separately.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
**Status:** Accepted · 2026-09
44

55
> [!NOTE]
6+
> **No proof deadline, 2026-11-20.**
7+
> [ADR-0120](0120-drop-the-age-key-proof-deadline.md) removes part 3's
8+
> ninety-day deadline and `SecretsKeyBackupUnproven`. Proving a copy is
9+
> optional and still recorded per recipient. Parts 1 and 2 are unchanged.
10+
>
611
> **The second recipient also opens the household's copy, 2026-10-01.**
712
> [ADR-0073](0073-carry-the-household-copy-on-a-drive-the-holder-keeps.md)
813
> adds it to `stacks/sensitive/household.recipients` as the fallback behind
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# ADR-0120: Drop the age-key proof deadline
2+
3+
**Status:** Accepted · 2026-11 · amends [ADR-0024](0024-hold-a-second-age-recipient-and-prove-each-one-separately.md)
4+
5+
## Context
6+
7+
[ADR-0024](0024-hold-a-second-age-recipient-and-prove-each-one-separately.md)
8+
part 3 gave every age recipient its own ninety-day proof. A human mounts an
9+
offline copy of the key, runs `make secrets-verify-backup`, and
10+
`SecretsKeyBackupUnproven` fires for any recipient whose last proof is older
11+
than that. `SecretsKeyRecipientsUnrecorded` was added later (#400) for a host
12+
that declared the deadline and had no per-recipient series. #1501 extended the
13+
deadline to `trinity` as `verify-key-backup-sensitive`.
14+
15+
Neither key has ever been proved on `trinity`, and the operator does not
16+
intend to start. A trinity audit on 2026-11-20 raised the proofs again. The
17+
operator's position is that recurring offline and off-site key drills are too
18+
much for a home lab. They also rule out bringing in anyone outside the family
19+
as a technical second to hold or check a copy. An alert that is never acted on is noise, and it trains
20+
the operator to ignore the channel the real alerts arrive on.
21+
22+
## Decision
23+
24+
**The age-key proof has no deadline and no alert.**
25+
26+
- `verify-key-backup` leaves `JOBS` and `verify-key-backup-sensitive` leaves
27+
`SENSITIVE_JOBS` in `scripts/install-timers.sh`.
28+
- `SecretsKeyBackupUnproven` and `SecretsKeyRecipientsUnrecorded` are removed
29+
from `backup.rules.yaml`, with their tests.
30+
- The Glance maintenance page stops listing the age-key proof.
31+
- `ScheduledJobStale`, `ScheduledJobStaleCritical` and `ScheduledJobNeverRan`
32+
skip both names. A host whose `homelab-jobs.prom` predates this change then
33+
stays quiet until `make install-timers` rewrites it. `ScheduledJobFailed`
34+
skips them too: a failed optional check is on the screen of whoever ran it.
35+
36+
**`make secrets-verify-backup` stays, as an optional check.** It still proves
37+
that a copy opens the secrets, and it still records which recipient was
38+
checked. Nothing waits for it.
39+
40+
**`recipient-state` stays.** It still writes `key-recipients.prom` daily.
41+
`remove-recipient.sh` reads the recipient list from that file, and keeping it
42+
current costs nothing.
43+
44+
**Unchanged:** ADR-0024 parts 1 and 2 (the second recipient, and how one is
45+
added) and `check_sops_rules.py`'s rule that a stack guarding data has two
46+
recipients. The CA key's proof (`CaKeyBackupUnproven`, ADR-0043), the off-site
47+
copy (`OffsiteCopyStale`, ADR-0048) and the household copy
48+
(`HouseholdCopyStale`, ADR-0073) are also unchanged. Each has its own deadline
49+
and is a separate decision.
50+
51+
## Consequences
52+
53+
- A lost or corrupted offline key copy is found only when someone goes to use
54+
it. The operator accepts that.
55+
- One reason for `recipient-state` is gone. The timer stays for the file it
56+
writes.
57+
- Proving a copy is still possible and is still recorded, so a later decision
58+
to bring the deadline back is a timer row and a rule, not new tooling.

‎docs/changelog.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,29 @@ roadmap as it read that day, and the *Done* entries keep the shape they had
1717
there. `check_docs.py` does not check this file, for the reason its module
1818
docstring gives: it is a record, not a claim about now.
1919

20+
## 2026-11-20
21+
22+
- **The age-key proof has no deadline and no alert.**
23+
[ADR-0120](adr/0120-drop-the-age-key-proof-deadline.md) amends ADR-0024 part
24+
3. `SecretsKeyBackupUnproven` and `SecretsKeyRecipientsUnrecorded` are
25+
removed with their tests, which takes the Prometheus rules from 164 to 162.
26+
`verify-key-backup` and `verify-key-backup-sensitive` leave `install-timers.sh`'s
27+
tables, and the Glance maintenance page stops listing them.
28+
- **Optional.** `make secrets-verify-backup` still checks a copy and records
29+
which recipient it checked.
30+
- **Kept.** `recipient-state` still writes `key-recipients.prom` daily, for
31+
`remove-recipient.sh`.
32+
- **Old declarations stay quiet.** The stale-job rules,
33+
`ScheduledJobNeverRan` and `ScheduledJobFailed` skip both names. A host whose `homelab-jobs.prom`
34+
predates this change is therefore quiet until `make install-timers`
35+
rewrites the file.
36+
- **Unchanged.** The CA key, off-site and household deadlines.
37+
- **#671 closes.** Its remaining step was proving the lab key's second
38+
recipient. Its section, *Saruman: the domain, then the SOC*, leaves the
39+
roadmap empty.
40+
- **This reverses part of the 2026-11-14 entry.** That entry added
41+
`verify-key-backup-sensitive` (#1501). The row is gone again.
42+
2043
## 2026-11-19
2144

2245
- **`phoenix`'s own way in is closed: `sshd` takes keys only, and `ufw` is

0 commit comments

Comments
 (0)