An enterprise platform engineering team manages an automated infrastructure pipeline. The pipeline uses a custom service account to provision new Google Cloud projects. During execution, a script in the pipeline executes the command `gcloud services enable artifactregistry.googleapis.com --project=fintech-core-prod` to enable the Artifact Registry API in the target project. The execution fails with an authorization error indicating permission denied. Adhering to the Google Cloud security principle of least privilege, which action should the system administrator take to resolve this issue?
- Grant the pipeline service account the Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`) on the `fintech-core-prod` project.Answer
- BGrant the pipeline service account the Service Usage Consumer role (`roles/serviceusage.serviceUsageConsumer`) on the `fintech-core-prod` project.
- CGrant the pipeline service account the Editor primitive role (`roles/editor`) on the parent Organization node in the resource hierarchy.
- DRun the `gcloud services enable` command against the pipeline's host project instead of specifying the `fintech-core-prod` project.
Answer
Grant the pipeline service account the Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`) on the target project.
To enable Google Cloud APIs, an identity requires the `serviceusage.services.enable` permission on the destination project. The Service Usage Admin role (`roles/serviceusage.serviceUsageAdmin`) provides permissions to list, enable, and disable services on a project, making it the minimal predefined role necessary to meet the principle of least privilege.
Step-by-Step Solution
Key Concept
API Enablement IAM Permissions and Least Privilege