Cloud Key Management Service in Google Cloud: Guarding the Keys to Your Data

Cloud Key Management Service in Google Cloud: Guarding the Keys to Your Data

A friendly, in-depth guide to Cloud KMS: how encryption keys are created, stored, rotated, protected and destroyed, and how to use them with your own services, with clear choices between software, hardware and external protection.

Imagine you keep valuables in a strong safe. The safe is excellent, but if you tape the key to the front door, the safe protects nothing. In the cloud, your data is the valuables, encryption is the safe, and the encryption keys are the keys. Almost every serious security incident involving encrypted data is really a story about keys: keys left in the wrong place, keys that too many people could reach, keys that nobody remembered to change, or keys that were destroyed by accident. Cloud Key Management Service, usually called Cloud KMS, is the Google Cloud service built so that keys are created, guarded, used, changed and retired with care, and so that you can prove who did what with them.

1What Is Cloud KMS?

Cloud KMS is a managed service for creating and using cryptographic keys, without ever needing to handle the raw key yourself.

Cloud KMS lets you create keys, control who may use them, and ask the service to perform cryptographic operations on your behalf, such as encrypting a piece of data, decrypting it again, signing a message or checking a signature. The most valuable property is that the secret key material can stay inside the service. Your application sends data to Cloud KMS and receives a result, and the key itself never has to appear in your code, your configuration files or your laptop.

Cloud KMS also connects to many other Google Cloud services. When a storage bucket, a database or a disk is protected with a key that you manage in Cloud KMS, the arrangement is called customer-managed encryption keys, shortened to CMEK. This gives you control: you decide who can use the key, how often it changes, and you can disable it to make the protected data unreadable.

Simple Analogy

Cloud KMS is like a bank’s safe deposit service with a very careful clerk. You never carry the master key around. Instead, you ask the clerk to lock or unlock a box for you, the clerk checks your identity, writes the request in a logbook, and does the job inside the vault.

What Cloud KMS is not

Cloud KMS is not a place to store ordinary passwords or application secrets such as database credentials. Google Cloud has a separate service for secrets. Cloud KMS manages cryptographic keys and performs cryptographic operations. It is also not a replacement for good access control, because a key that anyone can use protects nothing.

Managed
Google runs the key infrastructure
Controlled
You decide who can use each key
Audited
Key operations appear in audit logs
i
Features and Prices Change

Google adds options and adjusts prices over time. Use this guide to understand the ideas, and confirm exact capabilities, locations and prices on the official pages before making decisions.

2Why Key Management Matters

Encryption is only as strong as the care given to its keys.

Modern encryption algorithms are extremely strong. Nobody breaks them by clever mathematics. Attackers instead look for the keys, because stealing a key is far easier than defeating the algorithm. So the real security question is never just “is the data encrypted?” It is “where are the keys, who can use them, how are they changed, and could we notice misuse?”

Risk 1

Keys in Code

Developers paste keys into source files or configuration, where many people and systems can read them.

Risk 2

One Key for Everything

A single key protecting all data means one theft exposes everything.

Risk 3

Keys Never Changed

A key used for years has had years of chances to leak, and a leak gives access to years of data.

Risk 4

No Record of Use

If nobody logs key use, misuse goes unnoticed until the damage is public.

Risk 5

Accidental Loss

Destroying the only copy of a key makes the encrypted data unrecoverable forever.

Risk 6

Rules and Regulations

Many industries require proof that keys are protected in particular ways, and managed by particular people.

Simple Analogy

A burglar does not drill through a vault door if the key is under the doormat. Spending on thick doors while leaving keys lying around is a common and costly mistake.

!
Lost Keys Mean Lost Data

Strong key control cuts both ways. If a key is destroyed and no copy exists, the data it protected cannot be recovered by anyone, including Google.

3Core Concepts and Vocabulary

Learn these words once and the documentation becomes much easier to read.

Term 1

Encryption

Scrambling data with a key so only someone with the right key can read it.

Term 2

Key

A secret value used by an algorithm to lock or unlock data, or to sign and verify.

Term 3

Key Ring

A named group of keys in one location, used to organize keys and manage access to them together.

Term 4

CryptoKey

A named object that represents a key and holds one or more versions of it.

Term 5

Key Version

One numbered generation of key material inside a key. Rotation creates a new version.

Term 6

Symmetric Key

One secret that both locks and unlocks, fast and used for bulk data.

Term 7

Asymmetric Key

A pair of keys, one public and one private, used for signing or for encrypting to a recipient.

Term 8

Rotation

Creating a fresh key version on a schedule, so each version protects a limited amount of data.

Term 9

Protection Level

Where and how the key material is protected: software, hardware module or an external system.

Term 10

HSM

Hardware Security Module, a tamper-resistant device that stores keys and does cryptography inside.

Term 11

CMEK

Customer-managed encryption keys, where you control the key that protects data in a Google Cloud service.

Term 12

EKM

External Key Manager, which lets keys live in a system outside Google Cloud while services still use them.

Simple Analogy

A key ring is a labeled drawer in the key cabinet, a key is one named set of copies for a particular door, and a key version is the current edition of that copy. When the locks are changed, a new edition is made, but the old ones are kept for old doors until it is safe to throw them out.

i
Key Versus Key Version

People often mix these. A key is the stable named object you refer to. Versions inside it come and go as you rotate. Applications usually name the key and let the service pick the right version.

4Encryption Basics: Symmetric and Asymmetric

Two families of cryptography do different jobs, and Cloud KMS supports both.

Symmetric encryption uses one secret key for both locking and unlocking. It is fast, which makes it the right tool for protecting large amounts of data such as files and database contents. The trade-off is that anyone who needs to unlock the data must hold the same secret, so the secret must be shared with great care.

Asymmetric cryptography uses a pair of mathematically linked keys. The public key can be shared with anyone. The private key is kept secret. Data locked with the public key can be unlocked only by the private key, and a signature made with the private key can be checked by anyone using the public key. It is slower, so it is used for small things like exchanging secrets and proving identity.

AspectSymmetricAsymmetric
KeysOne shared secretA public and private pair
SpeedFastSlower
Best forEncrypting bulk dataDigital signatures and key exchange
Main challengeSharing the secret safelyProtecting the private key and trusting the public key
Cloud KMS exampleEncrypt and decrypt data at restSign software releases or documents
Simple Analogy

Symmetric encryption is a padlock where everyone who needs to open it has a copy of the same key. Asymmetric is a mailbox with a public slot: anyone can drop a letter in, but only the owner with the private key can open the box. For signatures, imagine a stamp only you can make, which anyone can recognize.

i
Choose by Job

Use symmetric keys to protect stored data. Use asymmetric keys when you need signatures or when parties who do not share a secret must work together.

5Envelope Encryption: The Core Pattern

Almost all cloud encryption uses a two-layer design called envelope encryption.

