An organization requires an application service account residing in Project A to encrypt and decrypt sensitive application data using a Customer-Managed Encryption Key (CMEK) hosted in a central Cloud KMS project (Project B). The application service account must adhere to the principle of least privilege and must not possess permissions to create key versions, manage key ring permissions, or destroy keys. How should the cloud administrator configure IAM access for the service account in Project B?
- Grant the application service account the Cloud KMS CryptoKey Encrypter/Decrypter role (roles/cloudkms.cryptoKeyEncrypterDecrypter) directly on the target CryptoKey in Project B.Answer
- BGrant the application service account the primitive Editor role (roles/editor) at the Project B project level.
- CGrant the application service account the Cloud KMS Admin role (roles/cloudkms.admin) on the Key Ring in Project B.
- DDelete the Key Ring from Project B and recreate it inside Project A under the default Compute Engine service account to avoid cross-project IAM configuration.
Answer
Grant the application service account the Cloud KMS CryptoKey Encrypter/Decrypter role (roles/cloudkms.cryptoKeyEncrypterDecrypter) directly on the target CryptoKey in Project B.
Granting the Cloud KMS CryptoKey Encrypter/Decrypter role (roles/cloudkms.cryptoKeyEncrypterDecrypter) on the specific key provides the minimal set of permissions required to encrypt and decrypt data without allowing key administrative actions or project-level modification rights.
Step-by-Step Solution
Key Concept
Cloud KMS Predefined IAM Roles and Least Privilege Access Control