Associate Cloud Engineer ยท Managing Cloud Storage and encryption keys
What is CMEK and how do you apply it to a bucket?
Default Google-managed encryption vs CMEK vs customer-supplied keys, Cloud KMS key rings and keys, granting the service agent encrypt/decrypt, applying CMEK to buckets, disks and databases.
Key points
- Data is always encrypted by default with Google-managed keys.
- With CMEK you create a key in Cloud KMS (key ring in the same location as the bucket), grant the Cloud Storage service agent roles/cloudkms.cryptoKeyEncrypterDecrypter on it, then set it as the bucket default with gcloud storage buckets update --default-encryption-key.
- Existing objects are not re-encrypted.
Source: https://docs.cloud.google.com/storage/docs/encryption/using-customer-managed-keys
Practice questions
Which encryption option is applied to Cloud Storage data automatically, with no setup?
- Customer-supplied encryption keys
- CMEK in Cloud KMS
- Google-managed encryption keys
- Client-side encryption
Show answer
Answer: C. Google-managed encryption keys
Google-managed encryption is the default at no extra cost. CMEK and CSEK both require you to configure keys.
Which steps are needed to make a bucket use a CMEK by default?
- Create a key in Cloud KMS in the bucket's location
- Send the key with every upload request
- Grant the Cloud Storage service agent the Encrypter/Decrypter role on the key
- Set the key as the bucket's default encryption key
- Delete all existing objects first
Show answer
Answer: A. Create a key in Cloud KMS in the bucket's location, C. Grant the Cloud Storage service agent the Encrypter/Decrypter role on the key, D. Set the key as the bucket's default encryption key
You need a key in the right location, the service agent's encrypt/decrypt role on it, and the key set as the bucket default. You never upload key material per request (that is CSEK), and existing objects need not be deleted.
True or false: setting a default CMEK on a bucket re-encrypts the objects already stored in it.
Show answer
Answer: False
False. Changing or removing the default key affects only objects written afterwards; existing objects keep their current encryption state.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