Sending large amounts of data to a key service for every operation would be slow and costly. Instead, data is encrypted with a data encryption key, called a DEK, which is generated locally and is used to scramble the data quickly. The DEK itself is then encrypted with a stronger, central key, called a key encryption key, or KEK, which lives in Cloud KMS. The encrypted DEK is stored next to the encrypted data. To read the data, the system asks Cloud KMS to unwrap the DEK, then uses the DEK to unlock the data.

sequenceDiagram
  participant App as Application
  participant KMS as Cloud KMS
  participant Store as Storage
  App->>App: Create a fresh data key
  App->>App: Encrypt data with the data key
  App->>KMS: Wrap the data key with the master key
  KMS-->>App: Wrapped data key
  App->>Store: Save encrypted data and wrapped data key
  Note over App,Store: Later, to read the data
  App->>Store: Fetch encrypted data and wrapped key
  App->>KMS: Unwrap the data key
  KMS-->>App: Plain data key
  App->>App: Decrypt data, then discard data key
        
FIG 1 — Envelope encryption with a data key wrapped by Cloud KMS

Why this design is so popular

Benefit

Speed

Bulk data is encrypted locally and quickly, with only a tiny key sent to the service.

Benefit

Central Control

Disabling the master key makes every wrapped data key, and so all the data, unreadable.

Benefit

Easy Rotation

Changing the master key requires re-wrapping the small data keys, not re-encrypting all data.

Benefit

Limited Exposure

Each object or chunk can have its own data key, so a stolen data key exposes only a small part.

Simple Analogy

Imagine locking each document in its own small box with a small key, then putting each small key into a bank vault. Reading a document means asking the vault for its small key. The vault holds only small keys, yet controls access to everything.

i
Services Do This for You

When you use CMEK with a Google Cloud service, the service performs envelope encryption automatically. You manage the master key in Cloud KMS, and the service handles the data keys.

6Three Ways to Control Your Encryption Keys

Google Cloud offers a spectrum from fully managed by Google to fully controlled by you.

By default, Google Cloud encrypts customer data at rest automatically, using keys that Google manages. You do not need to do anything. Some organizations want more control, for compliance or for their own security policy, and Cloud KMS provides that control in steps.

ApproachWho Manages the KeyWhat You GainWhat You Take On
Default encryptionGoogleNo effort, always onNo control over key life cycle
Customer-managed keys in Cloud KMSYou control the key, Google runs the infrastructureControl of access, rotation, disabling and auditResponsibility for key policy and avoiding accidental loss
Hardware-protected keysYou control the key, stored in certified hardwareMeets stricter regulatory demands for hardware protectionHigher cost
External keysYou, in a system outside Google CloudGoogle cannot access the key materialHighest cost, dependency on external availability

Moving to a higher level of control is a business decision. More control brings more responsibility. If you mismanage a key you control, your data may become unavailable, and no one at Google can rescue it.

Simple Analogy

It is like storing valuables. You can leave them in the hotel’s safe, rent your own box at a bank, use a box in a certified military-grade vault, or keep the only key in your own home. Each step gives you more control and asks more care.

!
Do Not Over-Engineer

Default encryption is already strong. Move to customer-managed keys when you have a real requirement such as compliance, separation of duties or the need to revoke access quickly.

7The Resource Hierarchy: Key Rings, Keys and Versions

Cloud KMS organizes keys in three levels inside a project.

flowchart TD
  P["Project"] --> KR1["Key ring: payments, location europe-west1"]
  P --> KR2["Key ring: logs, location us-central1"]
  KR1 --> K1["Key: card-data (symmetric encryption)"]
  KR1 --> K2["Key: invoice-signing (asymmetric signing)"]
  K1 --> V1["Version 1"]
  K1 --> V2["Version 2 (primary)"]
  K2 --> V3["Version 1"]
        
FIG 2 — Key rings contain keys, and keys contain versions
Level 1

Key Ring

Groups keys in one location and lets you manage access to the group. Its name must be unique within a location, and key rings themselves do not cost anything.

Level 2

Key

A named object that exists on exactly one key ring in one location. Access is managed at the key level, not for each version.

Level 3

Key Version

The actual key material, numbered from 1. Rotating a key adds a new version, and decryption needs the same version used for encryption.

Two facts matter for planning. First, resources cannot be moved to a different location after creation, so choose the location carefully at the start. Second, key rings and keys cannot be renamed, and the names of deleted keys cannot be reused, so choose names that will still make sense years later.

Simple Analogy

The key ring is a labeled cabinet drawer in a particular office. Each key in the drawer opens a particular type of door. Each key has editions numbered by year: the newest edition makes new locks, and older editions are still needed to open older locks.

i
Access at the Ring Saves Effort

Because access can be granted at the key ring, you can place keys with the same audience on the same ring and manage them together.

8Choosing Key Locations

Where a key lives affects speed, compliance and availability.

Every key ring is created in a specific location, which may be a single region, a multi-region or the global location. The location of a key determines where its key material is stored and processed. For the best results, keep the key in the same location as the data it protects: a service in one region should use a key in that same region, because this reduces delay and avoids confusing dependency across regions.

1

Follow the Data

Choose the key location that matches the location of the data or service that will use it. Many services require this match for CMEK.

2

Check Compliance Needs

Some rules require that keys stay within a country or region.

3

Consider Availability

Multi-region and global options exist for resilience, but not every protection level is offered in every location.

4

Remember It Is Permanent

You cannot move a key to another location later. If you choose wrongly, you create a new key and re-encrypt the data.

Simple Analogy

Putting a key in a different country from the lock is like keeping your front door key in a safe in another city. It might work, but every use is slower, depends on the journey, and invites questions from regulators.

!
Check Support Per Location

Not every protection level is available in every location. For example, Google documents that some external key options are not offered in certain multi-region locations. Confirm before designing.

9Key Purposes and Types

When you create a key, you decide once what it is for, and this cannot be changed later.

Every key has a purpose, which defines the operations allowed with it, such as symmetric encrypt and decrypt, asymmetric signing, asymmetric decryption, or message authentication. The purpose is set at creation and cannot be changed. Every version of the key shares the same purpose. The type, symmetric or asymmetric, is part of the purpose.

PurposeTypical UseNotes
Symmetric encrypt and decryptProtecting data at rest, wrapping data keys, CMEKHas a primary version used by default
Asymmetric signingSigning releases, documents, tokensNo primary version, so you name the version
Asymmetric decryptionReceiving data encrypted by others with your public keyPublic key can be shared widely
Message authenticationVerifying that a message was not altered, using a shared secretBoth sides need the same key

Because the purpose is permanent, plan your keys by job. One key for encrypting a database, one for signing releases and one for protecting backups, for example, each with its own access rules. Mixing jobs on a single key couples unrelated systems and makes access control clumsy.

Simple Analogy

A key blank is cut for a single type of lock when it is made. A key cut for a door cannot be re-cut into a car key. You choose the type at the start, and for another job you make another key.

i
One Job Per Key

