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.
| Behaviour | AWS KMS | Azure Key Vault | Google Cloud KMS |
|---|---|---|---|
| Automatic rotation | Symmetric keys with AWS_KMS origin; RotationPeriodInDays 90 to 2560, default 365 | Rotation policy per key: a set time after creation or before expiry, minimum seven days | Symmetric keys; rotation period from 1 day to 100 years |
| Rotate now | On-demand rotation (RotateKeyOnDemand) for symmetric AWS_KMS and imported (EXTERNAL) keys | az keyvault key rotate or Invoke-AzKeyVaultKeyRotation | Create a new key version and set it as primary |
| Manual rotation by new key or version | Asymmetric, HMAC and custom key store keys: new KMS key plus alias update | Imported HSM keys: Notify action reminds you to import and rotate | Asymmetric signing and encryption keys: new version, distribute public key |
| What callers reference | Key ID or ARN unchanged on rotation; aliases for manual rotation | Versionless key URI for services; versioned URI stored with data | Key resource name; encryption uses the primary version |
| Decrypting older data | KMS selects the matching material automatically | Old version must stay enabled until DEKs are re-wrapped | Old version must stay enabled, not disabled or destroyed |
| Rotation evidence | CloudTrail RotateKey event, EventBridge "KMS CMK Rotation" event, ListKeyRotations | Key versions list; near expiry event through Event Grid | Key versions list and Cloud Audit Logs entries |
| Cost note from the docs | Monthly charge for the first and second rotations of material; later rotations not billed | Extra cost for each scheduled rotation | Each 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.
- Turn on automatic rotation: call EnableKeyRotation with a RotationPeriodInDays value (90 to 2560). The caller needs
kms:EnableKeyRotationin the key policy, and the call works only in the key's own account. Use thekms:RotationPeriodInDayscondition key to stop principals setting periods outside your standard. - Check status: GetKeyRotationStatus confirms rotation is on and shows in-progress on-demand rotations; ListKeyRotations lists completed ones.
- 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.
- 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.
- Manual rotation: create the new key, then repoint the alias with
aws kms update-aliasand confirm withlist-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.
- 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.
- Set a rotation policy: for example, Microsoft's sample uses
timeAfterCreateof P18M with anexpiryTimeof P2Y and a Notify action at P30D before expiry, applied withaz 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. - Rotate on demand with
az keyvault key rotatewhen an event calls for it. - 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.
- Keep both versions enabled until every DEK wrapped by the old version has been re-wrapped, then disable the old version.
- 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.
- 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. - 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. - 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.
- Remove a schedule with
--remove-rotation-scheduleonly 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.
| Situation | Re-wrap DEKs | Re-encrypt data | Reasoning |
|---|---|---|---|
| Scheduled rotation, no incident | Where the service does it | No | Limits material lifetime for new data; old material remains protected by KMS access control |
| KMS key policy or IAM abused, no plaintext DEK exposure | Yes | Usually no | Fix access first, rotate, re-wrap so old material can be disabled |
| Host or app that held plaintext DEKs compromised | Yes | Yes, for data under those DEKs | AWS states rotation does not mitigate a compromised data key |
| Need to destroy an old key version (cost, decommissioning, crypto-shredding plan) | Yes | Yes, for anything still depending on it | Destroyed material makes dependent data unrecoverable |
| Algorithm or key store change (for example moving to an HSM-backed or external key) | N/A | Yes | This is a migration; see the Cloud key management service (KMS) migration playbook |
| Contract or regulator requires data under current material | Yes | As specified | Record 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
- 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.
- Fix indirection first: move hard-coded key IDs and pinned versions to aliases or versionless URIs in non-production, then production.
- 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.
- Roll out by environment and data class, starting with keys protecting lower-risk data.
- Re-encrypt only where the decision table says so, with a job that records object counts processed and failures.
- 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.
- 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
| Framework | Reference | How rotation work supports it |
|---|---|---|
| NIST SP 800-53 Rev 5 | SC-12, SC-13, SC-28 | Key management lifecycle, approved cryptography, protection of data at rest |
| NIST CSF 2.0 | PR.DS-01, ID.AM-08 | Data-at-rest protection and lifecycle management of keys and services |
| CIS Controls v8.1 | Control 3 (Data Protection) | Encryption of sensitive data at rest and its key handling |
| ISO/IEC 27001:2022 Annex A | A.8.24 Use of cryptography | Rules 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
- AWS: Rotate AWS KMS keys
- AWS: Manual key rotation
- AWS: EnableKeyRotation API reference
- Microsoft: Configure cryptographic key auto-rotation in Azure Key Vault
- Microsoft: Customer-managed keys for Azure Storage encryption
- Google Cloud: Rotate a key
- Google Cloud: CMEK key rotation
- Google Cloud: Re-encrypt data
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