A DevOps team is configuring access control for an automated CI/CD deployment pipeline in a Google Cloud project named `payment-gateway-prod`. The pipeline's service account requires permissions to create and update Cloud Run service revisions, as well as read build configuration objects stored in a single specific Cloud Storage bucket named `payment-config-bucket`. Adhering strictly to the Principle of Least Privilege, which IAM role configuration should be applied?
- Grant `roles/run.developer` at the project level, and grant `roles/storage.objectViewer` directly on the `payment-config-bucket` bucket resource.Answer
- BGrant `roles/editor` at the project level, and grant `roles/viewer` directly on the `payment-config-bucket` bucket resource.
- CGrant `roles/run.developer` and `roles/storage.objectViewer` at the parent Folder level containing `payment-gateway-prod`.
- DGrant `roles/run.admin` at the project level, and grant `roles/storage.admin` directly on the `payment-config-bucket` bucket resource.
Answer
Granting `roles/run.developer` at the project level and `roles/storage.objectViewer` directly on the `payment-config-bucket` bucket resource provides the exact necessary permissions without granting excessive administrative privileges or expanding access to other projects.
The correct selection uses predefined roles (`roles/run.developer` and `roles/storage.objectViewer`) mapped specifically to the required operational tasks, and limits the Cloud Storage role binding directly to the specific bucket resource rather than project-wide or folder-wide.
Step-by-Step Solution
Key Concept
Applying Least Privilege via Predefined Roles and Resource-Level IAM Scoping
Estimated Time:2m 0s