Separate keys for separate purposes and separate data sets keep the blast radius small and make audit logs easier to read.

10Key Versions and Their States

Each key version moves through a small set of states, and knowing them prevents disasters.

stateDiagram-v2
  [*] --> Enabled
  Enabled --> Disabled: disable
  Disabled --> Enabled: re-enable
  Enabled --> ScheduledForDestruction: schedule destroy
  Disabled --> ScheduledForDestruction: schedule destroy
  ScheduledForDestruction --> Disabled: restore before deadline
  ScheduledForDestruction --> Destroyed: delay period ends
  Destroyed --> [*]
        
FIG 3 — Life cycle of a key version
State

Enabled

The only state in which a version can be used for encryption, decryption, signing or verification.

State

Disabled

Not usable, but not destroyed. This is the safe way to test whether anything still depends on a version.

State

Scheduled for Destruction

Waiting out a delay period during which the version can still be recovered.

State

Destroyed

The key material is permanently deleted. Data protected only by this version can never be decrypted.

Google’s documentation notes that versions in any state other than destroyed are billed, which is a reason to destroy versions you truly no longer need, after the safety steps in the destruction chapter. Disabling or destroying a whole key disables or destroys all of its versions at once.

Simple Analogy

The states resemble a document’s journey: in use, put in a locked drawer, placed in the shredding bin with a pickup date, and finally shredded. Anything in the bin can still be rescued until the pickup. After shredding, nothing can be done.

!
Disable First, Destroy Later

Before destroying a version, disable it and watch for failures. If nothing breaks over a sensible period, destruction is far safer.

11The Primary Version and Which Version Is Used

When you ask a key to encrypt, someone must decide which version does the work.

Symmetric encryption keys have a primary version. When you encrypt without naming a version, Cloud KMS uses the primary. The result carries information about which version was used, so decryption automatically picks the right one, as long as that version is still enabled. Asymmetric keys have no primary version, so you always specify the version, since a public key and signature belong to a particular version.

1

New Data Uses the Primary

Anything encrypted today uses the current primary version.

2

Old Data Keeps Its Version

Data encrypted earlier remembers which version protected it and still needs that version enabled to be read.

3

Rotation Changes the Primary

After rotation, the newest version becomes primary, and older versions stay available for old data.

4

Old Versions Can Retire

Once all data has been re-encrypted with newer versions, old versions can be disabled and eventually destroyed.

Simple Analogy

A company issues new staff badges every year. New staff get this year’s badge. A door lock still accepts older badges until the old edition is officially retired. The lock knows the badge year because each badge has the year printed on it.

i
Do Not Pin Applications to Versions

Applications should name the key and let Cloud KMS choose the primary version for encryption. That way rotation needs no code change.

12Key Rotation

Rotation limits how much data any single key version protects and how long a leak could matter.

Rotating a key means creating a new version and making it the primary. Older versions remain available to decrypt data they protected. Google’s documentation points out that rotation by itself is a free administrative operation, while re-encrypting existing data with the new version counts as ordinary cryptographic operations that are billed. Many organizations schedule automatic rotation for symmetric keys at a regular interval, such as every few months, and rotate immediately if a compromise is suspected.

Benefits of Rotation

  • Limits the data exposed by any one stolen key version
  • Meets many security and compliance standards
  • Builds the habit and tooling for emergency changes
  • Costs almost nothing to perform

Things to Watch

  • Old versions are still billed until destroyed
  • Old data is not automatically re-encrypted
  • Some uses, like signatures, need old public keys retained
  • Rotation does not replace controlling who can use keys

Rotation versus re-encryption

A common misunderstanding is that rotation protects data already stored. It does not by itself. Data encrypted with version 1 stays protected by version 1 until someone re-encrypts it with a newer version. If you truly need old data protected by a new key, for example after a suspected leak, you must run a re-encryption job. For many services using CMEK, the service handles key wrapping, and the exact behavior on rotation depends on the service, so read its documentation.

Simple Analogy

Changing the locks on your office means new doors get the new lock. Old filing cabinets still use the old lock until you replace theirs too. The new lock stops future problems, but cleaning up the past takes extra work.

i
Automate It

Set an automatic rotation schedule when you create a symmetric key. A rotation that depends on human memory eventually gets forgotten.

13Protection Levels at a Glance

The protection level tells you where the key lives and how strongly it is guarded.

LevelWhere Keys LiveAssuranceRelative Cost
SoftwareCryptographic operations run in software inside Google’s serviceBased on FIPS 140-3 Level 1 validated primitives, according to Google’s documentationLowest
Cloud HSM (multi-tenant)Google-owned shared hardware security modulesFIPS 140-2 Level 3 validated hardware, per Google’s documentationHigher
Single-tenant Cloud HSMDedicated partitions on Google-managed HSMs in an instance you administerIsolation from other customers; check the documentation for validation detailsHigher still
External key (over internet or VPC)Your own external key manager outside Google CloudGoogle cannot access your key materialHighest
flowchart TD
  Q["Do you have a specific requirement?"] -->|"No special rules"| S["Software keys"]
  Q -->|"Need certified hardware"| H["Cloud HSM"]
  Q -->|"Need dedicated isolated hardware"| T["Single-tenant HSM"]
  Q -->|"Google must not hold key material"| E["External key manager"]
        
FIG 4 — A simple way to pick a protection level

All levels share common features: you can use them with CMEK-integrated services (although some services do not support external keys), control them with IAM, enable or disable individual versions and see operations in audit logs. The next three chapters look at each level in turn.

Simple Analogy

The levels are like storage choices: a locked drawer in a secure office, a certified bank vault, a private vault room with your own access list, or keeping the key at your own house. Security and cost both rise as you go along that list.

i
Start From Requirements

Choose the level your rules or risk assessment require, no higher. A level above your needs only adds cost and, for external keys, availability risk.

14Software Keys

The default and cheapest option, suitable for most workloads without special regulatory requirements.

With software protection, cryptographic operations run in software inside Google’s key management service, using Google’s cryptographic module. Keys can be generated by Google or imported. Software keys are the cheapest, and for the great majority of businesses they provide excellent protection, since the keys are never exposed outside the service and every use is controlled by access rules and recorded in audit logs.

General Application Encryption

Protecting application data at rest with customer-managed keys when no rule demands hardware certification.

Development and Testing

Environments that should mirror production’s key structure at a low cost.

Signing Internal Artifacts

Signing build outputs or internal tokens where software-level assurance is acceptable.

Google’s documentation describes software keys as a good fit for workloads without specific regulatory requirements for a higher validation level. If a regulator or customer contract names a specific hardware standard, move up a level.

Simple Analogy

A software key is a secure lockbox in a well-guarded building. For nearly all everyday valuables, that is ample. Only if an insurer demands a certified bank vault do you need to go further.

i
Do Not Pay for Hardware by Habit

Teams sometimes choose hardware keys because they sound safer. Choose on requirement, not feeling, and confirm what your auditors actually ask.

