What counts as a secret
A secret is any value that grants access or protects data if kept private. Examples are database passwords, API tokens, TLS private keys and encryption keys. If an attacker obtains one, they can act as the system that owns it.
Secrets often leak because they are placed in source code, configuration files, chat messages or container images. Copies spread to backups and developer laptops. A vault replaces these scattered copies with one controlled store.
How a vault stores and releases secrets
A vault encrypts secrets at rest, usually with a master key or a root key. That root key is often protected by a hardware security module (HSM), a tamper-resistant device that performs cryptographic operations without exposing the key. For the most sensitive keys, the vault can perform the encryption itself so the key never leaves it.
Before releasing a secret, the vault checks identity and policy. A program proves who it is with a token or a platform identity. The policy then states which secrets that identity may read. Every request is written to an audit log.
Rotation and short-lived credentials: a worked case
Rotation means replacing a secret on a schedule so a stolen copy stops working. Suppose a database password is rotated every 90 days. A leaked password could then be valid for up to 90 days. If the vault issues dynamic credentials that expire after 1 hour, the exposure window drops to 1 hour.
Compare the two windows. 90 days is 90 x 24 = 2,160 hours. One hour is 1/2,160 of that, so the window is about 0.05 percent as long. Dynamic credentials also let the vault log which application received each one.
Common misconceptions
Encoding a secret is not protecting it. Base64 text in a configuration file can be reversed by anyone who reads the file. Encryption with a well-guarded key is required.
A vault does not remove all risk. If the identity used to log in to the vault is weak or over-permitted, an attacker can simply ask for the secrets. Least privilege and monitoring of the audit log remain necessary. Deleting a secret from a code repository also does not remove it from version history, so a leaked secret should be revoked and replaced.
Where secrets management appears
Cloud platforms offer managed vault services, and organisations also run self-hosted ones. Build pipelines fetch deployment credentials at run time. Container orchestration systems inject secrets into running workloads.
Certificate management, database access and payment systems depend on these controls. Many compliance standards expect key protection, access logging and rotation, though exact requirements differ by standard.
Key terms
- Secret
- A value such as a password, token or key that grants access or protects data when kept private.
- Key vault
- A service or device that stores secrets and keys under access control and logging.
- Hardware security module
- A tamper-resistant device that performs cryptographic operations without exposing its keys.
- Rotation
- Replacing a secret with a new value on a schedule or after suspected exposure.
- Dynamic credential
- A short-lived secret generated on request that expires automatically.
- Least privilege
- Giving an identity only the access it needs to do its task.
