Credential rotation is replacing a credential (an API key, password, token, certificate or key pair) with a new one and revoking the old one, on a schedule or after a suspected exposure. For non-human identities, the stronger aim is to stop needing rotation by issuing short-lived credentials instead.
The credentials behind non-human identities (API keys, tokens, certificates, passwords) are what attackers steal. This part of the lifecycle is about managing that credential risk: getting secrets under management, rotating them, and ultimately moving past long-lived secrets altogether.
The long-lived credential problem
A static API key created three years ago and never rotated is a permanent liability. If it has ever been exposed (in a log, a repo, a screenshot, a breach) it is still valid, and the key itself carries nothing to show that it is in the wrong hands.
Vault first, then rotate
You cannot rotate what you cannot reach. The prerequisite for rotation is centralising secrets in a managed vault rather than scattering them in code and config. Once secrets are vaulted, rotation can be automated: the vault issues, tracks, and replaces credentials on a schedule. Read the secrets management guide.
The end state: short-lived credentials
The strongest position is to stop using long-lived secrets at all. With workload identity federation and just-in-time issuance, an identity receives a credential that lives for minutes or hours rather than years (AWS role sessions from web identity federation and Google short-lived access tokens both default to one hour) and is tied to a specific workload. A stolen token expires quickly, and there is no static secret to leak in the first place. This is the destination that rotation is a stepping stone toward. More on JIT and zero standing privilege.
Use dual credentials for zero-downtime rotation
The safe rotation pattern is to support two valid credentials at once: issue the new credential, deploy it, confirm the service is using it, then revoke the old one. This overlap window reduces the outage risk that makes teams avoid rotation.
Automate and schedule by risk
Automate rotation through the vault and set frequency by risk: high-privilege and widely-shared credentials rotate more often. Manual rotation does not scale to thousands of secrets.
Frequently asked questions
How often should non-human identity credentials be rotated?
Long-lived credentials should be rotated on a defined schedule appropriate to their risk, with high-privilege credentials rotated more frequently. The stronger end state is to eliminate long-lived secrets entirely by using short-lived, dynamic credentials issued just in time, so there is nothing static to rotate or steal.
Why is credential rotation so difficult for NHIs?
Because rotating thousands of credentials without breaking the services that depend on them is operationally hard, which leads teams to leave secrets static. The solution is to centralise secrets in a vault so rotation can be automated, and ultimately to replace long-lived secrets with short-lived credentials issued dynamically.
What is the alternative to rotating secrets?
Eliminating long-lived secrets altogether. Workload identity federation lets a workload authenticate using its native environment identity and receive a short-lived token only when it needs one. With no static credential to rotate or leak, the rotation problem largely disappears.
How do you rotate secrets without causing outages?
Use a dual-credential pattern: issue the new credential, deploy it, confirm the service is using it successfully, and only then revoke the old one. Supporting two valid credentials during an overlap window reduces the downtime risk that otherwise makes teams avoid rotation. Centralising secrets in a vault first is a prerequisite.
Worked examples: the API key governance playbook covers expiry and rotation for AWS keys and GitHub tokens, GitHub Actions to AWS without stored keys removes a key entirely, and certificate lifecycle management covers certificate renewal.
Sources
- OWASP Non-Human Identities Top 10 (2025), owasp.org
- OWASP NHI Top 10 (2025), full risk list, owasp.org
- NIST SP 800-53 Rev. 5, Security and Privacy Controls for Information Systems and Organizations (AC-2, AC-6, IA-5), csrc.nist.gov
- Entro Labs, NHI & Secrets Risk Report H1 2025 (144:1, up from 92:1), Entro release via GlobeNewswire, 22 July 2025
- SPIFFE, concepts and SVID overview, spiffe.io
Where a primary URL is not shown, we have not confirmed the figure against the publisher’s own document and say so on the page rather than linking a secondary source that paraphrases it. Paywalled standards (ISO/IEC, AICPA) are cited by clause and not linked. Corrections welcome: report an error.
Disclosure. This reference is free. No vendor pays for coverage, placement, or favourable treatment. HumanAudit Inc., which publishes this site, sells ISO/IEC 42001 documentation and plans NHI governance documentation packs, including an RFP kit that does not name, rank or recommend any vendor; it builds and sells no NHI scanner and no NHI discovery, monitoring or security tool (see About). Links to its offers appear in the header, in the site footer and in one marked box on guide pages; company profiles carry none. See our methodology, sourcing standards and corrections policy.
From the publisher
HumanAudit, which publishes this site, is preparing the NHI Governance pack: an NHI policy, ownership register, lifecycle procedures and one control set mapped, as our interpretation, to PCI DSS v4.0.1, ISO/IEC 27001:2022, NIS2 and DORA. Planned for March 2027; not yet on sale, and no price has been published.