15Cloud HSM: Hardware-Protected Keys

Hardware security modules keep keys inside tamper-resistant devices.

A hardware security module is a specialized physical device built so that keys inside cannot be read out, even by someone with physical access. With Cloud HSM, Google operates these devices, and your keys live and are used inside them. According to Google’s documentation, the multi-tenant HSM offering uses hardware validated to FIPS 140-2 Level 3. Each key has an attestation statement and certificate chains that can be used to verify the key and hardware properties. You use Cloud HSM through the same Cloud KMS interfaces, with no special HSM-specific code, simply by choosing the HSM protection level when creating a key.

Two forms

AspectMulti-Tenant HSMSingle-Tenant HSM
SharingGoogle-owned HSMs shared by many customers, with logical separationDedicated partitions on Google-managed HSMs in an instance you create
AdministrationGoogle manages everythingYou administer your own instance
Best forRegulated workloads needing certified hardware without managing HSM clustersCustomers needing isolation from other customers and administrative control
CostHigher than software, billed per key version and operationsHigher still, with an hourly instance charge according to the pricing page
AvailabilityOffered in many locationsLimited regions; confirm current list
Simple Analogy

Multi-tenant HSM is a safe deposit box in a large bank vault run by the bank, with a lock that even the manager cannot override. Single-tenant HSM is renting a private vault room inside the bank, with your own entry procedures.

i
Ask Auditors What They Need

Many requirements can be met with multi-tenant HSM. The dedicated option makes sense mainly where contractual or regulatory rules demand isolation and control.

16Cloud EKM: Keys Outside Google Cloud

For the strictest demands, the key never has to enter Google Cloud at all.

Cloud External Key Manager, or Cloud EKM, lets you keep keys in an external key management system run by you or by a supported partner. Google Cloud stores extra cryptographic material and a path to your external key, but according to the documentation, when you use Cloud EKM keys, Google Cloud cannot access your key material. When a service needs to unwrap a data key, the request travels to your external system, which decides whether to allow it.

Two network paths exist: over the internet, and over a private network connection called a VPC. The documentation notes that the internet path carries availability risk and recommends the VPC path or Cloud HSM for better availability. If your external system is unreachable, the data it protects can become temporarily unreadable.

Why Choose External Keys

  • Google cannot access the key material
  • You can revoke access from your own system instantly
  • Helps meet strict sovereignty or contractual duties
  • Keeps the root of trust in infrastructure you choose

What It Costs You

  • Highest price among protection levels
  • Dependency on your external system being up and reachable
  • Not every Google Cloud service supports external keys
  • More operational work and partner charges
Simple Analogy

External keys are like leaving the only key to your warehouse with a trusted friend in another town. The warehouse manager must phone your friend every time the door must open. Safe from the manager, but if the phone line breaks, nobody can enter.

!
Plan for Outages of Your Own System

If your external key system goes down, protected data may become unavailable. Design redundancy and runbooks for that system as carefully as for Google Cloud itself.

17Importing Your Own Key Material

Sometimes the key must come from outside, and Cloud KMS supports importing it.

Normally Cloud KMS generates key material itself, which is the safest approach because the material never exists anywhere else. In certain cases, for example when migrating from another system or meeting a rule that requires you to generate keys in your own process, you can import key material into software or HSM keys. Google’s documentation describes the generated or imported origin for these levels. Import uses a wrapping process so the key is protected while traveling to Cloud KMS.

1

Prepare an Import Job

Create an import job in Cloud KMS that provides a public wrapping key for this transfer.

2

Wrap Your Key Locally

Wrap your key material with the wrapping key in a secure environment, so it is never sent in the clear.

3

Import

Send the wrapped key to Cloud KMS, which unwraps it inside protected infrastructure and creates a key version.

4

Retire the Local Copy Safely

Securely destroy or lock away your local source copy, because a spare copy is exposure.

Exact steps and supported algorithms evolve, so follow the current import documentation. Whenever possible, prefer keys generated inside Cloud KMS.

Simple Analogy

Importing is moving a precious item to a new vault. You seal it in a tamper-evident case before transport, ship it in an armored van, and the vault opens the case only inside its own walls.

!
Imported Keys Carry Extra Duty

If you hold a copy outside the service, you must protect that copy for the key’s whole life, and you remain responsible for recovery if it is lost.

18Using CMEK with Google Cloud Services

The most common way to use Cloud KMS is to point another Google Cloud service at a key you control.

Many Google Cloud services, including storage, databases, data warehouses, messaging and disks, can be configured to protect their data with a customer-managed key from Cloud KMS. Once configured, the service uses envelope encryption in the background. It generates data keys, wraps them with your key, stores the wrapped result, and calls Cloud KMS whenever it needs to unwrap. You do not change your application. You only decide which key protects which resource.

The permissions work through service agents. Each service has a special identity, managed by Google, that acts on your project’s behalf. To let a service use your key, you grant that service’s identity a narrow role that allows encrypting and decrypting with the key and nothing more. If you later remove that permission, or disable the key, the service can no longer unwrap the data keys, and the protected data becomes unreadable until access is restored.

1

Create the Key in the Right Location

Place a symmetric key in the same location as the resource that will use it. Many services require this match.

2

Grant the Service Agent Access

Give the service’s identity the encrypt and decrypt role on that key.

3

Configure the Resource

Select the key when creating the bucket, disk, dataset or database.

4

Test Access and Monitoring

Confirm that the service works and that key use appears in audit logs.

5

Document the Dependency

Record which resources depend on the key, so nobody disables or destroys it casually.

What changes when you choose CMEK

Gain

A Kill Switch

Disabling the key makes the protected data unreadable, which can be valuable in a security incident.

Gain

Separate Control

The people who manage keys can be different from those who manage the data.

Gain

Evidence

Audit logs show each time the service used your key.

Cost

Dependency

The service now depends on the key being enabled and reachable. A key problem becomes a data availability problem.

Simple Analogy

CMEK is like a warehouse that agrees to use your lock on its storage room. The warehouse staff still do all the packing, but only with the key you allowed, and if you take that permission back, the room stays closed.

!
Not Every Service Supports Every Key Type

Support for CMEK, and for external keys in particular, varies by service. Check the service’s own documentation before designing around it.

19Cloud KMS Autokey

Autokey automates the busywork of creating keys for the services that need them.

Setting up CMEK by hand means creating key rings, creating keys, granting service permissions and remembering conventions. Across hundreds of resources, mistakes and inconsistencies are likely. Autokey is a Cloud KMS feature that creates keys on demand as developers create resources, following the structure and rules the security team defined. Developers get protected resources without waiting for a ticket, and security teams keep consistent naming, locations and protection levels.

The pricing page also notes a small free allowance connected to Autokey-created keys, covering a limited number of key versions and operations each month, aggregated across projects for a billing account. Confirm the current allowance and conditions before relying on it.

AspectManual CMEKWith Autokey
Key creationSecurity team creates keys in advance or on requestCreated automatically when a resource needs one
ConsistencyDepends on people following conventionsEnforced by the configured rules
Speed for developersSlower, with ticketsFaster, self-service
Control for security teamsComplete, but labor-intensivePolicy-driven, with less manual work
Best forFew keys, special setupsMany teams and resources needing standard patterns
Simple Analogy

Autokey is a hotel front desk that automatically cuts a room key when a guest checks in, using the hotel’s rules for which rooms and which type of lock. Guests do not wait for the locksmith, and the hotel never loses track of its keys.

i
Check Current Coverage

The list of services and resource types Autokey supports grows over time. Look at the current documentation before planning around it.

20Access Control and Separation of Duties

Who may manage a key and who may use it are two different questions, and they should have different answers.

Cloud KMS uses Identity and Access Management to control access. A key administrator can create, rotate, disable and destroy keys, but should not necessarily be able to use the key to read data. A key user, which may be a service or a person, can encrypt and decrypt, but should not be able to change or destroy the key. Keeping these roles apart is called separation of duties, and it is one of the best protections against both mistakes and abuse.

Role of Person or SystemShould Be Able ToShould Not Be Able To
Key administratorCreate keys, set rotation, disable versions, schedule destructionEncrypt or decrypt data with the keys
Application or service identityEncrypt and decrypt with its own keyChange or destroy keys, or use other applications’ keys
AuditorView key metadata and audit logsUse or change keys
Security leadApprove destruction and emergency actionsPerform daily operations alone

Think about emergencies too. If a key must be disabled at once because of a suspected breach, who is allowed to do it, and how quickly can they be reached? A good design names an on-call group with that power, records every use of it, and rehearses the procedure, so that a real emergency is handled calmly instead of through frantic permission requests.

Practical rules

Rule

Grant on the Key or Ring

Give access on the specific key or key ring, not on the whole project, so a role cannot reach unrelated keys.

Rule

Use Groups

Assign key roles to groups so membership changes are easy to review.

Rule

One Identity Per Workload

Each application uses its own service account with access to only its own key.

Rule

Avoid Broad Roles

Avoid project-wide owner or editor roles for people who touch keys. Use narrow predefined roles, and check their current names.

Rule

Dedicated Key Projects

Many companies keep keys in a separate project from the data, so access to data projects does not imply access to keys.

Rule

Review Regularly

Check who can use or manage each important key, and remove access that is no longer needed.

Simple Analogy

In a bank, the person who maintains the vault door does not hold the keys to customers’ boxes, and the person who opens a customer’s box cannot change the vault’s locks. Two roles, so one mistaken or dishonest person cannot do everything.

!
Project Owners Are Powerful

A person with broad ownership of a project can often grant themselves key roles. Limit who holds such rights, especially on projects containing keys.

21Audit Logging and Monitoring

A key you cannot watch is a key you cannot trust.

Google Cloud’s audit logs record administrative actions on Cloud KMS, such as creating, disabling or destroying keys. Data access logs can record each use of a key for encryption or decryption, when enabled, which may produce a large volume of entries for busy services. Google’s documentation confirms that key operations appear in audit logs. Together, these logs answer who used which key, when, and from where.

1

Turn On the Right Logs

Enable the audit log types you need for sensitive keys and understand their volume and cost.

2

Send Logs to a Protected Place

Export them to a central location that key administrators cannot edit.

3

Alert on the Dangerous Events

Raise alerts for key disabling, destruction scheduling, permission changes and unusual spikes in use.

4

Review Periodically

Sample the logs to confirm that only expected identities use each key.

A useful habit is to decide, in advance, what normal looks like for each important key. A payments encryption key might be used thousands of times per hour by two known service identities during business hours. If the logs suddenly show a different identity, a different country or a burst at three in the morning, the difference stands out immediately. Without a picture of normal, every pattern looks plausible, and real attacks hide in the noise.

Logs also support compliance. Auditors often ask for proof that only approved people changed keys, that rotations happened on schedule and that destroyed keys were approved. If your logs and approval records are organized, such questions take minutes. If they are scattered, the same questions take weeks and shake confidence in the whole program.

Events worth an alert

Key Version Scheduled for Destruction

Always page a human, since this is the last easy chance to stop an irreversible loss.

Key Disabled

Disabling a key used by production services can cause an outage, so alert the owning team immediately.

Permission Changes on a Key

A new identity gaining use of a sensitive key deserves a review and a recorded reason.

Unusual Volume or Source

A sudden surge of decryption requests, or requests from an unfamiliar place, may signal data theft in progress.

Simple Analogy

Audit logs are the visitor book and camera feed of the key room. Nobody expects a thief to sign the book, but unusual names, odd hours and repeated visits to one drawer tell you where to look.

i
Mind the Log Volume

Data access logging for busy keys can generate many entries. Plan storage, retention and cost before enabling it everywhere.

22Destroying Keys Safely

Destruction is the only truly irreversible action in the service, so it deserves a ritual.

When a key version is destroyed, its key material is permanently deleted. Any data that depends on that version alone can never be decrypted again, by you, by Google or by anyone. This is exactly what you want when you intend to erase data by destroying its key, a technique sometimes called crypto-shredding. It is a disaster if done by mistake.

Cloud KMS reduces the risk through a scheduled destruction delay. When you request destruction, the version enters a scheduled for destruction state and stays recoverable until the delay ends. The length of this delay is configurable when the key is created, and the documentation I reviewed did not state a default, so check the current default and choose a delay that gives your team time to notice mistakes. A longer delay is safer, though versions in this state are still billed.

1

Find Every Dependency

List all resources and applications that use the key, including backups and old snapshots.

2

Re-Encrypt or Archive

If data must survive, re-encrypt it with a different key first.

3

Disable and Observe

Disable the version and watch for errors for a full business cycle, such as a month, to catch rare jobs.

4

Get Approval

Require a second person, ideally from security, to approve destruction.

5

Schedule and Wait

Schedule destruction, alert the owners and use the delay as a final safety window.

Simple Analogy

Destroying a key is like burning the only key to a locked archive. If the archive is full of evidence you must erase, burning is the point. If it holds your family photographs, you had better be sure that nobody still needs to open it.

!
Backups Count

Backups and snapshots protected by a key become unreadable when that key is destroyed. Forgotten backups are the most common source of regret after destruction.

23Signing, Verification and Message Authentication

Encryption keeps secrets. Signatures prove who made something and that it was not changed.

An asymmetric signing key lets you create a digital signature over a document, software package or token. The private key stays inside Cloud KMS, where only authorized identities can request signatures. Anyone can verify the signature using the public key, which can be downloaded and shared freely. If a single character of the document changes afterward, verification fails.

Message authentication codes, often shortened to MACs, are a related tool that uses a shared secret. Both the sender and the checker hold the same key, and the code proves that the message came from someone with the key and was not altered. Cloud KMS supports key purposes for both patterns.

Signing Software Releases

