Rotation limits how long a stolen credential stays useful. Scheduled rotation replaces credentials at a fixed maximum age, so a leak nobody noticed eventually expires. Emergency rotation replaces a credential immediately after it is exposed, for example when secret scanning finds it in a repository. Both follow the same safe sequence: create the new credential at the provider, deliver it to everything that uses the old one, confirm the consumers work with it, and only then disable the old credential at the provider.
How it is used in practice
Teams that rotate well keep credentials in a secrets manager rather than in configuration files, so delivering the new value is a single update that consumers read. Policies set a maximum age per credential type, and reports flag credentials past it. Where possible, rotation is replaced altogether by short-lived credentials, such as workload identity tokens or cloud roles assumed per session, which expire on their own in minutes or hours.
Common pitfalls
- Revoking before replacing. Disabling the old credential first breaks every consumer still using it.
- Unknown consumers. Without knowing what depends on a credential, rotation becomes guesswork, which is why ownership comes first.
- Rotating the copy, not the credential. Changing the value in a vault does nothing if the old key remains valid at the provider.
- Treating rotation as cleanup. A leaked credential stays readable in git history after rotation; what rotation changes is whether it works.
- No rollback. A rotation that fails halfway, with some consumers switched and some not, needs a recorded state to recover from.
How TrustIvan relates to it
TrustIvan supports rotation in three places, and is precise about what each does. In NHI Security, the credential_rotation_overdue policy flags credentials older than a configurable maximum (90 days by default). For credential material NHI Security holds, a rotation walks recorded stages, validates the new values with the connector's health check before switching, rolls back if the provider refuses them, and destroys only its own stored copy; you create and disable keys at the provider yourself. For a discovered credential, rotation happens where it was issued. For secrets found in code, TrustIvan records a rotation on the finding without closing it. And its own API keys carry a mandatory expiry of at most a year. See Credentials and rotation.
Related terms
- Secret sprawl Secret sprawl is the uncontrolled spread of copies of credentials, such as API keys, tokens, passwords and private keys, across source code, configuration files, CI pipelines, container images, chat messages, documents and machines.
- Secret scanning Secret scanning is the automated search of source code, commit history and other text for credentials, such as API keys, access tokens, private keys and connection strings, that should never have been stored there.
- Machine identity A machine identity is the cryptographic credential, such as an X.509 certificate, an SSH key or a signed workload token, that a device, server, container or service uses to prove what it is to other systems.
- Non-human identity (NHI) A non-human identity (NHI) is any identity that authenticates and acts without a person at the keyboard: a service account, IAM role, API key, OAuth application, CI/CD robot, workload identity or AI agent.
- Service account A service account is an identity created for an application, workload or automation to authenticate as, rather than for a person, and granted permissions through roles or bindings.
On the platform: Credential security. All glossary terms