You are designing a Data Warehouse on Google Cloud and want to store sensitive data in BigQuery. Your company requires you to generate the encryption keys outside of Google Cloud. You need to implement a solution. What should you do?
A.
Generate a new key in Cloud Key Management Service (Cloud KMS). Store all data in Cloud Storage using the customer-managed key option and select the created key. Set up a Dataflow pipeline to decrypt the data and to store it in a new BigQuery dataset.
B.
Generate a new key in Cloud KMS. Create a dataset in BigQuery using the customer-managed key option and select the created key.
C.
Import a key in Cloud KMS. Store all data in Cloud Storage using the customer-managed key option and select the created key. Set up a Dataflow pipeline to decrypt the data and to store it in a new BigQuery dataset.
D.
Import a key in Cloud KMS. Create a dataset in BigQuery using the customer-supplied key option and select the created key.
The answer is easy. It says keys must be left outside of Google Cloud.
This automatically eliminates A / B.
Now the C option says decrypts before storing it in BigQuery which the point is to encrypt the data while been in BigQuery, D is the only possible answer.
It is a tricky distinction because of the term collision.
However, "import key to KMS" does not mean CSEK.
CSEK does not get imported or stored in KMS at all. CSEK "customer supplied" is per-transaction uploaded by every API call by the user/client (no KMS).
This situation "customer supplied" means created from non-GCP KMS (could be on-prem or EKM). Once a key is imported to KMS it is treated as CMEK. The API client calling GCS doesn't need to upload the key. It lives in KMS. That is not the same "per-transaction" upload as CSEK.
C - won't encrypt data in BQ with customer key.
A,B - you will generate key inside the GCP (what is also wrong by requirements)
D - looks good, but say to select CSEK... but after importing the key to KMS it becomes a customer-managed.
I would select the D
The answer cannot be D since BigQuery does not support customer provided keys, only customer managed keys generated in Cloud KMS. So B is the only viable option that doesn't add complexity.
GCP docu says "BigQuery and BigLake tables don't support Customer-Supplied Encryption Keys (CSEK)."
However, I just tested it and it worked:
1. Create Key
openssl rand 32 > ./key2
2. Import into KMS
gcloud kms keys versions import --import-job csek1 --location us-west1 --keyring csek --key csek --algorithm google-symmetric-encryption --target-key-file ./key2
3. In Cloud Console: select the key when creating a new data set and table in BigQuery
I would go with C.
https://cloud.google.com/bigquery/docs/customer-managed-encryption
Read that document in the link carefully.
1st paragraph: "By Default, BigQuery encrypts your content stored at rest";
1st bullet point, 2nd paragraph under the [Before you Begin] section: "BigQuery and BigLake tables don't support Customer-Supplied Encryption Keys (CSEK)"
There is also a difference between CMEK and CSEK.
CMEK: you can create and manage a key using Cloud KMS;
CSEK: you specify the contents of the key;
Ref for CMEK vs CSEK:
https://cloud.google.com/sql/docs/mysql/cmek#:~:text=Note%3A%20Customer%2Dmanaged%20encryption%20keys,specific%20resources%20across%20Google%20Cloud.
Even though I'll chose C for the answer over D, because of the terminology in "BQ using customer-supplied key", I have an issue with this:
To me it does not make any sense.
The data is being encrypted by some key say K1 to store in Cloud Storage, then Decrypted, to be Re-Encrypted (automatically by say K2 [a google created key]) by BigQuery when being stored. This negates the use of K1 on your Data Storage in BigQuery.
It makes no sense. If someone sees this differently, I'd love to hear it. Thanks.
If you want to control encryption yourself, you can use customer-managed encryption keys (CMEK) for BigQuery.
https://cloud.google.com/bigquery/docs/customer-managed-encryption
D is correct. I had this question on the exam toaday and I go with D.
Explanation is - Generate the key outside the GCP so C and D are correct.
"Set up a Dataflow pipeline to decrypt the data and to store it in a new BigQuery dataset" is not correct becuase it means that data exist on GCP what is not correct. Only D is correct.
Yes, BigQuery and BigLake tables don't support Customer-Supplied Encryption Keys (CSEK). Answer must be either A or C, since the say generate key outside Google Cloud, import the key, hence I go for the answer C.
https://cloud.google.com/bigquery/docs/customer-managed-encryption#before_you_begin
https://cloud.google.com/kms/docs/importing-a-key
Answer D is incorrect because BigQuery does not support the use of customer-supplied keys to encrypt data at rest. Instead, you can use customer-managed encryption keys in Cloud KMS to encrypt the data in BigQuery. To do this, you can either generate a new key in Cloud KMS (answer A) or import an existing key (answer C). Once you have a key in Cloud KMS, you can create a BigQuery dataset and select the key as the customer-managed key for the dataset. This will enable BigQuery to use the key to encrypt the data in the dataset.
Yes, BigQuery and BigLake tables don't support Customer-Supplied Encryption Keys (CSEK). Answer must be either A or C, since the say generate key outside Google Cloud, import the key, hence I go for the answer C.
You have to know the difference between CSEK and "imported keys to KMS". Those are not the same things. CSEK is never stored in KMS, obviously an imported key is. It is then as available as any CMEK to BQ.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
alexandercamachop
Highly Voted 2 years, 2 months agoSephethus
5 months, 1 week agoSweetieS
Highly Voted 3 years, 3 months agoSR23222
1 year, 5 months ago[Removed]
1 year, 3 months ago[Removed]
1 year, 3 months ago25lion52
Most Recent 1 month, 3 weeks agoSephethus
5 months, 1 week agoSephethus
5 months, 1 week agoodacir
1 year agothewalker
1 year agodevnul
1 year, 3 months ago[Removed]
1 year, 3 months agojits1984
1 year, 7 months agon_nana
1 year, 8 months agomedi01
1 year, 7 months agon_nana
1 year, 8 months agoA21325412
1 year agoA21325412
1 year agonandoD
1 year, 6 months agoSR23222
1 year, 5 months agoAugustoKras011111
1 year, 8 months agosmachnio
1 year, 10 months agoexamch
1 year, 10 months agoNodummyIQ
1 year, 10 months agoexamch
1 year, 10 months agoexamch
1 year, 10 months agoexamch
1 year, 10 months ago[Removed]
1 year, 3 months agosurajkrishnamurthy
1 year, 11 months agoale_brd_111
1 year, 11 months agotomahawk003
1 year, 11 months ago