DevOps / SRE · Letter S

Secrets Rotation Policy

The rules and machinery for changing credentials on a schedule and on demand — so a leaked key has a short useful life and rotation is not an outage.

By Dr. Hassan Eliwa, PhD · Founder of PMMilestone.org and PMMilestone.com · Updated 2026-09-04

Definition

A secrets rotation policy defines which credentials — database passwords, API keys, signing keys, service-account tokens, TLS certificates — are rotated, how often, by what mechanism, and what happens in an emergency rotation after suspected compromise. A workable policy is inseparable from the machinery that implements it: a centralised secret store, short-lived dynamic credentials where possible, and applications that can pick up a new value without a redeploy.

Why It Matters

Credentials leak in mundane ways: committed to a repository, pasted into a support ticket, captured in a debug log, or carried away on a laptop by a departing contractor. Rotation limits the blast radius by bounding how long a leaked secret remains useful. The uncomfortable truth is that most organisations discover their rotation capability during an incident, when someone asks how quickly the production database password can be changed and the honest answer involves a maintenance window and four teams.

How to Make Rotation Routine

  1. Inventory first. You cannot rotate what you cannot list. Scan repositories, CI configuration, container images and infrastructure code.
  2. Centralise storage. One secret manager with audit logging, versioning and fine-grained access, referenced at runtime rather than baked into images.
  3. Prefer short-lived dynamic credentials. A database credential minted per session with a one-hour lifetime removes most of the rotation problem entirely.
  4. Support two valid secrets at once. Dual-credential rotation — create new, deploy, verify, revoke old — is what makes zero-downtime rotation possible.
  5. Automate on a schedule. Ninety days for static credentials is a common baseline; certificates should renew automatically well before expiry.
  6. Rehearse emergency rotation. Time a full rotation of the highest-value secret and publish the number.

Real-World Example

A platform team found an active cloud access key in a public repository's commit history from fourteen months earlier. Revoking it took thirty seconds. Understanding what depended on it took eleven hours: the key was embedded in two container images, a legacy cron host, and a partner integration nobody in the current team had built. Two of those broke on revocation, one at 02:00. The post-incident work was more valuable than the incident: every static key moved into the secret manager, images were rebuilt to read credentials at startup, and the team adopted dual-credential rotation with a ninety-day automated schedule. Six months later, a routine rotation of the same class of key took four minutes with no customer impact — and, crucially, nobody hesitated to do it.

Practical Lessons Learned

  • Rotation pain is a dependency-mapping problem. The change is trivial; knowing who uses the secret is not.
  • Baked-in secrets force redeploys. Read at startup or, better, refresh at runtime.
  • Certificates expire at inconvenient hours. Automate renewal and alert at 30 days, not 3.
  • Rotation without revocation is theatre. The old credential must actually stop working, and someone must verify it did.
  • Third-party keys need lead time. Partner integrations often require coordinated changes, so schedule them rather than surprising them.

Expert Tips

  • Tag every secret with an owning team and the systems that consume it. That metadata is what turns an emergency into a routine change.
  • Add secret scanning to pre-commit hooks as well as CI. Blocking the commit is far cheaper than rotating after a push.
  • Alert on use of the old credential after rotation — it is the fastest way to find the consumer nobody documented.
  • Rotate one production secret deliberately each quarter as a drill, in business hours, with everyone watching.
  • Treat signing keys differently: they need overlap periods and published key IDs, because consumers cache them.

Common Mistakes

  • A policy document requiring 90-day rotation with no automation, so the policy is quietly ignored.
  • Secrets in environment variables baked into images, making rotation a full release.
  • Rotating without a dual-credential window, guaranteeing downtime and therefore avoidance.
  • Excluding service accounts and CI tokens from the inventory, which is where the most powerful credentials usually live.
  • Never revoking the old value "just in case", which defeats the entire exercise.

