Intrigued by the art of cloud architecture? Discover how to design, develop, and manage robust, secure, scalable, and dynamic solutions on Google Cloud as you prepare for the Professional Cloud Architect exam!
Customer-Managed Encryption Keys (CMEK) let organizations keep control of their own encryption keys within Cloud Key Management Service (Cloud KMS), rather than relying only on Google's default encryption. This approach is essential for meeting strict security requirements and regulatory compliance standards because it gives organizations greater control over how keys are created, used, and retired. The process begins with creating key rings, which are logical groupings of keys organized by region or environment.
To allow Google Cloud services to use these keys, you must configure a service agent and grant it the Cloud KMS CryptoKey Encrypter/Decrypter role. This permission enables services like Bigtable, GKE, or Cloud SQL to protect data while keeping the customer in control of access. Key rotation is a critical security practice that involves creating a new primary key version to minimize the impact if a key is ever compromised. You can configure automatic rotation schedules or perform manual rotations based on your organization's internal security policies.
Cloud KMS keeps older key versions available to decrypt existing data while only the newest version is used for new encryption tasks. This version history ensures that regularly rotating keys limits the amount of data protected by a single key version. Managing key states is vital for ensuring data remains accessible or for quickly revoking access during a security incident. A key can be enabled, disabled, or scheduled for destruction, with each state significantly impacting associated cloud resources. Disabling a key immediately prevents services from accessing encrypted data, while scheduling destruction starts a waiting period before the key material is permanently deleted.
To maintain a secure environment, administrators should implement separation of duties by hosting keys in a different project than the resources they protect. This strategy prevents a single compromised account from having full control over both data and encryption keys. Monitoring through Cloud Audit Logs and using project liens further protects against accidental deletion or unauthorized changes to the key infrastructure.
Google Cloud uses a strategy called separation of duties, which means the person who manages encryption keys should not be the same person who uses the data. Using separate projects for your keys and your resources is a best practice that helps control exactly who has access to each part of your system. This architectural decision creates a trust boundary between the key management infrastructure and the protected data.
When a service needs to protect data, it uses a special identity called a service agent. This service account is granted the CryptoKey Encrypter/Decrypter role to perform its work, acting on behalf of the service to handle encryption without requiring the human user to have direct access to the keys. Applying the principle of least privilege means granting permissions at the lowest level possible, such as a specific key or key ring rather than an entire project. By limiting access this way, you ensure that only the necessary services can use specific cryptographic resources.
Key management involves several important tasks handled by key administrators, including creating and importing CMEKs, setting rotation schedules for keys, and monitoring key usage through audit logs. Administrators focus on the lifecycle of the key while the service focuses on using the key for data protection. If you need to stop access to data immediately, you can revoke IAM roles or disable the key. Once the CryptoKey Encrypter/Decrypter role is removed, the service can no longer read the encrypted information.
Customer-Managed Encryption Keys (CMEK) allow organizations to maintain control over the keys used to protect their data at rest. By using Cloud Key Management Service (Cloud KMS), users can manage the rotation, location, and access permissions of these keys instead of relying solely on Google-default encryption. This integration is vital for meeting strict data sovereignty and security compliance requirements.
To implement CMEK, you must first create a key ring in a geographic location near your resources. You then grant the CryptoKey Encrypter/Decrypter IAM role to the specific service agent associated with the Google Cloud service. Using separate projects for keys is a recommended practice to support a strong separation of duties. Requesters do not need direct access to the CMEK because the service agent handles encryption and decryption on their behalf. However, if an administrator chooses to disable or destroy a key, the data it protects becomes permanently inaccessible. Architects must account for the operational risk of permanent data loss if keys are not managed correctly.
Primary services like Cloud Storage, BigQuery, and Compute Engine integrate with Cloud KMS to facilitate customer-controlled encryption. In Cloud Storage, CMEK protects object data and checksums, while Compute Engine uses it to secure VM boot disks and snapshots. BigQuery secures data at rest within tables. Architects must ensure the key and the resource reside in the same geographic region to maintain compatibility.
Organizations can enforce consistent security by using Organization Policy Constraints to require CMEK usage across all projects. These policies can limit which keys are used, their protection levels, and their physical locations. Key usage tracking provides a dashboard to monitor which resources are currently protected by specific keys.
Prepare and test your skills
Prepare and test your skills
Using Customer-Managed Encryption Keys (CMEK) gives organizations greater control over how encryption keys are created, used, and retired, which is essential for meeting strict security requirements and regulatory compliance standards.
Key rotation involves creating a new primary key version to minimize the impact if a key is ever compromised. Cloud KMS keeps older key versions available to decrypt existing data while only the newest version is used for new encryption, limiting the amount of data protected by a single key version.
The recommended strategy is to host encryption keys in a different project than the resources they protect. This creates a trust boundary and prevents a single compromised account from having full control over both data and encryption keys.
A service agent associated with the Google Cloud service is granted the CryptoKey Encrypter/Decrypter IAM role, allowing it to handle encryption and decryption on behalf of the service without the human user needing direct key access.
Assign the Project Owner (roles/owner) role to the key administrators at the project level, and assign the Cloud KMS Admin (roles/cloudkms.admin) role to the Cloud Storage service agent on the KMS KeyRing.
Assign the Cloud KMS Admin (roles/cloudkms.admin) role to the key administrators on the KeyRing or project, and assign the Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter) role to the Cloud Storage service agent on the specific CryptoKey.
Assign the Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter) role to both the key administrators and the Cloud Storage service agent at the project level.
Assign the Cloud KMS Admin (roles/cloudkms.admin) role to the key administrators, and assign the Storage Admin (roles/storage.admin) role to the Cloud Storage service agent on the target Cloud Storage bucket.
A financial services organization is implementing customer-managed encryption keys (CMEK) using Cloud Key Management Service (Cloud KMS) to protect data across several Cloud Storage buckets. The compliance team requires a strict separation of duties and the enforcement of least privilege across cryptographic assets:
Which IAM role configuration should you implement to satisfy these requirements?