sops: decrypt on every Flux Kustomization + static guard

`spec.decryption` is opt-in per Flux Kustomization, and a secret-*.sops.yaml
under a tree without it is still valid YAML: Flux applies the Secret with
literal ENC[AES256_GCM,...] values and reports success. The Secret is green and
wrong, and the first symptom is an auth failure days later that looks nothing
like a git problem. Only `apps` and `monitoring` had the block; the other six
trees were a trap for the next person to add a Secret there.

- add decryption: {provider: sops, secretRef: sops-age} to cert-manager,
  databases, gateway-api-crds, infrastructure, logging and flux-system
  (8/8 Kustomizations now decrypt; harmless where no encrypted files exist)
- scripts/check-sops-decryption.py + `make check-sops`: static guard that reads
  the live sync path from gotk-sync.yaml, walks each Kustomization's kustomize
  resource graph, and fails when a *.sops.yaml file is under a tree whose owner
  cannot decrypt, is under no reconciled tree, or is not actually encrypted
  (also catches `flux bootstrap` regenerating gotk-sync.yaml without the block)
- .gitattributes marks *.sops.yaml with diff=sopsdiffer; docs/secrets-sops.md
  explains the opt-in trap, the eight Kustomizations and the guard

No secret contents, recipients or keys touched.
This commit is contained in:
Lance Walters 2026-11-27 00:57:31 -05:00
commit eea80f475e
10 changed files with 338 additions and 3 deletions

View file

@ -1,8 +1,13 @@
.PHONY: apply diff storage gateway
.PHONY: apply diff storage gateway check-sops
apply:
kubectl apply -k infrastructure/home
# Static guard: no secret-*.sops.yaml may sit in a tree whose Flux Kustomization
# cannot decrypt it (see docs/secrets-sops.md). No cluster or age key needed.
check-sops:
./scripts/check-sops-decryption.py
diff:
kubectl diff -k infrastructure/home