Secrets rotation

Move from embedded credentials before automating rotation

Consumers must retrieve or receive updates through a maintained path. Scheduling rotation first can break applications that still depend on a copied value.

In this article

Inventory the copies

Locate credentials in deployment configuration, runtime settings, scheduled jobs and approved operational tools. Use appropriate secret-scanning and configuration review without printing values.

Record the owner and update mechanism for each consumer. A copied credential in a rarely used recovery script can survive long after the main application is migrated.

Treat discovered exposure according to the incident policy where necessary. Moving the value to a manager does not undo prior disclosure.

Introduce a supported reference

Change consumers to use the selected secret-management or identity mechanism. Keep target permissions scoped to the actual operation.

Verify how the application receives updates and what happens when retrieval fails. A new reference that is resolved only at deployment still needs a redeployment or refresh strategy.

Test the change with a safe credential and a representative business operation before broad rollout.

Exercise a manual controlled rotation

Rotate through the intended sequence and verify target validity, consumer adoption and old-credential retirement. Include a delayed worker and a restarted process.

Resolve failures before enabling a recurring schedule. Automation repeats the existing process, including its gaps.

Keep the current and previous authority states visible without exposing values, and document partial-state recovery.

Enable the routine and remove old copies

Add the agreed schedule and monitoring once the transition is demonstrated. Assign owners for failures and consumers that miss adoption.

Remove embedded copies and obsolete access under the applicable process. Confirm that rollback and recovery artefacts no longer depend on them, or update those paths deliberately.

Review whether a supported short-lived identity mechanism can replace the long-lived secret entirely for the use case. The goal is maintainable authority, not rotation machinery for a credential the application no longer needs.

Find the last consumer of the old credential

A consumer that reads a secret once at process start needs an explicit transition plan. During a staged rollout, old instances can keep using one credential while new instances use another. The target must support the chosen overlap, or the deployment must coordinate reconnection around the supported single-credential change.

Rehearse the last old instance, not only the first successful new one. A scheduled worker that runs after the overlap ends can reveal an otherwise hidden dependency on the retired value.

Primary sources

OWASP: secrets management

References checked 11 September 2026.