Bookmarks

Secrets management

The discipline and tools for securely storing and issuing sensitive data: passwords, API tokens, encryption keys and certificates.

Also: secret management, secret store, secrets manager

checked 9 Nov

All terms

A database password, a payment gateway token, a signing key — all of these are secrets: a leak of any one of them gives an attacker access to the system. Secrets management gathers them out of code, configuration files and notes into a single store with access control, auditing and replacement rules.

What counts as a secret

TypeExamples
Service credentialsa database connection string, an API key for an external service
Tokens and certificatesa JWT signing secret, a TLS certificate for an internal service
Cryptographic keysa backup encryption key, an image signing key
Infrastructure accessan SSH private key, cloud provider credentials

How a secrets store works

Secrets live in a dedicated store — for example HashiCorp Vault, AWS Secrets Manager or a cloud KMS. An application, a service or a CI job receives its secrets at runtime rather than at build time: it authenticates to the store and requests only what it is allowed to — the principle of least privilege. The store delivers the value over a secure channel and keeps a log of who read what and when.

Rotation and dynamic secrets

Long-lived secrets are replaced periodically — rotation limits the damage from a leak: the old value stops working. Stores can also issue dynamic secrets: temporary credentials that are created on demand and revoked automatically when their lifetime expires. For a database, for example, you can issue a login and password valid for an hour instead of a permanent password baked into the configuration. In Kubernetes, a common technique is a sidecar container: it authenticates to the store, writes a fresh secret to a shared volume and refreshes it periodically, without the main application knowing anything about it.

Where secrets must never end up in code

  • in the repository — a value committed to Git stays there forever, even after it is removed from the history;
  • in a container image layer — a layer can be downloaded from the registry and inspected without starting the container;
  • in CI and application logs — a log is often visible to a wider audience than it seems;
  • in a shared environment variables file that is copied between projects.

Instead, the secret is supplied at runtime — from the store or by injection into the process environment. Secret scanners look for keys that accidentally end up in a repository, but a secret found by a scanner is still considered compromised and replaced.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • KMSkey management service

    A KMS stores cryptographic keys and performs encryption operations; secrets management is broader — it also covers passwords, tokens and certificates.

  • PAMprivileged access management

    PAM grants people access to privileged accounts on request and records their sessions; secrets management deals with service credentials.

In depth in the references

where the topic is covered in detail