Encryption at rest in BigQuery secures stored data with Google-managed or customer-managed (CMEK) Cloud KMS keys.
BigQuery always encrypts data on disk. By default it uses Google-managed keys, but you can supply customer-managed encryption keys (CMEK) from Cloud KMS for tighter control. CMEK lets you rotate, disable, or destroy keys whenever required.
Select CMEK when compliance mandates customer control, when you need explicit key rotation schedules, or when separate business units require isolated keys.Stick with Google-managed keys for simpler operations without extra KMS management.
Use ALTER SCHEMA … SET OPTIONS(default_kms_key_name= 'KMS_PATH')
. New tables inherit this key automatically, reducing manual work and keeping projects consistent.
Create the table with an encryption_key
option: CREATE TABLE … OPTIONS(encryption_key='KMS_PATH')
.The key must reside in the same GCP region as the table.
Issue ALTER TABLE … SET OPTIONS(encryption_key='NEW_KMS_PATH')
. BigQuery re-encrypts data in place. Confirm that the service account running the command has the cloudkms.cryptoKeyEncrypterDecrypter
role on the new key.
Use separate keys per environment (dev, staging, prod). Automate key rotation with Cloud KMS schedules. Grant the BigQuery service account the minimal required KMS roles.Monitor KMS audit logs for access patterns.
Granting insufficient KMS permissions or choosing a key in a different region will cause immediate job failures. Validate IAM roles and region alignment before deploying changes.
.
No noticeable impact exists; encryption and decryption are handled transparently by BigQuery.
Yes. Disabling or destroying the KMS key renders all dependent tables and datasets inaccessible until the key is re-enabled.