Description
BigQuery by default encrypts the data as rest by employing Envelope Encryption
using Google managed cryptographic keys. The data is encrypted using the data encryption keys
and data encryption keys themselves are further encrypted using key encryption keys
. This is seamless and do not require any additional input from the user. However, if you want to have greater control, Customer-managed encryption keys (CMEK) can be used as encryption key management solution for BigQuery Data Sets. If CMEK is used, the CMEK is used to encrypt the data encryption keys instead of using google-managed encryption keys.
Rationaleβ
BigQuery by default encrypts the data as rest by employing Envelope Encryption
using Google managed cryptographic keys. This is seamless and does not require any additional input from the user.
For greater control over the encryption, customer-managed encryption keys (CMEK) can be used as encryption key management solution for BigQuery tables. The CMEK is used to encrypt the data encryption keys instead of using google-managed encryption keys. BigQuery stores the table and CMEK association and the encryption/decryption is done automatically.
Applying the Default Customer-managed keys on BigQuery data sets ensures that all the new tables created in the future will be encrypted using CMEK but existing tables need to be updated to use CMEK individually.
Note: Google does not store your keys on its servers and cannot access your protected data unless you provide the key. This also means that if you forget or lose your key, there is no way for Google to recover the key or to recover any data encrypted with the lost key.
Impactβ
Using Customer-managed encryption keys (CMEK) will incur additional labor-hour investment to create, protect, and manage the keys.
Auditβ
From Google Cloud Consoleβ
- Go to
Analytics
- Go to
BigQuery
- Under
SQL Workspace
, select the project - Select Data Set, select the table
- Go to
Details
tab - Under
Table info
, verifyCustomer-managed key
is present. - Repeat for each table in all data sets for all projects.
From Google Cloud CLIβ
List all dataset names
bq ls
Use the following command to view the table details. Verify the kmsKeyName
is present.
bq show <table_object>
Default Valueβ
Google Managed keys are used as key encryption keys
.