secret.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # App secrets (task 46). PLACEHOLDERS ONLY — never commit real values.
  2. #
  3. # Consumption: the Deployment and the migrate Job
  4. # project `token-pepper` and `totp-encryption-key` from this Secret into a
  5. # tmpfs volume at `/run/secrets` (`defaultMode: 0400`, group 65532 via the
  6. # pod `fsGroup`) and read them through `D_OAUTH_TOKEN_PEPPER_FILE` /
  7. # `D_OAUTH_TOTP_ENCRYPTION_KEY_FILE`, so the key material never enters the
  8. # process environment. `database-url` and `redis-url` are still injected as
  9. # `secretKeyRef` environment variables.
  10. #
  11. # Production rule: this file's keys are replaced by the secret manager
  12. # (external-secrets / sealed-secrets / vault agent). The manifests only ever
  13. # reference keys, never values; `scripts/check_manifests.py` fails the build
  14. # if a placeholder leaks outside this file, if a PEM block appears in any
  15. # manifest, or if a secret-shaped key lands in the ConfigMap.
  16. #
  17. # To provision: `kubectl create secret generic d-oauth-secrets -n d-oauth
  18. # --from-literal=database-url='postgres://...' ...` (or the external-secret
  19. # equivalent), then delete this placeholder file from the applied set.
  20. apiVersion: v1
  21. kind: Secret
  22. metadata:
  23. name: d-oauth-secrets
  24. namespace: d-oauth
  25. labels:
  26. app.kubernetes.io/name: d-oauth-server
  27. app.kubernetes.io/part-of: d-oauth
  28. type: Opaque
  29. stringData:
  30. # Full Postgres URL. Production requires `sslmode=verify-full`.
  31. database-url: "REPLACE_ME__postgres-url-with-sslmode-verify-full"
  32. # Redis single-topology URL (no password embedded for cluster use; prefer
  33. # the password-file mechanism when auth is enabled).
  34. redis-url: "REPLACE_ME__redis-url"
  35. # 256-bit server-side pepper for opaque-token hashing. Losing it invalidates
  36. # every live token; rotate per docs/OPERATIONS.md.
  37. token-pepper: "REPLACE_ME__32-bytes-of-random"
  38. # 256-bit key encrypting TOTP secrets at rest.
  39. totp-encryption-key: "REPLACE_ME__32-bytes-of-random"