An enterprise DevOps team needs to provision access for an automated deployment service account. The service account must be capable of creating, updating, and managing Google Cloud Pub/Sub topics and subscriptions within a staging project, but must not be granted permissions to modify IAM policies or access unrelated services. To follow Google Cloud security best practices and the principle of least privilege, which IAM configuration approach should you choose?
- AGrant the primitive Editor role (roles/editor) to the service account at the staging project level.
- Grant the predefined Pub/Sub Admin role (roles/pubsub.admin) to the service account at the staging project level.Answer
- CGrant the Pub/Sub Admin role (roles/pubsub.admin) at the parent folder level, and explicitly revoke Pub/Sub permissions at the staging project level.
- DGrant the Billing Account User role (roles/billing.user) on the staging project to authorize Pub/Sub resource provisioning.
Answer
Grant the predefined Pub/Sub Admin role (roles/pubsub.admin) to the service account at the staging project level.
Granting the predefined Pub/Sub Admin role (roles/pubsub.admin) directly at the staging project level gives the service account full management permissions for Pub/Sub topics and subscriptions while preventing access to unrelated GCP services or project IAM settings, perfectly fulfilling the principle of least privilege.
Step-by-Step Solution
Key Concept
Managing IAM Roles and Resource Access Permissions
Estimated Time:2m 0s