Join our Newsletter — 33% off our NHI Course
Home› Guides› How to rotate customer-managed KMS keys and decide…
Guide Secrets Management

How to rotate customer-managed KMS keys and decide when to re-encrypt: AWS, Azure and Google Cloud steps

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 13 min read
On this page

Turning on key rotation in a cloud key management service (KMS) changes the key material used for new encryption, and in most cases leaves existing data protected by the old material. Teams that tick "rotation enabled" often assume they have also refreshed every stored object, which the provider documentation does not say. This guide is the working procedure for customer-managed keys in AWS KMS, Azure Key Vault and Google Cloud KMS: which keys rotate automatically and which you rotate by hand, how aliases and versionless URIs move workloads to new material, what rotation does not re-encrypt, and a decision rule for when to re-encrypt data or retire old versions. Platforms are listed alphabetically, and the order is not a ranking. It is written for cloud platform, security and data engineers who already run a KMS; the side-by-side feature translation lives in Cloud Key Management Services Mapped.

Key takeaways

  • Rotation adds material, it does not replace data protection. AWS, Microsoft and Google each state that rotation does not re-encrypt data already protected by earlier key material.
  • Key type decides the method. Automatic rotation covers symmetric keys; asymmetric keys, HMAC keys and some key store types are rotated manually by creating a new key or version and moving callers to it.
  • Indirection makes rotation safe. Point workloads at an AWS alias, an Azure versionless key URI or a Google Cloud key (not a pinned version) so new material is picked up without code changes.
  • Re-encrypt for a reason, not by habit. Re-encrypt when a data key or plaintext may be exposed, when you must destroy an old version, or when a standard requires it; otherwise scheduled rotation is enough.
  • Retire old material last. Disable or destroy an old version only after you have evidence that nothing still depends on it, because destruction makes that data unrecoverable.

What rotation changes in each service

All three services use envelope encryption: a data encryption key (DEK) encrypts the data and the KMS key, often called the key encryption key (KEK), wraps the DEK. Rotation changes the KEK material. Depending on the service and integration, wrapped DEKs may be re-wrapped, but the data itself is not re-encrypted. For the application side of re-wrapping DEKs, see the Envelope Encryption and KMS Integration Patterns Guide.

BehaviourAWS KMSAzure Key VaultGoogle Cloud KMS
Automatic rotationSymmetric keys with AWS_KMS origin; RotationPeriodInDays 90 to 2560, default 365Rotation policy per key: a set time after creation or before expiry, minimum seven daysSymmetric keys; rotation period from 1 day to 100 years
Rotate nowOn-demand rotation (RotateKeyOnDemand) for symmetric AWS_KMS and imported (EXTERNAL) keysaz keyvault key rotate or Invoke-AzKeyVaultKeyRotationCreate a new key version and set it as primary
Manual rotation by new key or versionAsymmetric, HMAC and custom key store keys: new KMS key plus alias updateImported HSM keys: Notify action reminds you to import and rotateAsymmetric signing and encryption keys: new version, distribute public key
What callers referenceKey ID or ARN unchanged on rotation; aliases for manual rotationVersionless key URI for services; versioned URI stored with dataKey resource name; encryption uses the primary version
Decrypting older dataKMS selects the matching material automaticallyOld version must stay enabled until DEKs are re-wrappedOld version must stay enabled, not disabled or destroyed
Rotation evidenceCloudTrail RotateKey event, EventBridge "KMS CMK Rotation" event, ListKeyRotationsKey versions list; near expiry event through Event GridKey versions list and Cloud Audit Logs entries
Cost note from the docsMonthly charge for the first and second rotations of material; later rotations not billedExtra cost for each scheduled rotationEach enabled version incurs cost until destroyed

Rotate in AWS KMS

Availability: automatic rotation applies to symmetric encryption keys with AWS_KMS origin. Imported key material uses on-demand rotation; asymmetric keys, HMAC keys and keys in custom key stores use manual rotation. AWS managed keys rotate yearly on a schedule AWS controls.

  1. Turn on automatic rotation: call EnableKeyRotation with a RotationPeriodInDays value (90 to 2560). The caller needs kms:EnableKeyRotation in the key policy, and the call works only in the key's own account. Use the kms:RotationPeriodInDays condition key to stop principals setting periods outside your standard.
  2. Check status: GetKeyRotationStatus confirms rotation is on and shows in-progress on-demand rotations; ListKeyRotations lists completed ones.
  3. Rotate on demand after an event: RotateKeyOnDemand rotates now without changing the automatic schedule. AWS limits the number of on-demand rotations per key; the console shows how many remain.
  4. Multi-Region keys: enable rotation or rotate on demand on the primary key only; AWS copies new material to replicas before using it. For imported material, import the same material into the primary and each replica first.
  5. Manual rotation: create the new key, then repoint the alias with aws kms update-alias and confirm with list-aliases (UpdateAlias returns no output). Keep the original key enabled so it can still decrypt. Symmetric Decrypt calls can omit KeyId because the ciphertext identifies its key; asymmetric Decrypt and Verify, and HMAC VerifyMac, need the correct KeyId, so an alias that has moved will fail for older data.

