Use this when changing secrets regularly or after exposure.
Rotation
Secret rotation replaces credentials regularly or after suspected exposure, ideally automatically, with applications fetching the new value from the vault so rotation does not cause outages.
1. Rotate secrets regularly and after exposure.
2. Automate (dynamic secrets, managed rotation).
3. Apps must reload new secrets.
4. Overlap periods to avoid outages.
5. Track last rotation.
old secret → new secret issued → apps updated → old revoked
Context & applicabilityCommon mistakes · platform/version boundaries
- Rotating the secret but not restarting or reloading apps, causing outages.
- No overlap period for dual secrets (old and new valid at the same time).
- Rotation scripts that log the new secret.
- Rotating only after a breach instead of on a schedule.
Operational reference
Fast context before you go deeper.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Automate rotation.
- Update both target and vault.
- Test applications after rotation.
- Rotation schedule per secret type — policy
vault lease renew/revoke— dynamic secretsaws secretsmanager describe-secret --secret-id <id> | grep Rotation— rotation enabled
ReferenceWhy it matters1 section · depth on demand
Rotation approaches
1. Create the new secret.
2. Deploy it to all consumers (or support two valid secrets during the overlap).
3. Revoke the old secret.
4. Verify nothing still uses the old one (logs, failed authentication).
Automate with secret-manager rotation functions (AWS Secrets Manager Lambda, Key Vault rotation, Vault dynamic secrets). Manual rotation is often skipped and breaks applications.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Rotation replaces secrets regularly and after any suspected exposure, limiting how long a stolen secret remains useful. Manual rotation is error-prone and often skipped, so automation is key.
Rotation approaches:
| Approach | Example |
|---|---|
| Dynamic secrets | Vault creates DB credentials per request, auto-expiring |
| Managed rotation | Cloud secret managers rotating database passwords; gMSA in AD |
| Dual secrets | Two valid keys during transition so services switch without downtime |
| Certificate automation | ACME for TLS certificates |
Test rotation before relying on it: applications must reload new secrets without restarts or outages. Rotate immediately — not on the next schedule — when a secret may have leaked.
ReferenceConfiguration & state1 section · depth on demand
Example: dual-secret rotation
1. Generate a new secret and add it alongside the old (both valid).
2. Update all consumers to the new secret.
3. Confirm no use of the old secret (logs/metrics).
4. Revoke the old secret.
Database users and cloud keys often support two active credentials for this.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Secrets Management → Rotation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html · confidence 94%