Back to controls

Ensure Cloud Spanner uses CMEK for regulated data

Customer-managed encryption keys (CMEK) provide stronger governance and key lifecycle control for regulated workloads.

Category

Controls

Medium

Applies to

Google Cloud

Coverage

1 queries

Asset types

1 covered

Overview

Customer-managed encryption keys (CMEK) provide stronger governance and key lifecycle control for regulated workloads.

Why this matters

For regulated data, teams often need provable control over key use, rotation, and disablement.

Important note

Spanner CMEK is applied when you create a database or restore into a new database. It is not a simple in-place toggle for an existing database that already uses Google-managed encryption.

Remediation guidance

Google Cloud Remediation

Service-wide fix (recommended): define which Spanner workloads must use CMEK, pre-approve the key locations, and build the requirement into database creation workflows.

When to use service-wide remediation

Use the service-wide path when multiple teams create Spanner databases in regulated projects.

Google Cloud console

  1. Open the Spanner instance that will host the database.
  2. Choose Create database.
  3. Expand Show encryption options.
  4. Select Cloud KMS key and choose the approved key.
  5. Create the database and verify the encryption information on the database details page.

Google Cloud CLI

Create a CMEK-protected database:

gcloud spanner databases create <database-name> \
  --instance=<instance-name> \
  --kms-key=projects/<kms-project>/locations/<kms-location>/keyRings/<keyring>/cryptoKeys/<key>

Validate the encryption configuration:

gcloud spanner databases describe <database-name> \
  --instance=<instance-name>

Operational notes

  • This is not an in-place update for an existing non-CMEK database. The usual fix is to create a new CMEK-protected database and migrate by backup and restore or by export and import.
  • In multi-region or custom instance configurations, you might need multiple regional keys instead of a single key.
  • The Spanner service agent must be granted roles/cloudkms.cryptoKeyEncrypterDecrypter on the selected key or keys.

References

  • https://docs.cloud.google.com/spanner/docs/use-cmek
  • https://docs.cloud.google.com/sdk/gcloud/reference/spanner/databases/create
  • https://docs.cloud.google.com/spanner/docs/cmek

Query logic

These are the stored checks tied to this control.

Spanner instances without CMEK

Connectors

Google Cloud

Covered asset types

CloudSpanner

Expected check: eq []

{ cloudSpannerInstances(where: { OR: [ { kmsKeyName: "" }, { kmsKeyName: null } ] }) { ...AssetFragment } }
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon