Prepare and test your skills
Prepare and test your skills
Encryption strategies in Google Cloud determine who owns the keys that protect data at rest and how much control you have over those keys. Google-owned and Google-managed encryption protects all stored data automatically with no setup. Customer-Managed Encryption Keys (CMEK) (opens in a new tab) lets you own and control keys in Cloud Key Management Service (Cloud KMS) (opens in a new tab) for stronger control, visibility, and compliance.
Google-owned and Google-managed default encryption is the automatic protection applied to all data stored in Google Cloud without any configuration. Data at rest is encrypted with the AES-256 standard using keys held in Keystore, Google Cloud's internal key management system, with cryptographic modules validated to FIPS 140-3 Level 1. Google automatically manages rotation and keeps a primary key version for encrypting new data encryption keys plus a limited number of older versions for decryption. You cannot view or manage these keys, review key usage logs, or isolate your data to a unique key, and data from multiple customers might share the same key encryption key.
Customer-Managed Encryption Keys (CMEK) are encryption keys that you own and manage in Cloud KMS to protect resources in supported services. A CMEK creates a cryptographic boundary around your data because each key can be unique to your workload, location, and compliance needs. Unlike default encryption, CMEK supports unlimited key versions for each key and gives you direct control over the full key lifecycle. Using Cloud KMS for CMEK adds cost based on active key versions and cryptographic operations, with no minimum purchase required.
You can use manually created CMEKs or keys created by Autokey to meet goals such as:
A CMEK integration is server-side encryption in a supported Google Cloud service that uses your Cloud KMS key instead of Google's default encryption. After setup, encryption and decryption are handled by the service's service agent, so access to the resource feels the same as with default encryption and the end user needs no direct access to the key. The service agent depends on having the CryptoKey Encrypter/Decrypter role (roles/cloudkms.cryptoKeyEncrypterDecrypter) on the CMEK to encrypt and decrypt data. If you revoke that role, or if you disable or destroy the key, the service can no longer decrypt its data, and some services can suffer permanent data loss if the key stays inaccessible too long.
Manually enabling CMEK follows an ordered workflow where the key and its permission must exist before the protected resource can use them:
A left-to-right process flow showing four CMEK setup steps from key ring to resource, leading to an active state where the service agent handles encryption.
Cloud KMS Autokey simplifies this same integration by generating key rings and keys on demand during resource creation and automatically granting the service agent the required IAM roles. Keys created by Autokey follow best practices for location alignment, specificity, hardware protection level, rotation, and separation of duties, and they behave identically to manually created keys for monitoring, key usage tracking, and organization policy enforcement.
The choice between default encryption and CMEK comes down to simplicity versus control, auditability, and the ability to cut off access at the key layer.
| Strategy | Key ownership | Control and visibility | Best fit when |
|---|---|---|---|
| Google-owned and Google-managed | Google owns and controls keys in Keystore | No setup or management; you cannot view keys or usage logs; keys may be shared across customers | You want automatic AES-256 protection with no operational work |
| Customer-Managed Encryption Keys (CMEK) | You own keys in Cloud KMS, manually or with Autokey | You control location, protection level, rotation, IAM access, status, and destruction; you can audit use and track protected resources | You need granular access control, a unique cryptographic boundary, crypto-shredding, or regulatory compliance |
Compliance with CMEK is enforced across the organization with policy constraints and monitoring. Organization administrators can require CMEK protection and limit which keys, protection levels, locations, and key-version destruction behaviors are allowed. Key usage tracking in Cloud KMS shows which resources, projects, and products depend on each key and whether each key is still in use, so key administrators can detect unexpected use and plan rotation or destruction safely.
Exam tip: Google Cloud default encryption is not a feature of Cloud KMS; only CMEK uses Cloud KMS keys that you can manage and audit.
Cloud Key Management Service (Cloud KMS) is Google Cloud's service for creating and managing the encryption keys that protect stored data. Encryption at rest in Google Cloud works by keeping the encrypted data and the key in different places, so a service such as Cloud Storage stores only encrypted data while Cloud KMS stores the customer-managed encryption key that can lock or unlock it. The service organizes this work in a hierarchy where a key ring holds one or more keys, and each key performs cryptographic operations through its key versions.
A key ring in Cloud KMS is a container that groups keys together under one location and one Google Cloud project. The key ring sets the location boundary for every key it holds, so the key ring location must correspond to the location of the service that will use the keys. The project where the ring lives is called the key project, and that project must have Cloud KMS enabled before any ring or key can be created.
For example, when protecting Security Command Center (opens in a new tab) data, the Cloud KMS key ring location must match the Security Command Center location:
| Security Command Center location | Cloud KMS key location |
|---|---|
eu | europe |
sa | me-central2 |
us | us |
If data residency is not enabled for Security Command Center, the key ring is created in the us location. This location pairing shows why planning the key ring first matters, because the ring fixes where the keys can be used from.
A key in Cloud KMS is the named resource created on a key ring that a cloud service uses to encrypt and decrypt its data. After configuration, the service sends an encrypt or decrypt request to Cloud KMS, Cloud KMS uses the key to perform the cryptographic operation, and the service never stores the key alongside the data it protects. This separation means the data stays encrypted at rest unless Cloud KMS allows the key to be used.
Keys also carry ownership and access controls that enforce security and compliance. The Cloud Security Command Center Service Agent, or the service agent for another integrated service, must have the required Identity and Access Management (IAM) role on the key or protected features will not work correctly. Organization policies can further require CMEK through constraints/gcp.restrictNonCmekServices and require that the key comes from an approved project through constraints/gcp.restrictCmekCryptoKeyProjects.
A key version in Cloud KMS is the actual cryptographic material inside a key that performs each encrypt or decrypt operation. A key can have more than one version over time, and concepts such as key states and key rotation control which version is available for new operations. Key Access Justifications (opens in a new tab) builds on this by generating a justification code for each cryptographic operation involving an enrolled key, so an administrator can view, approve, or deny access based on the reason provided.
Because versions change over time, logging and transparency controls track operations rather than only tracking the key name. Cloud KMS audit logs can record justification codes for key operations, and logging applies to keys with both hardware and software protection levels. Together, versions, states, rotation, and justification policies let an organization prove who used which key material, when, and why.
The three components work as an ordered chain from location to operation. First, an administrator installs and initializes the Google Cloud CLI, then builds the hierarchy in order:
Once configured, data flows from the protected service to Cloud KMS for each cryptographic operation, and the key version inside the key performs the work. The protected service depends on the key, the key depends on its key ring for location and grouping, and Key Access Justifications plus organization policies sit above them as approval and enforcement boundaries.
Exam tip: If Cloud HSM keys are used with CMEK integrations, the service location must match the Cloud HSM key location exactly for regional, dual-regional, and multi-regional locations.
Key Lifecycle Management in Cloud Key Management Service (Cloud KMS) is the process of creating, using, rotating, and disabling or destroying encryption keys to protect sensitive data. Each key contains one or more key versions, and the primary version is the version currently used for new encryption operations. Understanding how versions change state over time explains why new data can use a new key while old data still depends on an older version.
Creating an encryption key establishes a new key with a primary version in the enabled state that services can use for encryption. Keys created for automation can use defaults such as HSM protection level, AES-256 GCM algorithm, and a one-year rotation period, and they are created in the same location as the resource they protect. A key is considered available only when the key version is enabled and the service account has encrypt and decrypt permissions on the key.
Using customer-managed encryption keys (CMEKs) (opens in a new tab) means Cloud Storage encrypts new objects with the primary version of the selected key. A bucket can have a default CMEK, and individual upload, copy, or rewrite operations can specify a key, but a single object can be encrypted by only one method at a time. If a bucket has a default CMEK and a request supplies a customer-supplied key, data flows from the request to Cloud Storage encrypted with the customer-supplied key instead of the bucket default.
Rotating a key in Cloud KMS creates a new key version through automatic or manual rotation and makes that new version the primary version. After rotation, Cloud Storage uses the new primary version for all new encryption with that key, including uploads to a bucket that uses the key as its default and uploads, copies, or rewrites that specifically name the key. Previous versions remain enabled so Cloud Storage can still decrypt existing objects that were encrypted with those versions.
Rotation alone does not re-encrypt existing data and does not disable or destroy older versions. Data encrypted with a previous version keeps the key version specified at the time of its creation until it is decrypted and re-encrypted with the new version. New backups use the latest primary version, while existing backups and persistent data continue to depend on the older version until a maintenance event or manual re-encryption moves them.
Replacing a key moves protection from an old key to a whole new key, and re-encryption moves existing objects to the new key version or new key. Rotation never performs this move automatically, so replacement requires an ordered migration before the old key is disabled:
Disabling or destroying a key version removes the ability to decrypt any data encrypted with that specific version. When a version becomes unavailable, protected objects cannot be downloaded, copied, or rewritten, and attempts to do so result in an error. If the unavailable version is the primary version, the key cannot perform new encryption until a new primary version exists, so uploads, copies, or rewrites that name the key fail, and uploads to a bucket with that default key fail unless a different valid key is specified.
The choice between disabling and destroying controls whether access can be restored:
| Action | Access to existing data while inactive | Recovery |
|---|---|---|
| Disable | Decryption is blocked until re-enabled | Reversible by re-enabling the version |
| Destroy | Decryption is permanently blocked | Not reversible, downloads are never possible again |
Destroying a version provides high-assurance destruction, also called crypto-shredding, which makes data permanently inaccessible even when the encrypted objects still exist. This approach is used for cases such as remediating a data spill, but it causes unrecoverable loss if any needed objects still depend on the destroyed version. Before disabling or destroying, identify every object encrypted with that version and re-encrypt it with a new key version, a new key, or Google-managed server-side keys.
Exam tip: Rotating a key does not automatically re-encrypt old data or disable old versions; disabling temporarily blocks decryption but can be reversed, while destroying permanently prevents decryption.
Google-owned and Google-managed default encryption automatically protects all stored data at rest with AES-256 without configuration, but you cannot view or manage the keys, review usage logs, or isolate data to a unique key. Customer-Managed Encryption Keys in Cloud Key Management Service give you ownership and control over key location, protection level, rotation, access, status, and destruction, plus auditability and the ability to create a unique cryptographic boundary and selectively delete data by destroying its key.
A Customer-Managed Encryption Keys integration is server-side encryption where a supported Google Cloud service uses your Cloud Key Management Service key instead of default encryption, with encryption and decryption handled by the service agent so access feels the same and the end user needs no direct key access. The service agent must have the CryptoKey Encrypter/Decrypter role on the key, and revoking that role or disabling or destroying the key blocks decryption and can cause permanent data loss in some services if the key stays inaccessible too long.
A key ring in Cloud Key Management Service is a container that groups keys under one location and one Google Cloud project, and the key ring location must correspond to the location of the service that will use the keys. A key is the named resource on a key ring that a service uses for encrypt and decrypt requests without storing the key alongside the data, while a key version holds the actual cryptographic material that performs each operation and the primary version is used for new encryption.
Rotating a key in Cloud Key Management Service creates a new key version and makes it the primary version for new encryption, while previous enabled versions remain available to decrypt existing data and existing data is not automatically re-encrypted. Disabling a version reversibly blocks decryption until it is re-enabled, while destroying a version permanently prevents decryption and provides high-assurance destruction called crypto-shredding even when the encrypted objects still exist.
A data engineering team needs to implement envelope encryption to protect sensitive data files stored across multiple client environments. The architecture requires that client applications encrypt a locally generated Data Encryption Key (DEK) without granting them direct access to decrypt data or manage the private key.
Which workflow correctly describes how Cloud KMS asymmetric keys should be used to protect the DEK?
Last updated