Secrets management
A locked vault for passwords, keys and tokens, handed out at runtime.
4 technologies on this page ↓How it works
A secrets manager stores credentials encrypted and hands them only to callers whose identity is allowed to read them. Apps fetch secrets at startup or on demand instead of keeping them in code or config files. Every read is audited, and many managers rotate credentials automatically, changing the database password and the stored value together.
A hotel safe with an access log. Only the right keycard opens it, every opening is recorded, and the combination changes on a schedule.
Reach for it when
- Database passwords, API keys, signing keys, certificates
- Automatic credential rotation
- Auditing who read which secret, and when
- Finding secrets that leaked into code, wikis or chat anyway, with a scanner such as GitHub secret scanning, gitleaks, TruffleHog or HCP Vault Radar
Think twice when
- Committing secrets to git, even in a private repository
- Baking secrets into images or printing them in CI logs
A real example
The API’s role is allowed to read db/password, so it fetches the current value on boot. Every 30 days the manager rotates the database password. A script on someone’s laptop with no role is refused.
Technologies
Specific products, and what each does differently.
HCP Vault RadarCommercialA hosted scanner that finds leaked secrets and personal data in code, wikis, tickets and chat, checks which ones still work, and helps move them into Vault.| Commercial product | Cloudflare, Inc. | Proprietary | 2026-10-12 | |
| Commercial product | Doppler | Proprietary SaaS; the CLI and Kubernetes operator are Apache 2.0 | 2026-10-08 | |
| Commercial product | HashiCorp, an IBM company | Business Source License 1.1 (source-available, not OSI open source); MPL 2.0 before the August 2023 change | 2026-10-05 | |
HCP Vault Radar | Commercial product | HashiCorp, an IBM company | Proprietary: an HCP software-as-a-service; the `vault-radar` CLI and agent ship as closed-source binaries under a HashiCorp licence agreement | 2026-10-05 |
What each provider calls it
- AWS
- Secrets Manager, SSM Parameter Store
- Google Cloud
- Secret Manager
- Azure
- Key Vault
- Open source & others
- HashiCorp Vault, OpenBao, SOPS
In code · python
import boto3, json, psycopg
sm = boto3.client("secretsmanager")
secret = json.loads(sm.get_secret_value(SecretId="db/password")["SecretString"])
conn = psycopg.connect(host=secret["host"], user=secret["username"],
password=secret["password"], dbname="app")Worth exploring
Often confused with
Where it came from2015–2026
For a long time a database password lived wherever the code that needed it lived: in source code, in configuration files, in configuration management, or copied onto servers by hand. When Square open-sourced its own secrets tool in 2015, its engineers listed what was wrong with that. Source repositories exposed secrets to developers and CI systems that never needed them, hand-deployed secrets were scattered and impossible to audit, and configuration management tools, built to keep everything visible with full history, were exactly the wrong place for them.
The Twelve-Factor App methodology gave a simple test: could the codebase be made open source at any moment without compromising any credentials? Its answer was environment variables. Dedicated secret managers went further. In April 2015 Square released Keywhiz, which hands secrets to services as files over mutual TLS, and HashiCorp announced Vault, which also creates credentials on demand for each client and revokes them when their lease ends. In April 2018 AWS launched Secrets Manager with automatic rotation; until then, it noted, customers had to run extra infrastructure just to manage secrets.
Since then the push has been to need fewer stored secrets at all. GitHub began scanning public repositories for leaked tokens in 2018, and short-lived identity tokens, such as GitHub Actions’ OIDC tokens in 2021, let workloads reach clouds without any stored key.
Why it’s built this way
- Keep secrets out of code and config files
- Anything committed to a repository is exposed to everyone and every system that can read it, including CI, and config files are easy to commit by mistake. Storing secrets separately means code can be shared without sharing access.
- Fetch at runtime, authorized by identity
- A central store that checks who is asking and logs every read answers the question scattered config files never could: who has access to this secret, and who used it?
- Rotate, or make credentials short-lived
- A secret that never changes stays useful to an attacker forever. Automatic rotation limits that window, and dynamic secrets that expire within hours shrink it further.
Timeline
- 2015
Square open-sources Keywhiz; HashiCorp announces Vault, both in April
- 2018
AWS Secrets Manager launches in April with automatic rotation
- 2018
GitHub starts scanning public repositories for leaked tokens
- 2021
GitHub Actions OIDC lets CI deploy to clouds without stored keys
- 2026
Vault 2.0 syncs secrets using workload identity, without static credentials
- Square Engineering: Protecting infrastructure secrets with Keywhiz (Apr 2015)
- The Twelve-Factor App: Config
- HashiCorp blog: Vault announcement (Apr 2015)
- AWS News Blog: AWS Secrets Manager launch (Apr 2018)
- GitHub blog: The future of software, GitHub Universe 2018 (Token Scanning, Oct 2018)
- GitHub blog: Behind the scenes of GitHub Token Scanning (Oct 2018)
- GitHub Changelog: GitHub Actions secure cloud deployments with OpenID Connect (Oct 2021)
- Vault docs: Release notes 2.x (workload identity secret sync, 2026)
Sources15
- AWS docs: What is AWS Secrets Manager?
- AWS docs: Rotate Secrets Manager secrets
- AWS docs: Log Secrets Manager events with AWS CloudTrail
- AWS docs: Authentication and access control for Secrets Manager
- AWS docs: Boto3 get_secret_value
- AWS docs: AWS Systems Manager Parameter Store
- Google Cloud docs: Secret Manager overview
- Microsoft Learn: About Azure Key Vault
- Vault docs: How Vault works
- OpenBao: a fork of Vault managed by the Linux Foundation’s OpenSSF
- GitHub: getsops/sops
- GitHub docs: About secret scanning
- GitHub: gitleaks/gitleaks
- GitHub: trufflesecurity/trufflehog
- Vault Radar docs: What is Vault Radar?