A build pipeline asks Cloud KMS to sign each release. Deployment systems verify the signature before running anything, so tampered software is rejected.

Signing Documents and Records

A business signs invoices or contracts to prove origin and integrity in later disputes.

Issuing Signed Tokens

An identity service signs tokens that other services verify using the public key, without ever contacting the issuer.

Protecting Webhook Messages

Systems attach message authentication codes to notifications so receivers can confirm authenticity.

Because asymmetric keys have no primary version, signing and verification always reference an explicit version. Keep old public keys available as long as signatures made with them still need to be checked, even after you stop signing with those versions.

Simple Analogy

A signature is an official seal that only the owner can press, but anyone can look at the stamp and recognize it. A message authentication code is a secret handshake between two people who have agreed on it in advance.

i
Publish the Public Key Carefully

Verifiers must obtain the correct public key through a trusted route. A forged public key makes verification meaningless.

24Designing Your Key Layout

Good key design balances isolation, simplicity and cost.

A key layout decides how many keys you have, how they are grouped and who can use each. At one extreme, a single key protects everything, which is cheap and simple but disastrous if the key is lost or misused. At the other extreme, a different key protects every object, which provides isolation but may be costly and complex. Most organizations choose a middle path.

LayoutStrengthWeaknessGood For
One key for the whole companyVery simpleHuge blast radius, no separation of accessNothing serious
One key per environmentProduction isolated from testingAll production data shares one keySmall organizations
One key per application per environmentClear ownership, limited blast radius, simple access rulesMore keys to manage, so automation is neededMost organizations
One key per customer or data setStrong tenant isolation, selective erasureMany keys, cost and operations at scaleSoftware providers with strict tenant promises

Naming and organizing

Tip

Names That Explain

Include the application, environment and purpose in the name, since names cannot be changed and deleted names cannot be reused.

Tip

Rings by Audience

Group keys with the same managers and users on the same key ring to simplify access.

Tip

Location by Data

Create the ring in the location of the data it protects.

Tip

Separate Project for Keys

Hold production keys in a dedicated project with very limited access.

Simple Analogy

A building with a single master key for every door is cheap but terrifying. A building with a separate key for every cupboard is absurd. A sensible building uses one key per office or floor, and a master key kept in a safe.

i
Because Resources Are Hard to Move

Since keys cannot be moved between locations or renamed, a few hours of layout planning early on save major re-encryption projects later.

25A Reference Architecture

A typical, sensible arrangement that many companies can adapt.

In this arrangement, a dedicated key project holds all production keys, with key rings per application and per location. A security team administers the keys, application teams cannot see or change them, and each application’s service account can use only its own key. Audit logs are exported to a protected logging project. Storage and databases use CMEK, and a signing key protects release pipelines.

flowchart LR
  subgraph KP["Key project (security team only)"]
    KR["Key ring per app and location"]
    K1["Encryption key"]
    K2["Signing key"]
    KR --> K1
    KR --> K2
  end
  subgraph AP["Application project"]
    DB["Database with CMEK"]
    BK["Storage bucket with CMEK"]
    CI["Build pipeline"]
  end
  DB -->|"service agent wraps and unwraps"| K1
  BK -->|"service agent wraps and unwraps"| K1
  CI -->|"requests signatures"| K2
  KP --> LG["Audit logs to protected logging project"]
  AL["Alerts on disable, destroy, permission change"] --- LG
        
FIG 5 — Keys in a dedicated project, used by application services

Why this works

1

Separation

People who control data do not control keys, and the reverse.

2

Small Blast Radius

A problem with one application’s key affects only that application.

3

Clear Evidence

Logs go to a protected place and are watched by alerts.

4

Easy Review

The layout is simple enough that auditors can understand it quickly.

Simple Analogy

It is a bank with a separate key department. Branches use boxes and vaults, but only the key department cuts, changes and retires keys, and every key request is written in a ledger the branches cannot alter.

26Understanding Pricing

Cloud KMS pricing has two main parts: how many key versions you keep, and how many operations you perform.

On the pricing page I reviewed, an active key version is billed for as long as it exists in any state other than destroyed. That means enabled, disabled and scheduled for destruction all cost money, while destroyed versions are free. Prices rise with the protection level. Illustrative monthly equivalents shown there were roughly six cents for a software key version, about one dollar for a hardware-protected symmetric or RSA 2048 key version, and about three dollars for an external key version, with some hardware key types priced higher in a tiered table. Cryptographic operations were listed at about three cents per ten thousand, with some hardware operations at a higher rate, and administrative operations such as rotation were free. Single-tenant HSM instances have a separate and much larger hourly charge. Prices change, and some details on the page were unclear, so always confirm on the official page and SKU list.

Cost ItemHow It Is BilledOrder of Magnitude From The Page
Software key versionPer hour while not destroyedRoughly cents per month
Hardware key versionPer hour while not destroyedRoughly one dollar per month for common types
External key versionPer hour while not destroyedRoughly three dollars per month, plus partner charges
Cryptographic operationsPer ten thousand operationsCents per ten thousand
Administrative operationsNot chargedFree
Single-tenant HSM instanceHourly from creation, regardless of useThousands of dollars per month, with key versions included up to a limit

Ways to keep the bill sensible

1

Match Protection to Requirement

Do not pay for hardware or external keys where software suffices.

2

Retire Old Versions

After safe re-encryption and observation, destroy versions you no longer need so they stop billing.

3

Use Envelope Encryption

Encrypt data locally with data keys and call Cloud KMS only to wrap them, to avoid millions of operations.

4

Cache Unwrapped Keys Briefly

Where safe and supported, reuse a recently unwrapped data key for a short time instead of unwrapping repeatedly.

5

Watch the Log Volume

Detailed audit logging of every key use can cost more than the keys themselves on very busy systems.

Note also that all charges go to the project that owns the key, even when the key protects resources in other projects. If you want cost visibility per application team, consider labels and billing reports, and remember this when placing keys in a central key project.

Simple Analogy

Pricing resembles renting safe deposit boxes: a small monthly fee for each box, a bigger fee for a box in a high-security vault, and a tiny fee each time you ask the clerk to open one. Boxes you no longer need are cheapest when returned.

i
Use the Official Calculator

Estimate with Google’s pricing calculator, and review actual billing after the first month, because real usage patterns often differ from plans.

27Real-World Scenarios

Stories show how these ideas appear in daily life.

Scenario 1: A Payments Company

A payments business must show auditors that card data is protected with keys it controls, in certified hardware. It chooses hardware-protected keys, one per application per environment, held in a dedicated key project. Security staff administer keys, applications can only use theirs, and logs go to a protected project with alerts on disabling and destruction.

Scenario 2: A Software Provider with Tenant Promises

A provider promises large customers that their data can be erased on request. It uses a separate key for each large customer. When a contract ends and the retention period passes, the provider disables the key, observes, and then destroys it, making the customer’s data permanently unreadable, including in backups.

