Customer-managed encryption keys in Google Cloud only add control if the people who can manage, use and destroy those keys are different people, and if the organisation can prove every resource actually uses them. Many CMEK programmes stop at "the bucket has a key", while the key sits in the same project as the data, project owners can both rotate and use it, Data Access logs for encrypt and decrypt are off, and nothing stops a team creating a new dataset with Google default encryption. This guide covers Cloud KMS and Cloud HSM as platforms: the resource hierarchy and protection levels, the IAM roles that separate administration from use, the organisation policies that make CMEK mandatory, Cloud External Key Manager (EKM) for sovereignty, Autokey, and logging. It is for Google Cloud platform and security engineers and for the people who sign off encryption controls. For key management principles that apply across providers, read the Cryptographic Key Management Guide first.
This is an independent guide from NHI Mgmt Group, based on Google Cloud's public documentation as of November 2026. It is not sponsored or reviewed by Google Cloud. Product features change, so confirm settings against Google Cloud's current documentation.
Key takeaways
- Admin and use are separate roles. Cloud KMS Admin manages keys but cannot encrypt, decrypt or sign; give it to key custodians and give CryptoKey Encrypter/Decrypter to service agents and applications only.
- Some choices are permanent. Key rings cannot be deleted, keys cannot change location, purpose or protection level, and the scheduled-for-destruction period is fixed when a key is created (default 30 days, range 24 hours to 120 days).
- Make CMEK mandatory with two constraints.
constraints/gcp.restrictNonCmekServices(Deny list of services) andconstraints/gcp.restrictCmekCryptoKeyProjects(Allow list of key projects) together enforce CMEK from approved key projects, for new resources only. - EKM trades availability for control. With EXTERNAL or EXTERNAL_VPC keys the key material stays in your external manager; if it is unreachable Cloud KMS returns FAILED_PRECONDITION and some services can lose data.
- Turn on Data Access logs for Cloud KMS. Encrypt, Decrypt and AsymmetricSign are DATA_READ operations, so without Data Access logging you cannot see who used a key.
How identity and access work in Cloud KMS and Cloud HSM
Cloud KMS resources form a fixed hierarchy inside a project and a location, and IAM can be granted at the project, key ring or key level.
| Resource | Resource name | Properties that matter for security |
|---|---|---|
| Key ring | projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING | Groups keys in one location for access management; cannot be deleted; cannot move location |
| Key (CryptoKey) | .../keyRings/KEY_RING/cryptoKeys/KEY_NAME | Purpose, protection level and destroy-scheduled duration fixed at creation; names cannot be reused |
| Key version | .../cryptoKeys/KEY_NAME/cryptoKeyVersions/N | Holds the key material; states Enabled, Disabled, Scheduled for destruction, Destroyed (plus pending and import states) |
| Import job | Under the key ring | Wraps key material you bring (BYOK); needs Cloud KMS Importer |
| EKM connection | Per location | Defines how Cloud KMS reaches an external key manager over VPC |
Protection levels
| Protection level | Where key material lives | Choose it when | Trade-off |
|---|---|---|---|
SOFTWARE | Cloud KMS software | General CMEK with lowest cost and latency | No hardware boundary |
HSM (multi-tenant Cloud HSM) | Google-managed FIPS 140-2 Level 3 certified HSM cluster | Policy or regulation requires HSM-protected keys; default for Autokey | Not in every multi-region; higher cost |
HSM_SINGLE_TENANT | A dedicated single-tenant HSM instance in the same location as the key ring | Contractual requirement for dedicated hardware | Subset of locations; instance management overhead |
EXTERNAL | Your external key manager, reached over the internet | Key material must never be held by the cloud provider | Internet reliability and latency; partner support contract needed |
EXTERNAL_VPC | Your external key manager, reached over a VPC network | As EXTERNAL with a private path | Regional locations only, not multi-regions; not global |
CMEK-integrated services do not call Cloud KMS as the user. Each service uses a per-project service agent, and it is that service agent that needs roles/cloudkms.cryptoKeyEncrypterDecrypter on the key. Revoking that grant, or disabling or destroying the key, makes the data inaccessible.
Admin roles and privileged access
| Role | Role ID | Grants | Give it to |
|---|---|---|---|
| Cloud KMS Admin | roles/cloudkms.admin | Create, rotate, disable, destroy and set IAM on keys; no encrypt, decrypt or sign | Key custodians, via just-in-time elevation |
| CryptoKey Encrypter/Decrypter | roles/cloudkms.cryptoKeyEncrypterDecrypter | Encrypt and decrypt | CMEK service agents, application service accounts |
| CryptoKey Encrypter / Decrypter | roles/cloudkms.cryptoKeyEncrypter, roles/cloudkms.cryptoKeyDecrypter | One direction only | Write-only producers, read-only consumers |
| Signer/Verifier | roles/cloudkms.signerVerifier | Sign, verify, get public key | Code-signing or token-signing workloads |
| Crypto Operator | roles/cloudkms.cryptoOperator | All cryptographic operations | Rarely justified; prefer narrower roles |
| Importer | roles/cloudkms.importer | Import key versions, manage import jobs | BYOK ceremony operators |
| EkmConnections Admin | roles/cloudkms.ekmConnectionsAdmin | Manage EKM connections | Network and key management engineers |
| Viewer / Protected Resources Viewer | roles/cloudkms.viewer, roles/cloudkms.protectedResourcesViewer | Metadata and key usage tracking | Audit and posture teams |
| Autokey Admin / Autokey User | roles/cloudkms.autokeyAdmin, roles/cloudkms.autokeyUser | Configure Autokey; use KeyHandle resources | Platform team; developers requesting keys |
- Avoid basic roles: Google's guidance is to avoid
owner,editorandviewerin production, andownerin particular, because one principal can then both create and use keys. - Separate the key project: host keys in a dedicated key project, away from the data projects they protect, so a data project owner holds no rights over the key's IAM policy.
- Split destruction: Google recommends that no single user holds both
cloudkms.cryptoKeyVersions.update(disable) andcloudkms.cryptoKeyVersions.destroy, which needs custom roles. Combine this withconstraints/cloudkms.disableBeforeDestroy. - Who can change IAM is the real admin: anyone with
setIamPolicyon the key project can grant themselves Encrypter/Decrypter (ATT&CK T1098.003 Additional Cloud Roles). Keep Project IAM Admin on key projects to a break-glass group. See the Google Cloud IAM and Service Accounts Guide.
Integrations, API tokens and service accounts
CMEK organisation policies
| Constraint | Type and setting | Effect |
|---|---|---|
constraints/gcp.restrictNonCmekServices | List; Deny values such as bigquery.googleapis.com | Creating resources in listed services fails without a Cloud KMS key; removing CMEK is blocked |
constraints/gcp.restrictCmekCryptoKeyProjects | List; Allow values such as under:folders/FOLDER_ID or projects/KEY_PROJECT | Only keys from approved projects or folders can be chosen |
constraints/cloudkms.minimumDestroyScheduledDuration | Values 7d, 15d, 30d, 60d, 90d, 120d | Minimum destruction window for new keys; the lowest value set in the hierarchy applies |
constraints/cloudkms.disableBeforeDestroy | Boolean, enforce true | A version must be disabled before it can be scheduled for destruction |
- Use both CMEK constraints: Google notes the key-project constraint alone does not guarantee CMEK is used, because default encryption is still available.
- New resources only: the CMEK policies apply when a resource is created or its key changed, so existing default-encrypted resources need a separate inventory and migration.
- Know the exceptions: BigQuery enforcement is partial (dataset default key, query jobs), GKE enforcement in preview covers the node boot disk only, and Cloud Logging built-in buckets need separate configuration. Requiring CMEK for one service can block another service it creates resources in.
- Console permissions: users need
orgpolicy.policies.checkto see which keys are allowed; custom roles must add it. See the Google Cloud Organization Policy Guide.
Cloud KMS Autokey
Autokey creates key rings and keys on demand when a developer creates a resource, and grants the service agent the encrypt and decrypt role. In the dedicated-project model, enabled on a folder, keys go to a designated key project; in the same-project model they sit beside the resource. Defaults are multi-tenant Cloud HSM, AES-256 GCM, a one-year rotation period and a key ring named autokey. Granularity varies: one key per Cloud SQL instance or Compute Engine disk, per GKE cluster, per Cloud Storage bucket, per BigQuery dataset, and one per location for Cloud Run and Secret Manager. Google recommends Autokey when its keys meet all your requirements; the dedicated-project model is the better fit for separation of duties.
Cloud External Key Manager
- Split key material: each EKM key version has external key material in your manager, a key reference, and (for symmetric keys) internal material in Cloud KMS. Both are needed to decrypt.
- Management modes (VPC): manual mode means creating, rotating and destroying keys in both places, with no automatic rotation; coordinated mode lets Cloud EKM ask a supporting partner to create, rotate and destroy keys.
- Key Access Justifications: each request carries a justification reason code and your EKM policy decides whether to allow it, which gives you a decision point Google cannot change.
- Availability risk: losing either part makes data unrecoverable, and an identical key version cannot be recreated from the same reference. Google's example: Spanner deletes a database if its key stays unavailable for more than 30 consecutive days. Partners listed by Google are Fortanix, Futurex and Thales; you need a support contract with yours.
- Decision: choose EKM when sovereignty or contract terms require key material outside the provider and you can run a highly available external manager; choose Cloud HSM when the requirement is hardware protection and low latency. See the BYOK, HYOK and External Key Management Guide.
Logging and detection
| Event | Audit log type | Method or filter | Why it matters |
|---|---|---|---|
| Key version destroyed | Admin Activity | protoPayload.methodName="DestroyCryptoKeyVersion" | Crypto-shredding or sabotage (ATT&CK T1485 Data Destruction) |
| IAM changed on key or key ring | Admin Activity | protoPayload.methodName="SetIamPolicy" | New principal able to use or manage keys |
| Primary version changed | Admin Activity | UpdateCryptoKeyPrimaryVersion | Unplanned rotation or rollback |
| EKM connection changed | Admin Activity | CreateEkmConnection, UpdateEkmConnection, UpdateEkmConfig | External key path redirected |
| Encrypt, Decrypt, AsymmetricSign, MacSign | Data Access (DATA_READ) | Enable Data Access logs for cloudkms.googleapis.com | Who used a key, from where; bulk decrypt from an unusual identity |
| Get and List on keys, GetIamPolicy | Data Access (ADMIN_READ) | Same | Reconnaissance of key inventory |
- Volume: decrypt logs for busy CMEK services are large. Route them through a log sink to a cheaper bucket or exclude known service agents only after baselining. See the Google Cloud Audit Logs and Log Sinks Guide.
- Key usage tracking: shows which resources, projects and products use a key, which is how you check impact before disabling a version.
- Disable is also an attack: an attacker with admin rights can disable or schedule destruction of CMEK keys to make data unavailable, a ransom lever comparable to T1486 Data Encrypted for Impact. Alert on any disable or destroy outside a change.
Metrics that show it is working
- CMEK coverage: percentage of resources in regulated services using CMEK from an approved key project.
- Separation of duties: number of principals holding both admin and encrypt/decrypt rights on any key (target zero, excluding break-glass).
- Destruction safety: percentage of production keys with a destroy-scheduled duration of 30 days or more.
- Rotation: percentage of symmetric keys with an automatic rotation period set, and age of the oldest primary version.
- EKM health: FAILED_PRECONDITION error rate and external key latency per location.
Hardening baseline
- Dedicated key projects: one key project per environment or folder, no workloads in it, IAM managed by a small group.
- Destruction window: set
constraints/cloudkms.minimumDestroyScheduledDurationat the organisation (for example 30d or more for production) andconstraints/cloudkms.disableBeforeDestroyto enforce true. Remember that the per-key value cannot be changed after creation. - Rotation: set automatic rotation on symmetric keys (asymmetric keys do not rotate automatically). Rotation does not re-encrypt existing data; old versions stay enabled and billable until you disable them.
- Protection level by data class: SOFTWARE for general CMEK, HSM where policy requires hardware, EXTERNAL_VPC only where sovereignty requires it.
- Grant at the key, not the project: bind Encrypter/Decrypter to the specific service agent on the specific key.
- Logging: enable Data Access audit logs for Cloud KMS in key projects and route Admin Activity to a central sink.
- Perimeter: put key projects inside the same VPC Service Controls perimeter as the data. See the VPC Service Controls Guide.
Phased rollout
- Inventory: list resources by encryption type with key usage tracking and Cloud Asset Inventory; record which services in scope support CMEK.
- Design: decide key projects, locations (keys cannot move), protection levels and destroy durations. Write these down before creating anything, because key rings are permanent.
- Pilot: enable Autokey or manual CMEK in one non-production folder; confirm service agents have only Encrypter/Decrypter on their keys.
- Constrain: apply
restrictCmekCryptoKeyProjectsfirst (low risk), thenrestrictNonCmekServicesservice by service, testing that dependent resources still create. - Migrate: recreate or re-key existing resources that need CMEK; the constraints do not touch them.
- Roll back: remove a service from the Deny list or relax the constraint at a folder. Never "roll back" by destroying keys; restore a scheduled version to Disabled with
RestoreCryptoKeyVersionwithin the window.
Framework mapping
| Control area | NIST SP 800-53 Rev 5 | NIST CSF 2.0 | CIS Controls v8.1 | ISO/IEC 27001:2022 Annex A |
|---|---|---|---|---|
| Key lifecycle, rotation, destruction | SC-12 | PR.DS-01 | 3 Data Protection | A.8.24 Use of cryptography |
| CMEK at rest and protection levels | SC-28, SC-13 | PR.DS-01 | 3 Data Protection | A.8.24 Use of cryptography |
| Admin versus use separation | AC-5, AC-6 | PR.AA-05 | 6 Access Control Management | A.5.3 Segregation of duties, A.8.2 Privileged access rights |
| KMS audit logging | AU-2, AU-12 | DE.CM-09 | 8 Audit Log Management | A.8.15 Logging |
| External key manager dependency | SC-12 | GV.SC-05 | 15 Service Provider Management | A.5.21 Managing information security in the ICT supply chain |
Common misconfigurations
- Keys in the data project: project owners of the data can then change key IAM and grant themselves decrypt. Use a separate key project.
- Owner or Editor on key projects: basic roles collapse separation of duties. Replace them with Cloud KMS Admin plus targeted Encrypter/Decrypter grants.
- Only one CMEK constraint: restricting key projects without the Deny list still allows Google default encryption.
- Short destroy windows in production: a 24-hour window chosen for testing becomes permanent for that key. Enforce a minimum at the organisation.
- Rotation assumed to re-encrypt: rotating does not touch existing ciphertext; disabling an old version that still protects data breaks reads.
- EKM without an availability plan: external key outages surface as FAILED_PRECONDITION across every dependent service, and long outages can cause data loss in services such as Spanner.
- No Data Access logs: without them a bulk decrypt by a stolen service account key is invisible. See the Google Cloud Service Account Keys Security Guide.
Practitioner checklist
- Create dedicated key projects with no basic roles and a small, PIM-style admin group.
- Grant Cloud KMS Admin to custodians and Encrypter/Decrypter to service agents on specific keys only.
- Apply
gcp.restrictNonCmekServicesandgcp.restrictCmekCryptoKeyProjectstogether for regulated folders. - Set
cloudkms.minimumDestroyScheduledDurationandcloudkms.disableBeforeDestroyat the organisation. - Split disable and destroy permissions across different people with custom roles.
- Enable automatic rotation on symmetric keys and plan re-encryption where policy needs it.
- Choose protection level per data class and document why EXTERNAL or EXTERNAL_VPC is used.
- Enable Data Access audit logs for Cloud KMS and alert on DestroyCryptoKeyVersion, SetIamPolicy and disable operations.
- Test EKM failure behaviour for each dependent service before production.
- Inventory existing default-encrypted resources, since the constraints do not cover them.
Standards and references
- Google Cloud: Cloud KMS resources
- Google Cloud: Cloud KMS permissions and roles
- Google Cloud: CMEK organization policies
- Google Cloud: Control key version destruction
- Google Cloud: Cloud External Key Manager
- Google Cloud: Cloud KMS Autokey overview
- Google Cloud: Cloud KMS audit logging information
- Google Cloud: Cloud HSM
Related NHI Mgmt Group resources: Cryptographic Key Management Guide · BYOK, HYOK and External Key Management Guide · Cloud Customer-Managed Keys and BYOK/HYOK Decision Guide · Google Cloud Security Guide