secret.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # App secrets (task 46). PLACEHOLDERS ONLY — never commit real values.
  2. #
  3. # Consumption: the Deployment and the migrate Job project every key below into
  4. # a tmpfs volume at `/run/secrets` (`defaultMode: 0400`, group 65532 via the
  5. # pod `fsGroup`) and read them through `*_FILE` variables, so no secret enters
  6. # the process environment (`/proc/self/environ`, children, crash dumps,
  7. # `docker inspect`):
  8. #
  9. # token-pepper -> D_OAUTH_TOKEN_PEPPER_FILE
  10. # totp-encryption-key -> D_OAUTH_TOTP_ENCRYPTION_KEY_FILE
  11. # database-password -> D_OAUTH_DATABASE__PASSWORD_FILE
  12. # redis-password -> D_OAUTH_REDIS__PASSWORD_FILE
  13. #
  14. # The passwordless DSNs (host/user/db/sslmode and the Redis address) are
  15. # non-secret and live in `configmap.yaml`; only the passwords are here. A
  16. # `kubectl exec` into a running pod therefore reads no credential from the
  17. # environment — only the 0400 files, which the container user already holds.
  18. # `scripts/check_manifests.py` fails the build if a workload injects any secret
  19. # through a `secretKeyRef` env instead.
  20. #
  21. # In-cluster Redis is expected to run with AUTH (`requirepass`); the password
  22. # is injected into the bare `redis://host:port` URL at connect time. A Redis
  23. # deployment without AUTH must enable it, or the workload fails closed on the
  24. # missing password file.
  25. #
  26. # Production rule: this file's keys are replaced by the secret manager
  27. # (external-secrets / sealed-secrets / vault agent). The manifests only ever
  28. # reference keys, never values; `scripts/check_manifests.py` fails the build
  29. # if a placeholder leaks outside this file, if a PEM block appears in any
  30. # manifest, or if a secret-shaped key lands in the ConfigMap.
  31. #
  32. # To provision: `kubectl create secret generic d-oauth-secrets -n d-oauth
  33. # --from-literal=database-password='...' --from-literal=redis-password='...'
  34. # ...` (or the external-secret equivalent), then delete this placeholder
  35. # file from the applied set.
  36. apiVersion: v1
  37. kind: Secret
  38. metadata:
  39. name: d-oauth-secrets
  40. namespace: d-oauth
  41. labels:
  42. app.kubernetes.io/name: d-oauth-server
  43. app.kubernetes.io/part-of: d-oauth
  44. type: Opaque
  45. stringData:
  46. # Postgres password, split out of the passwordless DSN in configmap.yaml.
  47. database-password: "REPLACE_ME__postgres-password"
  48. # Redis AUTH password, injected into the bare redis:// URL at connect time.
  49. redis-password: "REPLACE_ME__redis-password"
  50. # 256-bit server-side pepper for opaque-token hashing. Losing it invalidates
  51. # every live token; rotate per docs/OPERATIONS.md.
  52. token-pepper: "REPLACE_ME__32-bytes-of-random"
  53. # 256-bit key encrypting TOTP secrets at rest.
  54. totp-encryption-key: "REPLACE_ME__32-bytes-of-random"