Secret Management

Where secrets should live, the GitOps challenge, and modern secret-rotation patterns.

Overview

Why secret management matters

Secrets are credentials that grant access: API keys, database passwords, TLS private keys, OAuth tokens, encryption keys. Improper secret management is one of the most common causes of security incidents.

A sound setup has four moving parts. A secret store is the source of truth. Runtime injection, through an SDK or a sidecar, hands each secret to the running service. Automated rotation replaces secrets and writes the new values back to the store. Scanning at commit, in CI and at runtime watches for leaks, and a leak it finds triggers a rotation.

> [!IMPORTANT] Assume every secret will eventually leak. Rotate so a leaked credential stops working quickly.

Key concepts

  • Cloud secret stores
  • HashiCorp Vault
  • Sealed Secrets
  • External Secrets Operator
  • Dynamic secrets
  • Secret scanning

Interview questions

  • How do you handle secrets in a Kubernetes + GitOps deployment?
  • What is "dynamic secrets" and why is it powerful?
  • A secret was committed to a public repo. Walk me through the response.

Sign up free to read the full topic

More SRE topics

Start free on Cariara · Coding problems · System design studio