key rotation
Replacing a password or key with a new one on a schedule or after a suspected leak, and re-encrypting what it protected.
In more detail
Rotation limits how long a stolen key stays useful, and is mandatory after a suspected leak. Plan it before you need it: who rotates, how often, and what must be re-encrypted or updated afterwards.
Examples
ansible-vault rekey re-encrypts Vault files with a new password; separate vault IDs let one environment rotate without touching the others.In the course lab, "roll the database credential" revoked a credential the replicas still used and became a failed deployment.In Terraform: Any secret that appears in a Terraform state snapshot, plan file or log that the wrong people could read should be rotated. Access control and ephemeral values reduce exposure, but rotation is what limits the damage.Related terms
- vault password — The password that unlocks Vault-encrypted data; Ansible needs it at run time and it must never be stored in the repository.
- vault ID — A label attached to Vault-encrypted data that names which password protects it, so one project can use different passwords for different environments.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- signing key — The secret key used to sign tokens or messages, together with the key used to verify them, which may be the same secret or the public half of a pair.
- key identifier — A short name in a token header, kid, that says which of the verifier’s trusted keys was used to sign it.
- JSON Web Key Set — A standard JSON document that publishes a set of public keys, each with a key identifier, so clients can verify tokens.
- revocation — Cancelling a credential, session or key before its natural expiry so it stops working.
- API key — A secret string that identifies and authorises a program calling an API, usually sent in a header.
- workload identity — An identity for software rather than a person, proven by a signed token from the platform it runs on instead of a stored key.
- access key — A long-lived cloud credential made of a key ID and a secret key that works until someone deletes it.
- OpenID Connect — An identity layer on top of OAuth 2.0 that tells an application who signed in, using a signed ID token.
- AWS KMS — AWS Key Management Service, which creates and guards encryption keys and controls who may use them.
- key deletion — Permanently destroying a KMS key after a waiting period of 7 to 30 days, which makes all data encrypted under it unrecoverable.
- managed secret store — A hosted service such as Azure Key Vault or AWS Secrets Manager that stores secrets encrypted, controls who can read them and records access.
- AWS Secrets Manager — An AWS service that stores passwords, keys and other secrets encrypted and hands them to programs that are allowed to read them.
- secret version — One stored value of a secret; a manager keeps several and marks one as current, so rotation is a new version rather than an overwrite.
- Terraform state — Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.
- access control — The rules and mechanisms that decide who may read, use or change a resource.
Taught in
- Vault IDs And Multiple Passwords — Ansible Configuration Management at Scale
- Cookies And CORS — Modern API Architecture: REST, GraphQL & gRPC
- JSON Web Tokens — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC
- Automating Data Protection: Keys, Secrets And A Partner Shortcut — AWS Certified DevOps Engineer – Professional (DOP-C02) Exam Prep
- Keyless Authentication: OIDC to the Cloud — Continuous Integration & Continuous Delivery Pipelines
- Security Landing Zones & Centralized Egress Inspection — Cloud Security & DevSecOps Engineering
- Shift-Left Security Principles & Automated Pipeline Gates — Cloud Security & DevSecOps Engineering
- Pre-Commit Secret Scanning with Gitleaks & Entropy — Cloud Security & DevSecOps Engineering
- CloudTrail Logging, Integrity Validation & Athena — Cloud Security & DevSecOps Engineering
- Envelope Encryption & Data Protection with KMS — Cloud Security & DevSecOps Engineering
- Post-Quantum Cryptography & Key Lifecycles — Cybersecurity Fundamentals, GRC & Cryptography
- Backup Architectures: 3-2-1, Immutability & Air-Gaps — Cybersecurity Fundamentals, GRC & Cryptography
- Restoration: Failed Deployment Recovery Time — DevOps & Site Reliability Engineering
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices
- Why Secrets Leak — Application Security & Threat Modeling for Engineers
- The Environment Variable Trap — Application Security & Threat Modeling for Engineers
- Moving To A Secret Manager — Application Security & Threat Modeling for Engineers
- Provenance And Signing — Application Security & Threat Modeling for Engineers
- Secret Scanning — Application Security & Threat Modeling for Engineers
- The Problem With Local State — Infrastructure as Code with Terraform
- Configuring A Remote Backend — Infrastructure as Code with Terraform
- State Locking With Use Lockfile — Infrastructure as Code with Terraform
- Workspaces For Multiple Environments — Infrastructure as Code with Terraform
- Security: Secrets In State And Ephemeral Values — Infrastructure as Code with Terraform
- Sensitive Data, Ephemeral Values And Secrets From Vault — HashiCorp Terraform Associate (004) Exam Prep
- Ansible Vault: Secrets Encrypted, Runs Without A Prompt — RHCE in Ansible (EX294): Automate Red Hat Systems
References
- ansible-vault command: rekey
- OWASP Key Management Cheat Sheet
- RFC 8725: JSON Web Token Best Current Practices
- Google Cloud: manage API keys
- AWS IAM: Manage access keys for IAM users
- AWS KMS: rotating keys
- OWASP Secrets Management Cheat Sheet: rotation
- AWS Secrets Manager: rotate secrets