A golden-render lint: no secret value or inline key may appear in the config repo #420

Closed
opened 2026-08-10 21:14:52 +00:00 by ben · 1 comment
Owner

Nothing inspects rendered output for values that must never ship. The dangerous literal class here is a secret baked into the config repo at eval time — exactly what gatewayEnvExports' comment warns against, and exactly one line away from frontdoor.go's deliberate files.ca = { secret = false; } (a public value embedded by design). The config repo is replicated to the operator app (ADR 0045), so a leak ships broadly. Reference: the mauke library's scripts/no-community-literals.sh, which greps for secret-shaped values with a written-reason ALLOW map.

Acceptance criteria

  • A go test (beside seedcommunity_eval_test.go's harness, no Nix needed): render a fixture community with known planted secret values, then scan the whole rendered tree for (a) those values, (b) secret-shaped strings — inline private-key blocks, long base64 outside a vars/ path, ssh-ed25519 AAAA inline keys.
  • Deliberate public values (the front-door ca) are excepted via an allow-list with a written reason per entry — an unexplained entry is how the guard rots.
  • The test fails loudly naming the offending rendered file and the matched shape.

Source: the clan-community (mauke reference fleet) lessons review, docs/research/2026-08-10-clan-community-lessons.md (lands on main this sitting), lesson 12.

Nothing inspects rendered output for values that must never ship. The dangerous literal class here is a **secret baked into the config repo at eval time** — exactly what `gatewayEnvExports`' comment warns against, and exactly one line away from `frontdoor.go`'s deliberate `files.ca = { secret = false; }` (a *public* value embedded by design). The config repo is replicated to the operator app (ADR 0045), so a leak ships broadly. Reference: the mauke library's `scripts/no-community-literals.sh`, which greps for secret-shaped values with a written-reason ALLOW map. **Acceptance criteria** - A `go test` (beside `seedcommunity_eval_test.go`'s harness, no Nix needed): render a fixture community with *known planted secret values*, then scan the whole rendered tree for (a) those values, (b) secret-shaped strings — inline private-key blocks, long base64 outside a `vars/` path, `ssh-ed25519 AAAA` inline keys. - Deliberate public values (the front-door `ca`) are excepted via an allow-list **with a written reason per entry** — an unexplained entry is how the guard rots. - The test fails loudly naming the offending rendered file and the matched shape. _Source: the clan-community (mauke reference fleet) lessons review, `docs/research/2026-08-10-clan-community-lessons.md` (lands on main this sitting), lesson 12._
Author
Owner

Landed in 17d6a8e on main.

A no-Nix go test beside the eval-smoke harness (internal/clan/secretlint_test.go):

  • renderGoldenFixtureTree seeds a fixture community and renders the richest tree founding produces, THROUGH the real render functions (never a mirror): the VM-guest baseline, a composed PRIVATE gateway (renderGatewayGuest + the private front-door TLS generator carrying files.ca), a composed PUBLIC own-VPS gateway (front door + self-hosted acme-dns), and every colocatable service surface (files, mail, chat, code, meetings, docs-editing, static sites).
  • scanConfigRepoForSecrets walks the whole tree for (a) known planted VALUES and (b) secret SHAPES — inline private-key blocks, inline SSH public keys (ssh-ed25519 AAAA & co), and long base64 blobs outside a vars/ path. An entropy gate keeps the blob detector off lowercase-hex git revs (clanCoreRev), base32 store hashes, and all-caps tokens; SRI hashes are skipped. A finding names the offending file AND the matched shape.
  • goldenRenderAllowList excepts deliberate public values (the front-door ca) with a WRITTEN REASON per entry; a blank reason fails TestGoldenRenderLint_AllowListEveryEntryCarriesAReason — an unexplained entry is how the guard rots.

Four tests, all green: the real tree carries no secret (the live guard), the scanner catches each planted value/shape and names the file, the reasoned allow entry suppresses its public value without blanket-silencing the shape elsewhere, and every allow entry carries a reason. go vet + golangci-lint clean; full internal/clan suite green; pre-push gate passed.

Landed in 17d6a8e on main. A no-Nix `go test` beside the eval-smoke harness (`internal/clan/secretlint_test.go`): - **`renderGoldenFixtureTree`** seeds a fixture community and renders the richest tree founding produces, THROUGH the real render functions (never a mirror): the VM-guest baseline, a composed PRIVATE gateway (`renderGatewayGuest` + the private front-door TLS generator carrying `files.ca`), a composed PUBLIC own-VPS gateway (front door + self-hosted acme-dns), and every colocatable service surface (files, mail, chat, code, meetings, docs-editing, static sites). - **`scanConfigRepoForSecrets`** walks the whole tree for (a) known planted VALUES and (b) secret SHAPES — inline private-key blocks, inline SSH public keys (`ssh-ed25519 AAAA` & co), and long base64 blobs outside a `vars/` path. An entropy gate keeps the blob detector off lowercase-hex git revs (`clanCoreRev`), base32 store hashes, and all-caps tokens; SRI hashes are skipped. A finding names the offending file AND the matched shape. - **`goldenRenderAllowList`** excepts deliberate public values (the front-door `ca`) with a WRITTEN REASON per entry; a blank reason fails `TestGoldenRenderLint_AllowListEveryEntryCarriesAReason` — an unexplained entry is how the guard rots. Four tests, all green: the real tree carries no secret (the live guard), the scanner catches each planted value/shape and names the file, the reasoned allow entry suppresses its public value without blanket-silencing the shape elsewhere, and every allow entry carries a reason. `go vet` + `golangci-lint` clean; full `internal/clan` suite green; pre-push gate passed.
ben closed this issue 2026-08-10 22:11:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#420
No description provided.