Articles

What Is Secrets Management?

Secrets management stores API keys, passwords, and certificates in a dedicated system instead of config files, with access control, rotation, and audit logs.

Chisato Chisato · · 4 min read
A shield icon representing digital security

Secrets management is the practice of storing sensitive credentials — API keys, database passwords, TLS certificates, encryption keys, OAuth tokens — in a dedicated system built for that purpose, rather than scattered across config files, environment variables, or source code. A secrets manager centralizes where secrets live, controls who and what can read them, and handles the operational work of rotating and auditing them over time.

The problem it solves

The default, unmanaged way to handle credentials is to put them in a .env file, a config file checked into a repository, or a plaintext environment variable set on a server. Every one of those approaches has the same failure mode: the secret is now sitting somewhere it can be accidentally committed to Git, copied into a log line, leaked in a stack trace, or read by anyone with filesystem access to that server. Once a secret leaks this way, there’s usually no record of who read it or when — you often only find out after it’s been misused.

A secrets manager addresses this by making secrets something applications fetch at runtime through an authenticated API call, rather than something baked into a deployment artifact or configuration file. The secret only exists in memory, briefly, wherever it’s actually being used.

What a secrets manager actually provides

  • Centralized storage, usually encrypted at rest, so secrets aren’t duplicated across a dozen config files that all need updating when a value changes.
  • Access control — fine-grained policies determine which applications, services, or people can read which secrets, following the same principle as RBAC or ABAC for any other resource.
  • Audit logging of every access, so a security team can answer “who read this secret, and when” after the fact — critical for incident response.
  • Rotation, ideally automatic — periodically issuing a new credential and retiring the old one, which shrinks the window in which a leaked secret is still valid. Some integrations rotate database passwords or cloud credentials on a schedule without any human intervention.
  • Dynamic secrets in more advanced setups — instead of a long-lived static password, the secrets manager issues a short-lived credential on demand, scoped to a single request or session, and it expires automatically.

Where secrets managers fit in cloud infrastructure

Applications typically authenticate to a secrets manager using an identity the platform already trusts — a cloud IAM role, a Kubernetes service account, or a workload identity — rather than yet another static credential that itself needs protecting. That’s a deliberate design choice: it avoids the “secret needed to fetch the secret” problem you’d have if the application needed its own long-lived password just to reach the vault.

This pairs naturally with infrastructure as code: a deployment pipeline provisions a service, grants it a scoped identity, and that identity is what authorizes reading the specific secrets that service needs — nothing is hardcoded into the pipeline’s configuration files. It’s also a natural fit with a bastion host or zero trust architecture, where the goal throughout is minimizing standing access and maximizing what’s verified per-request.

Secret sprawl and why it’s the real enemy

The hardest part of secrets management in practice usually isn’t picking a tool — it’s finding every place a secret has already spread to before adopting one. A team migrating to a secrets manager typically discovers credentials duplicated across a dozen deployment scripts, hardcoded in a legacy service nobody wants to touch, and copied into onboarding documentation for new hires. Each of those copies is a separate place the secret can leak from, and each one has to be found and retired, not just replaced going forward. This is why rotation matters even for secrets that were never known to have leaked: a credential that’s existed unrotated for years has simply had more opportunities to end up somewhere unintended, whether or not anyone has noticed yet.

Secrets management vs encryption

Encryption and secrets management solve adjacent but different problems. Encryption at rest and in transit protects data from being read by anyone who intercepts it or steals the underlying storage. Secrets management is about lifecycle and access — deciding who gets to retrieve a secret in the first place, rotating it, and knowing when it was used. A secrets manager typically relies on encryption internally to protect what it stores, but encryption alone doesn’t answer questions like “should this particular service still have access to this database password,” which is what a secrets management system is actually for.

Common mistakes even with a secrets manager in place

Buying or deploying the tool doesn’t automatically fix bad habits. Teams still leak secrets by logging them accidentally, embedding them in error messages, or granting overly broad access policies that defeat the point of fine-grained control. Secrets management is most effective paired with the same discipline as any other access-control system: least privilege by default, short-lived credentials wherever the workflow supports them, and treating any secret that touched an unmanaged location — a log, a chat message, a support ticket — as compromised and due for rotation.

The takeaway

Secrets management replaces credentials hardcoded in config files and environment variables with a dedicated system that stores them encrypted, controls exactly who can read them, logs every access, and rotates them on a schedule. The bigger shift it enables is dynamic, short-lived credentials issued per-request instead of static passwords that live forever — shrinking the blast radius of any single leak from “valid indefinitely” to “valid for the next few minutes.”

Chisato Chisato · · 3 min read

What Is a Runbook? Incident Response Playbooks

A runbook is a step-by-step document for handling a specific operational task or incident, turning tribal knowledge into a repeatable procedure.

#DevOps #Cloud #Observability