Ensure that your Google Cloud Platform (GCP) Cloud Spanner backups are encrypted using customer-managed encryption keys (CMEK) instead of the default Google-managed encryption keys. CMEK provides organizations with greater control over their backup encryption keys, enabling them to create, rotate, and manage encryption keys through Cloud Key Management Service (Cloud KMS). This ensures compliance with regulatory requirements and enhances data security by giving organizations full ownership and control over their backup encryption strategy.
By using customer-managed encryption keys (CMEK) for Cloud Spanner backups, organizations gain complete control over their backup encryption keys and data protection strategy. CMEK enables you to manage key protection levels, locations, rotation schedules, usage permissions, and access controls through Cloud KMS, ensuring that encryption practices align with organizational security policies and compliance requirements. With CMEK, you can define who can access your backup data by controlling the permissions on your encryption keys, implement custom key rotation policies, and maintain a comprehensive audit trail of all key usage through Cloud Audit Logs. Additionally, CMEK provides the ability to render backup data inaccessible by disabling or destroying the encryption key, giving organizations an additional layer of control in data breach scenarios, regulatory investigations, or during secure decommissioning processes.
Important: If a Cloud KMS key is deleted, any Cloud Spanner backups encrypted with that key become permanently inaccessible and the backup data cannot be recovered or restored. If a Cloud KMS key is disabled, Cloud Spanner will be unable to restore the database from that backup. When restoring a CMEK-enabled backup, both the key and key version that was used to encrypt the backup must be available. After backup creation, the encryption key and key version cannot be modified, even if the KMS key is rotated. It is strongly recommended to maintain proper key lifecycle management and access controls to prevent accidental key deletion or disablement that would render backups unrestorable.
Audit
To determine if your Cloud Spanner backups are encrypted with customer-managed encryption keys (CMEK), perform the following operations:
Remediation / Resolution
To enable customer-managed encryption keys (CMEK) for your Google Cloud Spanner backups, you must create new backups with CMEK configured or modify your backup schedules to use CMEK. Before creating CMEK-encrypted backups, you must ensure that a Cloud KMS encryption key exists in the same location as your Spanner instance and that the Cloud Spanner service agent has the necessary permissions to use the key. Note that you cannot modify the encryption configuration of an existing backup after it has been created. Perform the following operations:
Important: Cloud Spanner does not support modifying the encryption type of an existing backup from Google-managed keys to customer-managed encryption keys (CMEK). You must create new backups with CMEK enabled. The Cloud KMS encryption key must be created in the same location as your Cloud Spanner instance. For multi-region or dual-region instances, you must use regional Cloud KMS keys that correspond to the regions in your instance configuration. Deleting or disabling the CMEK key will make your Cloud Spanner backups unrestorable. Incremental backups do not support CMEK and can only be encrypted using Google-managed encryption keys, even if the source database is encrypted with CMEK.References
- Google Cloud Platform (GCP) Documentation
- Encryption
- Customer-managed encryption keys (CMEK) overview
- Backups overview
- Create backups
- Manage backups
- Create a key
- Cloud Key Management Service overview
- Customer-managed encryption keys (CMEK)
- Permissions and roles
- Default encryption at rest
- GCP Command Line Interface (CLI) Documentation
- gcloud spanner instances list
- gcloud spanner instances describe
- gcloud spanner databases list
- gcloud spanner backups describe
- gcloud spanner backups create
- gcloud kms keyrings create
- gcloud kms keys create
- gcloud kms keys add-iam-policy-binding
- gcloud beta services identity create
- gcloud projects list