Join our Newsletter — 33% off our NHI Course
Home› Guides› Cloud KMS and Cloud HSM Guide: Key Rings,…
Guide Cloud Security

Cloud KMS and Cloud HSM Guide: Key Rings, CMEK, EKM and Autokey Controls

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 13 min read
On this page

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) and constraints/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.

ResourceResource nameProperties that matter for security
Key ringprojects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RINGGroups keys in one location for access management; cannot be deleted; cannot move location
Key (CryptoKey).../keyRings/KEY_RING/cryptoKeys/KEY_NAMEPurpose, protection level and destroy-scheduled duration fixed at creation; names cannot be reused
Key version.../cryptoKeys/KEY_NAME/cryptoKeyVersions/NHolds the key material; states Enabled, Disabled, Scheduled for destruction, Destroyed (plus pending and import states)
Import jobUnder the key ringWraps key material you bring (BYOK); needs Cloud KMS Importer
EKM connectionPer locationDefines how Cloud KMS reaches an external key manager over VPC

Protection levels

Protection levelWhere key material livesChoose it whenTrade-off
SOFTWARECloud KMS softwareGeneral CMEK with lowest cost and latencyNo hardware boundary
HSM (multi-tenant Cloud HSM)Google-managed FIPS 140-2 Level 3 certified HSM clusterPolicy or regulation requires HSM-protected keys; default for AutokeyNot in every multi-region; higher cost
HSM_SINGLE_TENANTA dedicated single-tenant HSM instance in the same location as the key ringContractual requirement for dedicated hardwareSubset of locations; instance management overhead
EXTERNALYour external key manager, reached over the internetKey material must never be held by the cloud providerInternet reliability and latency; partner support contract needed
EXTERNAL_VPCYour external key manager, reached over a VPC networkAs EXTERNAL with a private pathRegional 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

RoleRole IDGrantsGive it to
Cloud KMS Adminroles/cloudkms.adminCreate, rotate, disable, destroy and set IAM on keys; no encrypt, decrypt or signKey custodians, via just-in-time elevation
CryptoKey Encrypter/Decrypterroles/cloudkms.cryptoKeyEncrypterDecrypterEncrypt and decryptCMEK service agents, application service accounts
CryptoKey Encrypter / Decrypterroles/cloudkms.cryptoKeyEncrypter, roles/cloudkms.cryptoKeyDecrypterOne direction onlyWrite-only producers, read-only consumers
Signer/Verifierroles/cloudkms.signerVerifierSign, verify, get public keyCode-signing or token-signing workloads
Crypto Operatorroles/cloudkms.cryptoOperatorAll cryptographic operationsRarely justified; prefer narrower roles
Importerroles/cloudkms.importerImport key versions, manage import jobsBYOK ceremony operators
EkmConnections Adminroles/cloudkms.ekmConnectionsAdminManage EKM connectionsNetwork and key management engineers
Viewer / Protected Resources Viewerroles/cloudkms.viewer, roles/cloudkms.protectedResourcesViewerMetadata and key usage trackingAudit and posture teams
Autokey Admin / Autokey Userroles/cloudkms.autokeyAdmin, roles/cloudkms.autokeyUserConfigure Autokey; use KeyHandle resourcesPlatform team; developers requesting keys
  • Avoid basic roles: Google's guidance is to avoid owner, editor and viewer in production, and owner in 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) and cloudkms.cryptoKeyVersions.destroy, which needs custom roles. Combine this with constraints/cloudkms.disableBeforeDestroy.
  • Who can change IAM is the real admin: anyone with setIamPolicy on 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

ConstraintType and settingEffect
constraints/gcp.restrictNonCmekServicesList; Deny values such as bigquery.googleapis.comCreating resources in listed services fails without a Cloud KMS key; removing CMEK is blocked
constraints/gcp.restrictCmekCryptoKeyProjectsList; Allow values such as under:folders/FOLDER_ID or projects/KEY_PROJECTOnly keys from approved projects or folders can be chosen
constraints/cloudkms.minimumDestroyScheduledDurationValues 7d, 15d, 30d, 60d, 90d, 120dMinimum destruction window for new keys; the lowest value set in the hierarchy applies
constraints/cloudkms.disableBeforeDestroyBoolean, enforce trueA 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.check to 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

EventAudit log typeMethod or filterWhy it matters
Key version destroyedAdmin ActivityprotoPayload.methodName="DestroyCryptoKeyVersion"Crypto-shredding or sabotage (ATT&CK T1485 Data Destruction)
IAM changed on key or key ringAdmin ActivityprotoPayload.methodName="SetIamPolicy"New principal able to use or manage keys
Primary version changedAdmin ActivityUpdateCryptoKeyPrimaryVersionUnplanned rotation or rollback
EKM connection changedAdmin ActivityCreateEkmConnection, UpdateEkmConnection, UpdateEkmConfigExternal key path redirected
Encrypt, Decrypt, AsymmetricSign, MacSignData Access (DATA_READ)Enable Data Access logs for cloudkms.googleapis.comWho used a key, from where; bulk decrypt from an unusual identity
Get and List on keys, GetIamPolicyData Access (ADMIN_READ)SameReconnaissance 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.minimumDestroyScheduledDuration at the organisation (for example 30d or more for production) and constraints/cloudkms.disableBeforeDestroy to 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

  1. Inventory: list resources by encryption type with key usage tracking and Cloud Asset Inventory; record which services in scope support CMEK.
  2. Design: decide key projects, locations (keys cannot move), protection levels and destroy durations. Write these down before creating anything, because key rings are permanent.
  3. Pilot: enable Autokey or manual CMEK in one non-production folder; confirm service agents have only Encrypter/Decrypter on their keys.
  4. Constrain: apply restrictCmekCryptoKeyProjects first (low risk), then restrictNonCmekServices service by service, testing that dependent resources still create.
  5. Migrate: recreate or re-key existing resources that need CMEK; the constraints do not touch them.
  6. 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 RestoreCryptoKeyVersion within the window.

Framework mapping

Control areaNIST SP 800-53 Rev 5NIST CSF 2.0CIS Controls v8.1ISO/IEC 27001:2022 Annex A
Key lifecycle, rotation, destructionSC-12PR.DS-013 Data ProtectionA.8.24 Use of cryptography
CMEK at rest and protection levelsSC-28, SC-13PR.DS-013 Data ProtectionA.8.24 Use of cryptography
Admin versus use separationAC-5, AC-6PR.AA-056 Access Control ManagementA.5.3 Segregation of duties, A.8.2 Privileged access rights
KMS audit loggingAU-2, AU-12DE.CM-098 Audit Log ManagementA.8.15 Logging
External key manager dependencySC-12GV.SC-0515 Service Provider ManagementA.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.restrictNonCmekServices and gcp.restrictCmekCryptoKeyProjects together for regulated folders.
  • Set cloudkms.minimumDestroyScheduledDuration and cloudkms.disableBeforeDestroy at 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

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

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.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

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 the PDF box to continue.