Two behaviours catch teams out: AWS does not rotate a disabled key (and rotates immediately on re-enable if a date was missed), and a key pending deletion shows rotation as false until deletion is cancelled. See the AWS KMS Security Guide for key policy and grant design.

Rotate in Azure Key Vault

Availability: rotation policies apply per key in Key Vault, with an extra charge per scheduled rotation. Keys imported from an on-premises HSM are rotated by importing new material, prompted by the Notify action.

  1. Grant the right role: Key Vault Crypto Officer (Azure RBAC), or the Rotate, Set Rotation Policy and Get Rotation Policy key permissions under access policies.
  2. Set a rotation policy: for example, Microsoft's sample uses timeAfterCreate of P18M with an expiryTime of P2Y and a Notify action at P30D before expiry, applied with az keyvault key rotation-policy update. Expiry applies to the newly rotated version, not the current one. Microsoft recommends rotating encryption keys at least every two years.
  3. Rotate on demand with az keyvault key rotate when an event calls for it.
  4. Use versionless key URIs in consuming services so they pick up the new version; Microsoft notes services can take about one hour to 24 hours or more to detect it. Azure Storage, for example, checks once a day when the key version is left empty, and Microsoft advises waiting 24 hours before disabling the older version. A storage account pinned to a version stays on it until you update the URI.
  5. Keep both versions enabled until every DEK wrapped by the old version has been re-wrapped, then disable the old version.
  6. Audit coverage with the built-in Azure Policy definition "Keys should have a rotation policy ensuring that their rotation is scheduled within the specified number of days after creation" (for example 730 days, effect Audit). Compliance results can take up to 24 hours.

Microsoft notes that Azure Storage key rotation is not logged to Azure Monitor logs for the storage account, so take rotation evidence from Key Vault. Key vaults used for storage customer-managed keys need soft delete and purge protection on. See the Azure Key Vault Security Guide.

Rotate in Google Cloud KMS

Availability: automatic rotation applies to symmetric keys. Asymmetric signing and encryption keys are rotated manually by creating a version and distributing the new public key. Rotating requires the Cloud KMS Admin role; re-encrypting data also needs Cloud KMS CryptoKey Encrypter/Decrypter.

  1. Set a schedule: with gcloud kms keys update (rotation period and next rotation time) or Edit Rotation Period in the console. Google cites a fixed period such as 90 days as an example and suggests basing lifetime on key age or on the volume of messages per version, referencing NIST SP 800-38D limits for GCM.
  2. Rotate now: gcloud kms keys versions create, then set the new version as primary. Google states the primary change usually takes effect within a minute but can take up to three hours, during which the previous primary may still encrypt.
  3. Check each CMEK service's behaviour: Google documents three patterns. Cloud Storage buckets, BigQuery, Pub/Sub topics and Spanner use the new version for new data while existing data keeps the original; Dataflow, Firestore and Datastore apply the new version to existing data as well; Cloud Scheduler, Workflows and Eventarc keep using the version that was primary when CMEK was configured.
  4. Remove a schedule with --remove-rotation-schedule only where a documented manual process replaces it; Google advises against relying on irregular manual rotation as a primary control.

Rotation does not disable or destroy earlier versions, and each enabled version keeps incurring cost. See the Cloud KMS and Cloud HSM Guide.

Decide when to re-encrypt

Re-encryption means decrypting data (or unwrapping DEKs) under the old material and encrypting it again under the new. It costs compute, I/O and change risk, so tie it to a trigger.

SituationRe-wrap DEKsRe-encrypt dataReasoning
Scheduled rotation, no incidentWhere the service does itNoLimits material lifetime for new data; old material remains protected by KMS access control
KMS key policy or IAM abused, no plaintext DEK exposureYesUsually noFix access first, rotate, re-wrap so old material can be disabled
Host or app that held plaintext DEKs compromisedYesYes, for data under those DEKsAWS states rotation does not mitigate a compromised data key
Need to destroy an old key version (cost, decommissioning, crypto-shredding plan)YesYes, for anything still depending on itDestroyed material makes dependent data unrecoverable
Algorithm or key store change (for example moving to an HSM-backed or external key)N/AYesThis is a migration; see the Cloud key management service (KMS) migration playbook
Contract or regulator requires data under current materialYesAs specifiedRecord the requirement and the evidence of completion