Scenario 3: The Accidental Disable

An engineer disables a key to clean up what looked like an unused resource. Within minutes, a production database becomes unreadable and alerts fire. Because disabling is reversible, the team re-enables the key and service resumes. Afterwards, they add documentation of dependencies and restrict who can disable production keys.

Scenario 4: Strict Sovereignty Requirement

A government contractor must ensure the cloud provider can never access encryption keys. It uses external keys held in its own facility, connected over a private network. It builds redundant external key servers and rehearses outages, because an outage would make data unavailable.

Scenario 5: Signed Releases

A company signs every software release with a key kept in Cloud KMS. Only the build pipeline’s identity can request signatures, and deployment systems verify them. When an engineer’s laptop is stolen, no signing key is exposed, because keys never leave the service.

Scenario 6: Growing Fast with Autokey

A fast-growing company has dozens of teams creating storage and databases. It adopts Autokey so that protected resources get compliant keys automatically, while the security team defines locations and protection levels centrally and reviews logs.

Simple Analogy

Every story is about the same lesson: keys decide who can open the vault, and the best vault in the world is only as good as the person who holds its key.

28Choosing the Right Level of Control

The right answer depends on your rules and risks, not on what sounds most secure.

If Your Situation Is…ConsiderWhy
No special rules, want simplicityGoogle default encryptionStrong, automatic and free of key operations
Need control over rotation, disabling and auditCMEK with software keysControl at the lowest cost
Regulator names certified hardwareCMEK with Cloud HSMHardware-protected keys without running devices yourself
Need isolation and administrative control of the HSMSingle-tenant Cloud HSMDedicated partitions and your own administration
Provider must not hold key materialCloud EKMKeys stay in your external system
Need to prove origin or integrityAsymmetric signing keysPrivate key stays in service, verification is public

Moving up this table adds control and cost together, and often adds operational responsibility too. Many teams start at CMEK with software keys for sensitive data, and upgrade specific keys when a clear requirement appears. Because the protection level is chosen per key, one organization can use several levels at once, matching each data set to its needs.

The strongest lock in the world is useless if the key is under the doormat, and the safest key is useless if you can never find it again.
Simple Analogy

You wouldn’t store a bicycle in a bank vault or leave jewels in a garden shed. Matching the protection to the value, and to the rules, is the whole art.

i
Document the Reason

Write down why each key has its protection level. Later reviewers can then tell a deliberate choice from a forgotten default.

29Key Design Decisions

Architects write down significant choices so later teams understand the reasons.

ADR-1 Accepted
Keep keys in a dedicated project

Hold production keys in their own project, administered by the security team.

Reason: access to application projects does not imply access to keys, and logs are easy to scope. Trade-off: cross-project permissions to manage, and costs land in the key project.

ADR-2 Accepted
One key per application per environment

Each application and environment gets its own key, used only by its own identity.

Reason: limited blast radius and clear audit trails. Trade-off: more keys to create and track, so creation is automated.

ADR-3 Accepted
Software keys by default, hardware where required

Use software protection unless a documented requirement calls for hardware or external keys.

Reason: avoids needless cost and operational risk. Trade-off: some customers may ask for stronger assurance, which needs an exception process.

ADR-4 Accepted
Automatic rotation with disable-before-destroy

Rotate symmetric keys on a schedule, and never destroy a version without a disabled observation period and approval.

Reason: limits exposure and prevents irreversible mistakes. Trade-off: old versions cost money while waiting for retirement.

ADR-5 Accepted
Separate key administration from key use

Administrators cannot encrypt or decrypt, and services cannot change or destroy keys.

Reason: no single person or system can both alter protections and read the data. Trade-off: more roles to design and review.

Simple Analogy

A decision record is a ship’s log. Years later, a new captain reads why the ship changed course and avoids the same rocks.

30Common Mistakes and Anti-Patterns

The cheapest education is learning from other teams’ mistakes.

Healthy Habits

  • Keep key material inside the service
  • Separate administrators from users
  • Rotate on a schedule and document dependencies
  • Disable, observe, then destroy
  • Alert on disable, destroy and permission changes

Risky Habits

  • One key for everything
  • Exporting or copying key material casually
  • Letting developers with project ownership manage production keys
  • Destroying keys without checking backups
  • Choosing external keys without an availability plan

Five classic traps in detail

Trap 1

Confusing Rotation With Re-Encryption

Teams rotate and believe all old data is now under the new key. It is not, unless it is re-encrypted.

Trap 2

Wrong Location

A key is created in a different location from the service that needs it, and cannot be moved, so everything must be rebuilt.

Trap 3

Forgotten Dependencies

A key looks unused until a quarterly job, an old snapshot or a disaster recovery copy needs it.

Trap 4

Over-Broad Service Permissions

One service identity can use every key in the company, so one compromise reaches every data set.

Trap 5

Treating KMS as a Secret Store

Cloud KMS manages keys and cryptographic operations, not ordinary passwords. Use the right service for each job.

Simple Analogy

These traps are loose floorboards in a house. Each looks harmless until someone carries something heavy across it.

31Troubleshooting Guide

Start with the simplest cause and work toward the hardest.

SymptomLikely CauseWhat To Try
Permission denied when using a keyIdentity lacks the encrypt or decrypt role on that key, or a policy blocks itCheck grants on the key and ring, and any deny or organization policy
Service cannot create a resource with CMEKService agent lacks access, or the key is in a different locationGrant the service agent the role and match locations
Data suddenly unreadableKey disabled, version disabled or destroyed, or access removedCheck key and version state, and recent permission changes in audit logs
Decrypt fails for old dataThe version that encrypted it is disabled or destroyedRe-enable the version if it is not yet destroyed
Cannot create key in desired locationProtection level not offered thereCheck which levels are supported in that location
External key operations failExternal system unreachable or denying requestsCheck connectivity, the external system’s status and its policy
Bill higher than expectedMany old versions, high-volume operations or hardware keysRetire unused versions, use envelope encryption, review protection levels
Signature verification failsWrong public key or version, or the data was alteredConfirm the version used for signing and fetch the matching public key

A calm method

1

Identify the Key and Version

Find exactly which key and version the failing operation refers to.

2

Check State and Access

Is the version enabled, and does the caller hold the right role?

3

Read the Audit Logs

Logs show recent changes and the exact error returned.

4

Fix, Then Verify

Change one thing, retest and record what you learned.

Simple Analogy

Troubleshooting a locked door: find which door, check which key you hold, read the sign on the door, and only then call the locksmith.

32Best Practices Checklist

A short list to review before every launch.

Design

Plan Locations and Names First

They cannot be changed later, so choose them with care.

Design

One Key per Job and Data Set

Keep blast radius small and audit trails readable.

Design

Pick the Lowest Sufficient Protection Level

Software by default, hardware or external only for documented needs.

Access

Separate Administration From Use

Nobody should both change protections and read protected data.

Access

Narrow Grants on Keys or Rings

