secrets: bring 29 hand-made cluster Secrets under Git via SOPS/age (audit F12) #45

Merged
sirius merged 1 commit from secrets/sops into master 2026-11-27 05:18:29 +00:00
Owner

Audit F12. Nothing in the cluster is reconciled from this repo: 67 hand-made Secrets, zero managed ones, so restoring this Git tree yields a cluster that will not start. This brings the first-party Secrets under Git as SOPS/age ciphertext and enables Flux's sops decryptor.

Provider decision: SOPS + age, one mechanism, no mixing. Flux already ships the sops decryptor, so there is no second controller or CRD to run, and the age private key is escrowed off-cluster (flux-system/sops-age in the cluster + /root/sops/homek8s-age.key on the Linode over the mesh). A SealedSecret would need the controller and a sealing key escrowed anyway — same single point of failure, more parts.

What is committed (29 Secrets, 7 namespaces)

apps/base/<ns>/secret-<name>.sops.yaml, encrypted_regex: ^(data|stringData)$ so names/namespaces stay reviewable:

ns secrets
forgejo forgejo-pg-app, forgejo-runner-amd64-token, forgejo-runner-deploy-arm64-token
siriusdevops siriusdevops-contact, garage-media-s3, forgejo-pull
piedmont piedmont-contact, forgejo-pull
sirius-growth contact, blog-app, blog-s3, portal-app, portal-db, portal-s3, portal-wal-s3, forgejo-pull
osint osint-admin, osint-db, forgejo-pull
metabase pg-app, metabase-admin, metabase-data-source-creds
customer1 pg-app, pg-users, odoo-config, odoo-admin, metabase-admin, metabase-data-source-creds, metabase-secret-key

Every file was generated from the live object and decrypts to a byte-identical data map and type, so the first apply is a no-op, not a rotation (verified 29/29).

