Bitzu

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

Single choice

Which encryption option is applied to Cloud Storage data automatically, with no setup?

  1. Customer-supplied encryption keys
  2. CMEK in Cloud KMS
  3. Google-managed encryption keys
  4. 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.

Select all that apply

Which steps are needed to make a bucket use a CMEK by default?

  1. Create a key in Cloud KMS in the bucket's location
  2. Send the key with every upload request
  3. Grant the Cloud Storage service agent the Encrypter/Decrypter role on the key
  4. Set the key as the bucket's default encryption key
  5. 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

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.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module