Avoid project-wide key roles and shared identities.

Access

Dedicated Key Project

Limit who can reach production keys.

Lifecycle

Automate Rotation

Schedule it and plan re-encryption where needed.

Lifecycle

Disable Before Destroying

Observe for a full business cycle, require approval and check backups.

Operate

Log and Alert

Send logs to a protected place and alert on disabling, destruction and permission changes.

Operate

Document Dependencies

Record which resources rely on each key.

Operate

Review Costs and Access Regularly

Retire old versions, and check who can use or manage each key.

Simple Analogy

A pilot walks through the same checklist before every flight, however experienced. The list does not express doubt. It expresses respect for what could go wrong.

33Frequently Asked Questions

Quick answers to the questions beginners ask most often.

Q1What is Cloud KMS in one sentence?

It is a managed Google Cloud service for creating, protecting and using cryptographic keys, so applications can encrypt, decrypt, sign and verify without ever handling the raw key.

Q2Is my data already encrypted without Cloud KMS?

Yes. Google Cloud encrypts customer data at rest by default, using keys that Google manages. Cloud KMS is for organizations that want to control the keys themselves, for compliance, for separation of duties or to be able to revoke access.

Q3What is CMEK?

Customer-managed encryption keys. You create and control a key in Cloud KMS, and a supported Google Cloud service uses it to protect your data. You decide who can use it, how it rotates and whether it is enabled.

Q4What is the difference between a key ring, a key and a key version?

A key ring groups keys in one location and lets you manage access together. A key is a named object that holds versions. A key version is one numbered generation of the actual key material, and rotation creates new versions.

Q5Can I move a key to another location or rename it?

No. Resources cannot be moved after creation and key rings and keys cannot be renamed. If you chose wrongly, create a new key in the correct place and re-encrypt the data.

Q6What is envelope encryption?

A two-layer design in which data is encrypted with a data key, and the data key is encrypted with a master key held in Cloud KMS. It combines the speed of local encryption with central control of the master key.

Q7What happens if I disable a key?

The key can no longer be used, so anything that needs it to decrypt, including services using CMEK, cannot read the protected data. Re-enabling the key restores access, which is why disabling is a safe test before destruction.

Q8What happens if I destroy a key version?

After the scheduled delay, the key material is permanently deleted. Data that depends only on that version can never be decrypted. During the delay, the version can still be recovered.

Q9Does rotation re-encrypt my existing data?

Not by itself. Rotation creates a new version for new encryption. Existing data stays tied to the version that encrypted it until it is re-encrypted. Some services handle details differently, so read the service’s documentation.

Q10How often should I rotate keys?

Follow your organization’s security policy and any regulation that applies. Many teams rotate symmetric keys every few months automatically, and immediately after any suspected compromise.

Q11When do I need Cloud HSM?

When a regulation, standard or contract requires keys to be protected by certified hardware. Google documents multi-tenant Cloud HSM as FIPS 140-2 Level 3 validated hardware. If no such requirement exists, software keys are usually enough.

Q12What is Cloud EKM and when should I use it?

Cloud External Key Manager keeps your keys in a system outside Google Cloud. Use it when Google must not hold the key material, accepting higher cost and dependency on your external system’s availability.

Q13Can I import my own keys?

Yes, for software and hardware protection levels, using a wrapped import process. Prefer keys generated in Cloud KMS where possible, since an outside copy adds exposure and duties.

Q14Does every Google Cloud service support CMEK?

No. Many do, but support varies by service and by key type. Some services do not support external keys. Always check the specific service’s documentation.

Q15Can administrators read my data if they manage the key?

Not if roles are designed well. Key administrators can manage key life cycle without holding encrypt and decrypt permissions. Keep administration and use separate.

Q16How much does Cloud KMS cost?

Cost comes from active key versions per hour, which vary by protection level, plus cryptographic operations per ten thousand. Administrative operations were listed as free on the page I read. Hardware and external options cost more, and single-tenant HSM has a large hourly instance charge. Confirm current numbers on the official page.

Q17Do disabled key versions cost money?

Yes. According to the pricing page, versions in any state other than destroyed are billed. Destroyed versions are free.

Q18What is Autokey?

A feature that creates keys automatically when resources need them, following rules defined by the security team. It gives developers speed and security teams consistency.

Q19Can Cloud KMS store my passwords or API tokens?

It is not designed for that. Cloud KMS manages cryptographic keys and operations. Use Google Cloud’s secret management service for credentials and tokens, and use Cloud KMS keys to protect data.

Q20Can I sign data with Cloud KMS?

Yes. Asymmetric signing keys let you sign data while the private key stays inside the service. Anyone with the public key can verify the signature. Message authentication keys cover shared-secret use cases.

Q21Which location should I choose?

Usually the same location as the data or service that will use the key, subject to your compliance rules. Remember that location is permanent and that some protection levels are not offered in every location.

Q22How can I tell who used a key?

Through audit logs. Administrative actions are logged, and data access logs can record each cryptographic use when enabled. Export them to a protected place and set alerts for risky events.

Q23Should keys live in the same project as my application?

For serious workloads, a separate key project is better, since access to the application project then does not imply access to keys. Charges go to the project that owns the key, so plan cost reporting accordingly.

Q24How do I erase data by using keys?

Encrypt that data under its own key, and when erasure is required, destroy the key after the safety steps. Without the key, the encrypted data is unreadable. This is called crypto-shredding. Confirm that backups under the same key are included in your plan.

Q25How do I begin as a small team?

Create a key project, make one key ring per location, create a software symmetric key with automatic rotation for one sensitive data store, grant its service agent access, enable audit logs and alerts, and document the dependency. Expand from there as real needs appear.

34Summary and Key Takeaways

Everything in this guide on one short page.

Cloud KMS lets you create and use cryptographic keys without ever exposing them. Keys are organized into key rings, keys and versions in a chosen location. Envelope encryption lets services protect large data cheaply while you keep central control of a master key. You choose a protection level of software, hardware or external according to your rules, control access with separated roles, rotate on a schedule, watch audit logs and destroy keys only with great care. Handled well, keys become a source of confidence. Handled carelessly, they become a source of outages and exposure.

Key Takeaways

  • Cloud KMS keeps key material inside the service while applications and Google Cloud services use keys for encryption, decryption, signing and verification.
  • Keys live in key rings in a specific location that cannot be changed later, and each key holds numbered versions that rotation creates.
  • Choose the lowest protection level that meets your documented requirement: software for most workloads, Cloud HSM for certified hardware, and external keys only when Google must not hold the material.
  • Separate people who administer keys from identities that use them, grant narrowly on keys or rings, and keep production keys in a dedicated project.
  • Rotation creates new versions but does not re-encrypt old data. Plan re-encryption when it is needed.
  • Disable before destroying, check every dependency including backups, require approval, and alert on disable, destroy and permission changes.
  • Watch costs, since versions in any state except destroyed are billed, and confirm current features and prices on Google’s official pages.