Three things worth a reviewer's attention

  1. *-pg-app / pg-app / sirius-growth-portal-db are ours, not CNPG output. Each Cluster's bootstrap.initdb.secret.name points at one of them, so initdb reads the password from the Secret we create. Without them in git a rebuild has no application password and the Cluster never bootstraps. They are static (no rotation policy configured), so re-applying is a no-op.
  2. forgejo-pull is in git, which supersedes the "out of band (never in git)" wording in docs/registry-pull-auth.md from #43. Now that every workload carries imagePullSecrets: [forgejo-pull], it is the single Secret whose absence stops the whole cluster from pulling images — the exact failure this card exists to prevent. I updated that doc rather than leaving the two claims contradicting each other.
  3. .gitignore keeps **/*secret*.yaml ignored and re-includes only secret-*.sops.yaml, so a plaintext Secret still cannot be committed and age.agekey stays ignored.

Excluded on purpose (full table + reasons in docs/secrets-sops.md)

CNPG-issued *-server / *-replication / *-ca (ownerRef Cluster/*; committing them pins certs the operator overwrites), cnpg-system operator CA/webhook + barman TLS, cert-manager-webhook-ca, cilium/hubble certs (a stale copy wedges a Helm upgrade — the documented hubble-server-certs failure), sh.helm.release.v1.*, and the prometheus-operator's rendered prometheus-* / alertmanager-* objects.

Follow-up commit (same card) migrates monitoring's hand-made Secrets (grafana-admin, grafana-secret-key, alertmanager-telegram) and the three cluster-backup-ssh copies after the delete-and-reconcile drill proves the path.

Verification on merge

kubectl kustomize apps/home builds 29 Secrets with 104/104 data values as ENC[...]; token-shape scan over all 40 staged files: no hits.

Audit **F12**. Nothing in the cluster is reconciled from this repo: 67 hand-made Secrets, zero managed ones, so restoring this Git tree yields a cluster that will not start. This brings the first-party Secrets under Git as **SOPS/age ciphertext** and enables Flux's `sops` decryptor. **Provider decision: SOPS + age, one mechanism, no mixing.** Flux already ships the `sops` decryptor, so there is no second controller or CRD to run, and the age private key is escrowed off-cluster (`flux-system/sops-age` in the cluster + `/root/sops/homek8s-age.key` on the Linode over the mesh). A SealedSecret would need the controller *and* a sealing key escrowed anyway — same single point of failure, more parts. ## What is committed (29 Secrets, 7 namespaces) `apps/base/<ns>/secret-<name>.sops.yaml`, `encrypted_regex: ^(data|stringData)$` so names/namespaces stay reviewable: | ns | secrets | |----|---------| | forgejo | forgejo-pg-app, forgejo-runner-amd64-token, forgejo-runner-deploy-arm64-token | | siriusdevops | siriusdevops-contact, garage-media-s3, forgejo-pull | | piedmont | piedmont-contact, forgejo-pull | | sirius-growth | contact, blog-app, blog-s3, portal-app, portal-db, portal-s3, portal-wal-s3, forgejo-pull | | osint | osint-admin, osint-db, forgejo-pull | | metabase | pg-app, metabase-admin, metabase-data-source-creds | | customer1 | pg-app, pg-users, odoo-config, odoo-admin, metabase-admin, metabase-data-source-creds, metabase-secret-key | Every file was generated **from the live object** and decrypts to a byte-identical `data` map and `type`, so the first apply is a no-op, not a rotation (verified 29/29). ## Three things worth a reviewer's attention 1. **`*-pg-app` / `pg-app` / `sirius-growth-portal-db` are ours, not CNPG output.** Each Cluster's `bootstrap.initdb.secret.name` points at one of them, so `initdb` reads the password from the Secret we create. Without them in git a rebuild has no application password and the Cluster never bootstraps. They are static (no rotation policy configured), so re-applying is a no-op. 2. **`forgejo-pull` is in git**, which supersedes the "out of band (never in git)" wording in `docs/registry-pull-auth.md` from #43. Now that every workload carries `imagePullSecrets: [forgejo-pull]`, it is the single Secret whose absence stops the whole cluster from pulling images — the exact failure this card exists to prevent. I updated that doc rather than leaving the two claims contradicting each other. 3. **`.gitignore` keeps `**/*secret*.yaml` ignored** and re-includes *only* `secret-*.sops.yaml`, so a plaintext Secret still cannot be committed and `age.agekey` stays ignored. ## Excluded on purpose (full table + reasons in `docs/secrets-sops.md`) CNPG-issued `*-server` / `*-replication` / `*-ca` (ownerRef `Cluster/*`; committing them pins certs the operator overwrites), `cnpg-system` operator CA/webhook + barman TLS, `cert-manager-webhook-ca`, cilium/hubble certs (a stale copy wedges a Helm upgrade — the documented `hubble-server-certs` failure), `sh.helm.release.v1.*`, and the prometheus-operator's rendered `prometheus-*` / `alertmanager-*` objects. Follow-up commit (same card) migrates `monitoring`'s hand-made Secrets (`grafana-admin`, `grafana-secret-key`, `alertmanager-telegram`) and the three `cluster-backup-ssh` copies after the delete-and-reconcile drill proves the path. ## Verification on merge `kubectl kustomize apps/home` builds 29 Secrets with 104/104 data values as `ENC[...]`; token-shape scan over all 40 staged files: no hits.
Nothing in the cluster was reconciled from the repo: 67 hand-made Secrets and no
managed Secret at all, so a restore of this Git tree produced a cluster that would
not start. This commits the first-party ones as SOPS/age ciphertext and enables
Flux's sops decryptor.

* provider: SOPS + age (chosen over SealedSecrets: Flux already ships the sops
  decryptor, so no extra controller/CRD, and the age key is escrowed off-cluster).
* 29 Secrets across forgejo, siriusdevops, piedmont, sirius-growth, osint,
  metabase and customer1, as apps/base/<ns>/secret-<name>.sops.yaml with
  encrypted_regex ^(data|stringData)$ — names/namespaces stay reviewable.
* each file was generated from the LIVE object and decrypts to a byte-identical
  data map and type, so the first apply is a no-op (not a rotation).
* the CNPG bootstrap secrets (forgejo-pg-app, pg-app, sirius-growth-portal-db)
  are ours, not operator output — bootstrap.initdb.secret points at them, so a
  rebuild has no application password without them.
* forgejo-pull is included despite docs/registry-pull-auth.md calling it
  out-of-band: with imagePullSecrets on every workload it is the one Secret whose
  absence stops the whole cluster from pulling images.
* .gitignore keeps **/*secret*.yaml ignored and re-includes only .sops.yaml, so a
  plaintext Secret still cannot be committed; age.agekey stays ignored.
* excluded on purpose (controller/helm-owned): CNPG *-server/*-replication/*-ca,
  cnpg-system CA+webhook, cert-manager webhook CA, cilium/hubble certs, helm
  release records, prometheus-operator rendered prompts. Full table in
  docs/secrets-sops.md.

Key locations (never in git): Secret flux-system/sops-age (age.agekey) and
/root/sops/homek8s-age.key on the Linode, reached only over the mesh.
sirius merged commit 566834b5fb into master 2026-11-27 05:18:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
sirius/homek8s!45
No description provided.