Cloud KMS encryption keys should rotate at least every 90 days
This check looks at the rotation period set on each Cloud KMS encryption key. The safe setting is automatic rotation with a period of 90 days or less.
Why it matters
The longer one key version stays in use, the more data it protects and the more time there is for it to be exposed through a leak or a mistake. Rotating on a schedule limits how much data depends on any single key version and makes rotation a routine task rather than an emergency one.
Google describes key rotation as a way to limit the amount of data protected by one key version and to reduce the impact of a compromise. See Key rotation in the Cloud KMS documentation. A key without a rotation schedule only rotates if someone remembers to do it.
How to check it yourself
In the Google Cloud console open Security, then Key Management, choose the key ring and the key, and read the Rotation period and Next rotation fields. A key with no rotation period is a finding, and so is a period longer than 90 days.
gcloud kms keyrings list --location=global --project=EXAMPLE_PROJECT
gcloud kms keys list --keyring=EXAMPLE_RING --location=global \
--project=EXAMPLE_PROJECT \
--format="table(name,purpose,rotationPeriod,nextRotationTime)"Both commands only list metadata. Repeat for each location and project in scope. Automatic rotation applies to symmetric encryption keys, so keys of other purposes need a different process. Run read-only commands on a test environment or with a read-only role first.
How to fix it
In the console open the key, choose Edit rotation period, set a period of 90 days or less and a start time for the next rotation. From the command line:
gcloud kms keys update EXAMPLE_KEY --keyring=EXAMPLE_RING \
--location=global --project=EXAMPLE_PROJECT \
--rotation-period=90d \
--next-rotation-time=2027-01-01T00:00:00ZThis writes to your project, so you run it. ConfigCobra never changes your cloud. For keys that cannot rotate automatically, schedule a manual rotation and keep a record of when it is due.
What changes when you fix it
The affected resources are the services and data protected by customer-managed keys. A rotation adds a new primary key version for new encryption work.
- Existing data is not re-encrypted and old key versions stay available, so data encrypted earlier can still be read.
- Applications that call Cloud KMS by key name pick up the new version without code changes.
- Anything that pins a specific key version, such as an older integration, keeps using that version and needs a separate review.
- The number of key versions grows over time, so decide how long you keep old versions.
Rotation takes effect at the next rotation time you set, so you can pick a quiet window.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Google Cloud Platform Foundation v5.0.0 | 1.11 | Level 1 |
More checks in Identity and Access Management
- Use corporate-managed login credentials instead of consumer accountsCIS 1.2
- Enforce multi-factor authentication for all non-service accountsCIS 1.3
- Enforce security-key two-factor authentication for all admin accountsCIS 1.4
- Use only GCP-managed keys for each service account (no user-managed keys)CIS 1.5
- Ensure service accounts hold no admin (owner/editor) privilegesCIS 1.6
Go further
- Identity and Access Management21 controls in this section
- CIS Google Cloud Platform Foundation v5.0.093 controls
- CIS Google Cloud Platform Foundation checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftScheduled scans, drift detection and email alerts when a control regresses
Check this on your Google Cloud
ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.