Skip to content
SP StackPractices
intermediate By StackPractices

Secret Rotation Schedule Template

A template for tracking and scheduling the rotation of API keys, passwords, certificates, and other secrets across systems.

Note: This guide follows English-language naming conventions and terminology standards common in international development teams. Examples use English identifiers and comments to maximize compatibility across codebases and tooling.

Overview

A Secret Rotation Schedule Template helps teams track every credential that must be rotated, when it was last rotated, when it is due next, and who owns the process. It supports operational reliability and compliance by preventing expired certificates, stale API keys, and forgotten service account passwords.

When to Use

  • Setting up a secrets management program.
  • After a security incident or suspected credential leak.
  • Preparing for an audit or compliance review.
  • Migrating to a secrets manager or vault.
  • Managing certificates, API keys, database passwords, or OAuth tokens.

Prerequisites

  • A complete inventory of secrets and their locations.
  • A secrets manager or vault for safe storage and rotation.
  • Defined rotation frequencies based on risk and compliance requirements.
  • Owners for each secret or system.
  • Automated or manual rotation procedures that have been tested.

Solution

Template

1. Secret Inventory

Secret NameTypeSystemOwnerLast RotatedNext RotationFrequencyStatus
prod-db-passwordDatabase passwordpayment-serviceDB team2026-03-152026-09-156 monthsOn track
stripe-api-keyAPI keybilling-servicePayments team2026-05-012026-11-016 monthsOn track
tls-cert-apiTLS certificateapi-gatewayPlatform team2025-08-012026-08-011 yearDue soon
s3-service-accountService account keyfile-processorData team2026-01-102026-07-106 monthsOverdue
github-actions-tokenCI tokendeployment pipelineDevOps2026-06-012026-12-016 monthsOn track

2. Rotation Procedure

StepActionOwnerVerification
1Generate new secret in vaultOwnerNew secret exists and is encrypted
2Update dependent services with new secretEngineering teamConfiguration change reviewed and approved
3Restart or redeploy affected servicesDevOpsHealth checks pass
4Validate functionality end-to-endQA / ownerSmoke tests pass
5Revoke old secretOwnerOld secret no longer authenticates
6Log rotation in schedule and audit trailSecurityTimestamp and owner recorded

3. Exception and Risk Acceptance

FieldValue
Secret names3-service-account
Reason for exceptionLegacy system cannot rotate automatically
Compensating controlManual rotation with approval, access limited to VPC
Risk ownerData team lead
Review date2026-09-10
Approved byCISO

4. Escalation Matrix

ConditionActionEscalation TargetTimeline
Secret overdue by 7 daysNotify owner and managerEngineering managerImmediate
Secret overdue by 30 daysEscalate to security reviewSecurity teamWithin 48 hours
Suspected compromiseRotate immediately and investigateIncident response teamWithin 4 hours
Certificate expiring in 30 daysCreate renewal ticketPlatform teamSame day

Explanation

The schedule makes secret lifecycle visible. Without it, credentials expire unexpectedly, rotated secrets are forgotten, and compliance evidence is missing. The inventory links each secret to an owner, a rotation frequency, and a verification step, which reduces the risk of service disruption during rotation.

Variants

  • Certificate-only schedule: Focuses on TLS, code-signing, and intermediate certificates with renewal and revocation workflows.
  • Cloud credential schedule: Tracks IAM keys, service principals, and managed identities across AWS, Azure, and GCP.
  • CI/CD secret schedule: Manages pipeline tokens, signing keys, and deployment credentials.
  • Database credential schedule: Tracks database passwords and connection strings with rolling rotation to avoid downtime.

Best Practices

  • Store secrets in a dedicated vault, never in source code or plaintext files.
  • Automate rotation where possible to reduce human error.
  • Rotate immediately after a suspected leak, employee departure, or breach.
  • Set calendar reminders at 30, 14, and 7 days before expiration.
  • Keep an audit trail of every rotation with owner and timestamp.
  • Test rotation procedures in a non-production environment first.
  • Delete old secrets after confirming the new ones are active.

Common Mistakes

  • Rotating a secret without updating all dependent services.
  • Forgetting to restart services after a secret change.
  • Keeping old secrets active “just in case” after rotation.
  • Not assigning a clear owner for each secret.
  • Skipping post-rotation validation.

FAQs

How often should API keys be rotated?

High-risk keys exposed to the internet should rotate every 90 days or less. Internal service keys typically rotate every 6 months, depending on compliance requirements.

Should rotation be automated or manual?

Automate whenever possible. Manual rotation should be limited to legacy systems and should still follow a documented schedule with compensating controls.

What happens if a service cannot rotate without downtime?

Use a rolling rotation strategy: create a new credential, update half of the instances, validate, then update the rest. For databases, support dual credentials temporarily.