Old ~/.config/credentials deleted on the operator's go (R-1134 closed); R-1130 accepted; R-1138 for its two backup copies (176 rows)
gates / gates (push) Successful in 7m0s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
2026-10-17 14:40:49 +02:00
parent e281de37c0
commit d4ce52e1bb
13 changed files with 108 additions and 11 deletions
@@ -0,0 +1,25 @@
# Names and MATCH / MISSING / DIFFERENT for each old backup copy of the credentials file. Never a value.
import glob, os, re, sys
sys.path.insert(0, "/mnt/5_hdd/felhom.eu/git/cc-secrets")
from ccsec import store
vals = store.load_all()
for f in sorted(glob.glob(os.path.expanduser("~/.config/credentials.bak-*"))):
st = os.stat(f); out = []; total = 0
for n, line in enumerate(open(f, encoding="utf-8").read().split("\n"), 1):
s = line.strip()
if not s or s.startswith("#"):
continue
m = re.match(r"^(export\s+)?([A-Za-z_][A-Za-z0-9_-]*)=(.*)$", s)
if not m:
out.append("line %d: not KEY=VALUE (%d chars)" % (n, len(s))); continue
total += 1
name = m.group(2).replace("-", "_")
try:
v = store.unwrap(m.group(3), "line %d" % n)
except store.StoreError:
out.append("%s: cannot unwrap" % name); continue
if vals.get(name) != v:
out.append("%s: %s" % (name, "MISSING from store" if name not in vals else "DIFFERENT from store (an older value?)"))
print("=== %s: %d bytes, mode %o, %d keys; not matching the store: %s" % (os.path.basename(f), st.st_size, st.st_mode & 0o777, total, "none" if not out else ""))
for o in out:
print(" " + o)
@@ -0,0 +1,24 @@
# Before deleting ~/.config/credentials (operator's go, 2026-10-17): every key in it must be in the store with an equal
# value. Compares in memory; prints names and MATCH / MISSING / DIFFERENT only, never a value.
import os, re, sys
sys.path.insert(0, "/mnt/5_hdd/felhom.eu/git/cc-secrets")
from ccsec import store
vals = store.load_all()
bad = 0
lines = open(os.path.expanduser("~/.config/credentials"), encoding="utf-8").read().split("\n")
for n, line in enumerate(lines, 1):
s = line.strip()
if not s or s.startswith("#"):
continue
m = re.match(r"^(export\s+)?([A-Za-z_][A-Za-z0-9_-]*)=(.*)$", s)
if not m:
print("line %d: NOT a KEY=VALUE line (%d chars)" % (n, len(s))); bad += 1; continue
name = m.group(2).replace("-", "_")
try:
v = store.unwrap(m.group(3), "line %d" % n)
except store.StoreError as e:
print("line %d %s: cannot unwrap (%s)" % (n, name, e)); bad += 1; continue
state = "MATCH" if vals.get(name) == v else ("MISSING" if name not in vals else "DIFFERENT")
bad += state != "MATCH"
print("%-24s %s" % (name, state))
print("lines %d, problems %d" % (len(lines), bad))
@@ -0,0 +1,4 @@
=== credentials.bak-20261001-calibre: 1081 bytes, mode 600, 17 keys; not matching the store:
HUB_TOKEN: DIFFERENT from store (an older value?)
=== credentials.bak-20261016-tester1: 1196 bytes, mode 600, 19 keys; not matching the store:
TESTER1_PASSWORD: DIFFERENT from store (an older value?)
@@ -0,0 +1,24 @@
HETZNER_API MATCH
PASSWORD MATCH
TS_KEY MATCH
HUB_TOKEN MATCH
ISO_S3_CLIENT_AK MATCH
ISO_S3_CLIENT_SK MATCH
ISO_S3_URL MATCH
R_DEMO_FELHOM MATCH
R_DEMO_HP MATCH
R_C11_REWALK MATCH
R_PART4 MATCH
DOCKER_USERNAME MATCH
DOCKER_PASSWORD MATCH
DEMO_HP_BOOKSTACK_USER MATCH
DEMO_HP_BOOKSTACK_PW MATCH
DEMO_HP_CALIBRE_USER MATCH
DEMO_HP_CALIBRE_PW MATCH
TESTER1_PASSWORD MATCH
TESTER4_PASSWORD MATCH
UMAMI_CC_USER MATCH
UMAMI_CC_PW MATCH
DEV_BASIC_AUTH_USER MATCH
DEV_BASIC_AUTH_PW MATCH
lines 24, problems 0
+2
View File
@@ -43,6 +43,8 @@
| **R-1120** | **`homelab-manifests/.claude/settings.json` allowed `kubectl get secret -o yaml` with no prompt.** (P3) | CLOSED 2026-10-17 — operator yes (STOP 3 b). Three `ask` rules (`kubectl get secret* -o*`, `*--output*`, `*--template*`) in homelab-manifests `9f582ad`. Proven in headless child sessions with only these permission rules: `-o yaml`, `-ojson`, `--output=yaml` held, the plain table ran. Second layer: the user-level guard. | `audits/cc-creds-build-2026-10-17/homelab-ask-pattern-test.txt` |
| **R-1131** | **demo-felhom's recovery code was printed into the JARR session's record (2026-10-17 08:27 UTC, `. ~/.config/credentials`).** (P3) | CLOSED 2026-10-17 — ACCEPTED by the operator (STOP 3 c): a test box, no rotation. The command shape is refused by the guard since 13:14. | `audits/cc-creds-build-2026-10-17/history-sweep-list.txt` |
| **R-1132** | **demo-hp's recovery code was printed in the same record line as R-1131.** (P3) | CLOSED 2026-10-17 — ACCEPTED by the operator (STOP 3 c): a test box, no rotation. | as R-1131 |
| **R-1130** | **`DOCKER_PASSWORD` (the Docker Hub password; Gitea refuses it) is in one old CC session record (2026-09-21).** (P3) | CLOSED 2026-10-17 — ACCEPTED by the operator (D15 „keep"): no rotation. Facts measured first: Docker Hub login succeeded, `gitea.dooplex.hu` 401, `~/.docker/config.json` saves the same Hub login. | `audits/cc-creds-build-2026-10-17/docker-login-test.txt` |
| **R-1134** | **Retire the old `~/.config/credentials`.** (P3) | CLOSED 2026-10-17 — DELETED (`shred -u`) on the operator's go, after an in-memory check that all 23 keys in it equal the store (0 problems). Its nameless line 20 was a separator between the Felhom and JARR passwords; the operator removed it first. Two older backup copies found beside it → R-1138. | `audits/cc-creds-build-2026-10-17/old-file-compare.txt` |
## 2026-10-17 — Tester 1 on the live catalog, decoy suites in every runner, memory limits, FileBrowser (controller v0.326.0, catalog `bff82f9`)
+2 -3
View File
@@ -211,7 +211,7 @@ stopping line that lies.
| **R-1094** | Storage & devices | P4 | **The whole-disk format refusal tells the household to format the free part — which is refused while the other part is in use.** SEEN 2026-10-16 (controller 0.318.0): 409 „Ezen a lemezen egy használatban lévő meghajtó van, ezért a teljes lemez nem formázható. Csak a szabad részét formázhatod." — since agent 0.158.1 a part next to a mounted part can only be USED (the root wrapper trusts no „Felhom's own" claim). Evidence: `audits/storage-identity-buildB-2026-10-15/live/14-samedisk-refusal-offer.txt`. | READY | — | Reword `err.web.meghajto_hasznalatban_formazas` (hu + en): „… nem formázható. A szabad részét használatba veheted." Next controller release; the copy gates run. | CC |
| **R-1124** | Storage & devices | P4 | **A drive decommissioned and then unplugged keeps its agent mount unit enabled on the host** (`mnt-<name>.mount`, „Managed by felhom-agent”, `WantedBy=multi-user.target`), so every later boot waits for a device that is gone, and the agent's watchdog reports it „disconnected”. Decommission retires the drive logically (agent: „logical retire, data untouched”) and releases only the guest bind; no product path releases the host mount or forgets the drive. Seen on Tester 1 at the R-1022 teardown 2026-10-17 (four units left; the boot delay is read from the unit, NOT measured). | OPEN — filed 2026-10-17 **2026-10-17 (later):** on Tester 1 the four units were disabled and removed by hand (read before and after, `audits/filebrowser-memory-ci-2026-10-17/P4/`); the agent did not write them back, but it still lists the four drives and logs „enrolled drive absent by UUID — will retry” every ~20 s. The product fix (decommission releases the host mount and lets the agent forget an absent drive) is an agent change — it waits for the next vouched agent release. | — | Decide „forget a decommissioned drive” (unit disabled + removed when the drive is absent), with a test | CC |
## Security & access — 22 rows (P1 1, P2 2, P3 13, P4 6)
## Security & access — 21 rows (P1 1, P2 2, P3 12, P4 6)
| ID | Category | Sev | What | State | Blocked on | Next action | Owner |
|---|---|---|---|---|---|---|---|
@@ -234,9 +234,8 @@ stopping line that lies.
| **R-1054** | Security & access | P3 | **The hub's operator/global API key is still one bearer that can do everything on `/api/v1`, including reading every box's break-glass root password (`GET /admin/hosts/{id}/recovery-credential`).** Hub v0.152.0 gave the web surface scoped tokens (`05` §17) but tokens are refused on `/api/v1` by design. Who uses the global key today is not listed in one place. Fix: list its consumers; move each operator use to a scoped token on the web side (or a token class on the API), and keep the global key only where a box path needs it — or retire it. | OPEN — filed 2026-10-15 by the token build | — | List the global key's consumers (pod env, scripts, runbooks) | CC |
| **R-1118** | Security & access | P3 | **CC's secrets moved off the plain `~/.config/credentials` into an encrypted store with a broker and guards; what is left is retiring the old file.** BUILT 2026-10-17 (store B, operator ruling 11:28): private repo `admin/cc-secrets` (`ARCHITECTURE.md`, the design verbatim in `docs/`), `sec` (no get), PreToolUse refusals + PostToolUse masking for Bash and Read in `~/.claude/settings.json` (every CC session on DooPlex), nightly transcript sweep with mail. 55 tests, 18 red-proofs, 36-row child-session proof in both launch modes, fresh-session proof (`audits/cc-creds-build-2026-10-17/`). 25 names in the store (23 imported, `RESEND_API` from CC's environment, a self-test value). `12-agent-tooling.md` §5 points at it. | NARROWED — built; the old file's retirement is R-1134 | the week with no reader (R-1134) | `sec doctor` stays all OK; R-1134 | CC |
| **R-1121** | Security & access | P3 | **`~/rotated-secrets-2026-10-09.txt` still exists on DooPlex** — 632 bytes, modified 2026-10-09 13:08 +0200, mode 600 (SPIKE Q6: `test -e` + `stat` only, not opened). Left by the R-925 rotation work. If any value in it is still valid, it is one more plaintext secrets file in the home folder, readable by every CC session. | WAITING-ON-OPERATOR | what the file holds — only the operator knows | Operator: confirm every value in it is revoked, then `shred -u` it; or move the live ones into the R-1118 store | operator |
| **R-1130** | Security & access | P3 | **`DOCKER_PASSWORD` is the Docker Hub password of the account `DOCKER_USERNAME`, and it is in one old CC session record** (a helper-agent transcript of 2026-09-21, `~/.claude/projects/-mnt-5-hdd-felhom-eu-git/5f83c0fb…/subagents/agent-a8614eb6ee2a17e6c.jsonl`; first history sweep 2026-10-17). **What it opens, measured 2026-10-17** with a throwaway `DOCKER_CONFIG` (nothing saved): Docker Hub `Login Succeeded`; `gitea.dooplex.hu` **401** (as on 2026-10-08 and 10-10). `~/.docker/config.json` (0600) holds saved logins for Docker Hub — the SAME password (sha256 prefix equal) — and for `gitea.dooplex.hu` (a different 32-character password, 5-character user). Evidence `audits/cc-creds-build-2026-10-17/docker-login-test.txt`. Nothing rotated. | WAITING-ON-OPERATOR | the operator's decision after these facts | Operator: rotate the Docker Hub password or accept; if rotated, `sec put DOCKER_PASSWORD --from-file F` and re-login the saved config | operator |
| **R-1133** | Security & access | P3 | **`~/.git-credentials` on DooPlex holds Gitea tokens in clear text** — three entries (`kisfenyo`, `Kisfenyo`, `admin`); the `admin` token has `write:repository` (and misc, package, issue, notification). Any `cat` of it prints them; the new PreToolUse guard refuses reads of that path (`read-secret-file`), but git itself must keep reading it. Out of the 2026-10-17 build's scope by its brief. **Same class:** `~/.docker/config.json` holds two saved registry logins (Docker Hub, `gitea.dooplex.hu`) as base64 — R-1130; the guard does not list that path yet. | OPEN | — | Decide: move git to a credential helper that reads from `sec`, or accept the file (0600) with the guard | operator → CC |
| **R-1134** | Security & access | P3 | **Retire the old `~/.config/credentials`**: every named key is in the CC store since 2026-10-17 13:16 (23 imported; the hyphenated names became `R_DEMO_FELHOM`, `R_DEMO_HP`). The operator added `FACEBOOK_API`, `TUYA_ID`, `TUYA_SECRET`, `TUYA_DEVICE_ID_N100`, `TUYA_DEVICE_ID_HP` to the store the same day; each passed a real read-only call through `sec run` (fb_probe `read`: page, feed, insights ok, token „from environment (sec run)"; Tuya cloud status: both plugs `success`, 18 items). **Open:** its line 20 is a 32-character value with NO name — its sha256 prefix matches NO stored value (`TUYA_SECRET` included; `audits/cc-creds-build-2026-10-17/line20-compare.txt`), so the operator names it. | WAITING-ON-OPERATOR | the operator names line 20; a week with no reader (from 2026-10-17) | 2026-10-24: check no reader (sweep + `hook.log`); then rename the file to `.retired`; delete only on the operator's go | operator → CC |
| **R-1138** | Security & access | P3 | **Two old plain copies of the deleted credentials file remain: `~/.config/credentials.bak-20261001-calibre` (17 keys) and `~/.config/credentials.bak-20261016-tester1` (19 keys)**, both 0600. Compared 2026-10-17 in memory (names only, `audits/cc-creds-build-2026-10-17/old-backups-compare.txt`): every key equals the store except one OLDER value each — `HUB_TOKEN` in the 10-01 copy, `TESTER1_PASSWORD` in the 10-16 copy (both since changed). Found when the operator's go deleted the main file (R-1134); not deleted, because the go named „the file". | WAITING-ON-OPERATOR | the operator's word | Operator: „delete them" → `shred -u` both; or keep | operator |
## Box system & updates — 12 rows (P2 1, P3 7, P4 4)
@@ -47,7 +47,7 @@ local restic repos; Prometheus history; DooPlex's other homelab apps (not Felhom
| S13 | Domain registrar(s) for `felhom.eu`, `dooplex.hu`; No-IP (`dooplex.hopto.org`, the home address CNAME) | moving DNS / the home address | the operator; Vaultwarden | — |
| S14 | Resend account / API key | all mail | Secrets export (S1+S5); Vaultwarden; the Resend dashboard (re-mint) | no — re-mint at Resend |
| S15 | Gitea admin password; registry credentials (`gitea-creds`) | Gitea UI; image push/pull | the restored Gitea DB (password hash) + Vaultwarden; the Secrets export | no, after S1 (+S3) |
| 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) |
| S16 | The hub operator password | the hub UI | the restored hub DB (hash); Vaultwarden — never in CC's store (operator-only since 2026-10-15, `09` §3 decision 251; CC holds the scoped token `HUB_TOKEN` in its secret store (S19) 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 |