Key Takeaways

  • Rotation capability is measured in minutes to revoke, not in policy pages.
  • Inventory and ownership metadata make emergency rotation survivable.
  • Dual-credential windows are what make rotation zero-downtime.
  • Short-lived dynamic credentials beat rotating static ones.
  • Practise a rotation in daylight so the emergency one is boring.

Related Concepts

Pairs with Production Readiness Review, Dependency Upgrade Cadence, Backup Restore Drill, and Post-Incident Review.

Frequently Asked Questions

  • How often should secrets be rotated?
    Static credentials commonly rotate every 90 days, TLS certificates automatically well before expiry, and high-value keys more frequently. The better question is how quickly you can rotate on demand — a team that can rotate in minutes is safer than one with a strict calendar and no mechanism.
  • Isn't frequent rotation unnecessary with short-lived tokens?
    Largely, yes, and that is the point of preferring dynamic credentials. Where a workload mints a fresh one-hour database credential per session, scheduled rotation adds little. Scheduled rotation exists for the static secrets you cannot yet eliminate.
  • What is dual-credential rotation?
    You provision a second valid credential, roll it out and verify traffic is using it, then revoke the first. Because both work during the overlap, no consumer breaks. Systems that support only one active credential are the reason many teams avoid rotating at all.
  • How do we handle secrets in CI pipelines?
    Use the platform's native secret store with masked logging, scope tokens to a single repository or job, and prefer short-lived OIDC federation to cloud providers over long-lived keys. CI tokens are frequently the most privileged and least inventoried credentials in an organisation.
  • What should happen immediately after a suspected leak?
    Revoke first, investigate second — a leaked key's value decays with time, and hesitation is expensive. Then check audit logs for use of that credential from unexpected sources, and treat any anomaly as a full incident with its own review.
  • Do we need a secret manager if we use a cloud provider's IAM roles?
    IAM roles remove the need for many secrets, which is the ideal outcome. You will still have third-party API keys, signing keys and database credentials for systems outside that model, and those need a managed store with audit and versioning.
  • Which calculators on PMMilestone.org apply to Secrets Rotation Policy?
    For Secrets Rotation Policy, the most relevant tools on the flagship platform are the EVM, SPI and CPI calculators on PMMilestone.org. They reproduce the formulas referenced in this entry against your own project data.
  • What is a common misconception about Secrets Rotation Policy?
    That the topic is well-defined across all references. In practice, definitions vary between PMBOK, PRINCE2, AACE and ISO 21500 — this entry uses the definition most aligned with field practice on capital projects, and flags where the standards diverge.
  • Which related encyclopedia entries should I read alongside Secrets Rotation Policy?
    Read Earned Value Management, Critical Path Method and the DCMA 14-point assessment next. The full A–Z is available in the PMMilestone Encyclopedia, and quick one-line definitions live in the PM Glossary on the flagship platform.
  • How does Dr. Hassan Eliwa's research treat Secrets Rotation Policy?
    Dr. Hassan Eliwa's research focuses on owner-side project controls, schedule integrity and forensic delay analysis on capital construction and power programmes. Secrets Rotation Policy is treated through that lens — what a planning or controls engineer is expected to do with it on a live project, not its textbook definition alone. See the full research library at PMMilestone Research Articles.
  • How is Secrets Rotation Policy defined on PMMilestone Research & Insights?
    The rules and machinery for changing credentials on a schedule and on demand — so a leaked key has a short useful life and rotation is not an outage. For the full treatment, see the definition, principles, applications and related entries above — every encyclopedia entry follows the same research-grade structure.

People also ask

Follow-up questions practitioners search for next — each one points to the calculator, template or reference entry that answers it.

Related Entries

Browse more in this category

More in DevOps / SRE

View all DevOps / SRE entries →

Further reading on PMMilestone.org

Curated companion resources hosted on the flagship platform, PMMilestone.org.

Related Encyclopedia Entries
Research Articles
Career Guides
Tools on PMMilestone.org
Buy me a coffee