CC secrets build: consumers switched to sec, S19 age key in the recovery runbooks, evidence (R-1118, R-1122)
gates / gates (push) Successful in 6m44s

Build skill (hub token, ISO publish), fb_probe (token from `sec run` env, tests red-proved), secrets.md (Resend:
pipe inside sec run), bench README, read_credential docstring, 12-agent-tooling §5, workspace CLAUDE secrets line.
Evidence: audits/cc-creds-build-2026-10-17/ (tests, red-proofs, 36-row child-session proof both launch modes,
install, fresh-session proof, import names+lengths, history sweep names).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-17 13:33:07 +02:00
1 parent 498b9139cf
commit ba40c0a25b
39 files changed
+681 -39

No files matched your search

@@ -51,6 +51,7 @@ from the printed `data` field (hub-DB runbook Step 0 note) — `key show` cannot
| S8 | Hetzner account: login e-mail · password · two-factor recovery codes | — | ______________________________________________________ |
| S11 | Cloudflare account: login · password · two-factor recovery codes | — | ______________________________________________________ |
| S12 | Gmail `felhom.eu@gmail.com`: password · two-factor recovery codes | — | ______________________________________________________ |
| S19 | CC secrets age key — opens `admin/cc-secrets` (every secret Claude Code uses on DooPlex); the store is in Gitea, behind S1 | recipient `age1aw83ej37x9sck89xwt856ry0553kf5sng3w544an4et54yjdx5qq79utrv` | `AGE-SECRET-KEY-1`______________________________________ |
| S3 | Vaultwarden master password — **in your head**; write it here only if you decide to | — | ______________________________________________________ |
**Not secret, needed with the keys:**
+12 -10
View File
@@ -32,18 +32,19 @@ as Secrets created imperatively with the commands below.
### Create / rotate the Secret
The key is available as the `RESEND_API` env var in `kisfenyo`'s shell on the build host
(192.168.0.180). It is exported from `~/.bashrc`, so it is present in an **interactive** shell
(`bash -ic`) but **not** in a plain non-interactive `ssh host 'cmd'`.
The key is `RESEND_API` in the CC secret store on the build host (192.168.0.180) — used only through `sec`
(`admin/cc-secrets`, `ARCHITECTURE.md`; since 2026-10-17). The old `export RESEND_API=…` in `~/.bashrc` is being
retired (R-1119).
Create (or update) the Secret without ever echoing the value — render the Secret YAML in the
(non-sudo) interactive shell where `$RESEND_API` is set, and pipe it into `sudo kubectl apply`:
Create (or update) the Secret without ever echoing the value. **The pipe into `kubectl apply` must be INSIDE
`sec run`:** `sec run` masks its own output, so YAML piped OUT of it would carry `«RESEND_API»` instead of the key
(measured 2026-10-17: inside the pipe the key arrived intact by length and hash; outside, the mask). `--from-file`
keeps the value off kubectl's command line:
```bash
# on 192.168.0.180, as kisfenyo:
bash -ic 'kubectl create secret generic resend-api -n felhom-system \
--from-literal=RESEND_API_KEY="$RESEND_API" \
--dry-run=client -o yaml' | sudo kubectl apply -f -
sec run --file RESEND_API -- sh -c 'kubectl create secret generic resend-api -n felhom-system \
--from-file=RESEND_API_KEY="$RESEND_API_FILE" --dry-run=client -o yaml | sudo kubectl apply -f -'
```
Then roll the consumers so they pick up the new value:
@@ -62,7 +63,8 @@ sudo kubectl -n felhom-system rollout status deploy/hub deploy/contact-mailer -
### Rotating away from a compromised key (ordered — load-bearing)
1. Create the **new** send-scoped key in Resend; store it out-of-band; set `RESEND_API` on host 180.
1. Create the **new** send-scoped key in Resend; store it out-of-band; on host 180 put it in the CC store from a 0600
file: `sec put RESEND_API --from-file F` (F is shredded).
2. Run the create-Secret + rollout above with the new value.
3. Update Gmail "Send mail as" SMTP password to the new key.
4. **Verify every consumer sends on the new key** (above) — do this **before** step 5.
@@ -156,7 +158,7 @@ Not k8s Secrets — PBS's own private files on DooPlex, never in git:
| File | Holds | Created |
|---|---|---|
| `/etc/proxmox-backup/remote.cfg` (root:backup 0640) | ep0 API token `root@pam!dooplex-sync` (base64, PBS format) | from the token's one-time output, file → file |
| `/etc/proxmox-backup/notifications-priv.cfg` (root:root 0600) | the Resend API key, as the SMTP password of target `felhom-operator` | from `$RESEND_API`, file → file |
| `/etc/proxmox-backup/notifications-priv.cfg` (root:root 0600) | the Resend API key, as the SMTP password of target `felhom-operator` | from `sec run --file RESEND_API`, file → file |
**Rotating the Resend key (§ above) must also rewrite `notifications-priv.cfg`**, or the ep0-copy failure mails stop
silently. Rotate the ep0 token with `proxmox-backup-manager user generate-token` on ep0 (delete the old) and rewrite
@@ -50,6 +50,7 @@ local restic repos; Prometheus history; DooPlex's other homelab apps (not Felhom
| S16 | The hub operator password | the hub UI | the restored hub DB (hash); Vaultwarden — NOT `~/.config/credentials` any more (operator-only since 2026-10-15, `09` §3 decision 251; CC holds the scoped token `HUB_TOKEN` there instead, which a restored hub DB keeps as its hash) | no, after S2 (+S3) |
| S17 | Authentik admin | SSO for Vaultwarden and DooPlex apps | Authentik's DB (Longhorn on DooPlex, local PostgreSQL dumps only) | **yes** — not in any copy; Vaultwarden does not need it (password login) |
| S18 | Households' recovery codes, PBS keys, restic passwords | households' restores | the households / escrow / the boxes | not the operator's |
| S19 | **CC secrets age key** (`~/.config/sops/age/keys.txt` on DooPlex, 0600; public recipient `age1aw83ej37x9sck89xwt856ry0553kf5sng3w544an4et54yjdx5qq79utrv`) | opening `admin/cc-secrets` `store/cc.sops.yaml` — every secret CC uses (`sec`; `cc-secrets/ARCHITECTURE.md`) | DooPlex; Vaultwarden „CC secrets age key" (operator, 2026-10-17); the encrypted store itself is in Gitea (behind S1) | no, after S1 + S3 — unless also on the break-glass sheet |
## The order of steps (new hardware)
@@ -118,6 +118,9 @@ R-96 incident record (committed 2026-07-27) — rationale, not directives.
>
> **Never write secrets** — tokens, passwords, private keys, API keys — into `CHANGELOG.md`,
> `REPORT.md`, or any committed file. Reference them as "stored out-of-band" instead.
>
> **Secrets: `sec`.** CC uses a secret only through `sec` (`sec run NAME -- <command>`; there is no „get"), see
> `cc-secrets/ARCHITECTURE.md` in this workspace. Never `source` or `cat` a credentials file.
## Live validation — no browser here