For a small estate, re-encrypting by copying objects in place is often simplest. For large data stores, re-encrypt by data class, highest sensitivity first, and accept that low-risk archives may keep older material until they expire. If a suspected compromise triggered the work, follow the Encryption Key Compromise Playbook for scoping.

Where identity fits

Every rotation step is performed by a role: the pipeline or automation account that holds kms:EnableKeyRotation, Key Vault Crypto Officer or Cloud KMS Admin, and the service identities (Azure managed identities with wrapkey, unwrapkey and get, Google service agents, AWS service principals) that wrap and unwrap DEKs. Keep rotation and re-encryption rights with a small set of named non-human identities, separate from key deletion rights, and review them with your other machine credentials. See Credential Rotation at Scale.

Rollout, testing and rollback

  1. Inventory: list customer-managed keys per account, subscription and project with key type, origin, rotation status, consuming services and whether callers use an alias, versionless URI or pinned version.
  2. Fix indirection first: move hard-coded key IDs and pinned versions to aliases or versionless URIs in non-production, then production.
  3. Enable schedules in a test environment: rotate on demand once, confirm reads of old data and writes of new data, and confirm the rotation event reaches your log platform.
  4. Roll out by environment and data class, starting with keys protecting lower-risk data.
  5. Re-encrypt only where the decision table says so, with a job that records object counts processed and failures.
  6. Retire old material in two steps: disable the old version or key, watch for decrypt failures over an agreed window, then schedule destruction or deletion. Google keeps a version scheduled for destruction restorable for the configured period.
  7. Roll back by re-enabling the old version, pointing the alias back (AWS), or setting the earlier version as primary (Google Cloud). Rotation itself does not need reversing because old material still decrypts.

Detection and measurement

Alert on rotation turned off (DisableKeyRotation in CloudTrail, rotation policy changes in Key Vault diagnostic logs, rotation schedule removed in Cloud Audit Logs), on key versions disabled or scheduled for destruction, and on decrypt failures after a version change. The Cloud key management service (KMS) health check covers the quarterly audit; the metrics here are specific to rotation work.

  • Rotation coverage: percentage of eligible symmetric customer-managed keys with an automatic schedule within your standard.
  • Manual rotation currency: asymmetric, HMAC, imported and external keys rotated within their documented period.
  • Pinned references: count of workloads using pinned key versions or raw key IDs, trending to zero.
  • Old version dependency: data volume still protected only by retired-candidate versions.
  • Re-encryption completion: time from trigger to verified completion for incident-driven jobs.

Framework mapping

FrameworkReferenceHow rotation work supports it
NIST SP 800-53 Rev 5SC-12, SC-13, SC-28Key management lifecycle, approved cryptography, protection of data at rest
NIST CSF 2.0PR.DS-01, ID.AM-08Data-at-rest protection and lifecycle management of keys and services
CIS Controls v8.1Control 3 (Data Protection)Encryption of sensitive data at rest and its key handling
ISO/IEC 27001:2022 Annex AA.8.24 Use of cryptographyRules for key lifecycle, including rotation and retirement

Common failure patterns

  • Treating rotation as re-encryption: a compromised data key stays usable against old data after the KEK rotates.
  • Disabling the old version too early: Azure services that check daily, or Google CMEK services that keep the original version, fail reads after the old version is disabled.
  • Moving an alias for asymmetric or HMAC keys: Verify and VerifyMac calls that pass the alias fail for data signed under the previous key.
  • Pinned versions: a storage account or app pinned to a version never picks up rotated material, so coverage reports look healthy while data uses old material.
  • Rotation on disabled keys assumed: AWS skips rotation on disabled keys, so periodic reports must check the actual last rotation date.
  • Destroying without a dependency check: destruction after the restore window is irreversible, and the data under that version is lost.

Practitioner checklist

  • Inventory keys with type, origin, rotation state and how callers reference them.
  • Replace pinned key versions and raw IDs with aliases or versionless URIs.
  • Enable automatic rotation on every eligible symmetric key within your standard period.
  • Document manual rotation for asymmetric, HMAC, imported and external keys, with reminders.
  • Check each consuming service's documented rotation behaviour before retiring material.
  • Apply the re-encryption decision table and record the trigger for each job.
  • Disable before destroying, and watch for decrypt failures over an agreed window.
  • Alert on rotation disabled, schedules removed and versions scheduled for destruction.

Standards and references

Related NHI Mgmt Group resources: Cloud Key Management Services Mapped · Envelope Encryption and KMS Integration Patterns Guide · Cloud key management service (KMS) health check · Cryptographic Key Management Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.