An organization requires a newly onboarded security compliance officer to inspect Cloud Key Management Service (Cloud KMS) key rings and key metadata within a target project named `sec-ops-prod`. The compliance officer must be able to view key configurations and IAM policy bindings on the keys, but must not be granted permissions to decrypt data, create new keys, or access resources in adjacent projects located under the same parent folder. Which IAM role assignment adheres to the principle of least privilege?
- Grant the Cloud KMS Viewer role (`roles/cloudkms.viewer`) to the compliance officer on the `sec-ops-prod` project.Answer
- BGrant the Viewer primitive role (`roles/viewer`) to the compliance officer on the parent folder containing `sec-ops-prod`.
- CGrant the Editor primitive role (`roles/editor`) to the compliance officer on the `sec-ops-prod` project.
- DGrant the Cloud KMS Admin role (`roles/cloudkms.admin`) to the compliance officer on the `sec-ops-prod` project.
Answer
Granting the Cloud KMS Viewer role (`roles/cloudkms.viewer`) to the user on the `sec-ops-prod` project provides read-only inspection of key metadata and IAM policies without decryption or key creation privileges.
Assigning the Cloud KMS Viewer role (`roles/cloudkms.viewer`) at the target project level (`sec-ops-prod`) fulfills the requirement cleanly. It permits viewing key rings, keys, and IAM policies, but explicitly excludes cryptographic operations like decryption as well as administrative privileges like key creation, adhering strictly to the principle of least privilege.
Step-by-Step Solution
Key Concept
Principle of Least Privilege and Resource Hierarchy Scope in GCP IAM
Estimated Time:2m 0s