Automation · Security Automation
Secret Rotation
Cheat sheet · https://pcornel.dk/topic.php?topic=5760
Answer
Secret rotation automation changes passwords, keys and tokens on a schedule or after exposure, updating both the target system and the vault so applications keep working.
Remember
- Update both the target system and the vault.
- Applications must reload the new secret.
- Test after rotation.
First checks
vault write -f database/rotate-root/<conn>— rotate DB root (Vault)aws secretsmanager rotate-secret --secret-id <id>— AWS rotation- Consumers reload new secret — no outage
Verify in this order
schedule/event → new secret → consumers updated → old revoked
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5760