A cloud architect at an enterprise logistics company is advising a development team on establishing secure deployment practices. The team's automated CI/CD pipeline deploys application workloads onto Compute Engine virtual machines that execute under a dedicated runtime application service account. To enable the CI/CD pipeline identity to attach this runtime service account to newly created virtual machine instances during deployment, developers plan to assign the CI/CD service account the Service Account Admin role. Which recommendation should the architect provide to adhere to Google Cloud security best practices and the principle of least privilege?
- Grant the CI/CD pipeline service account the Service Account User role on the specific runtime application service account.Answer
- BGrant the CI/CD pipeline service account the Service Account Admin role at the project level.
- CGrant the CI/CD pipeline service account the primitive Editor role across the project.
- DMigrate the application deployment target to a Google Kubernetes Engine (GKE) cluster to manage service account attachments automatically.
Answer
Grant the CI/CD pipeline service account the Service Account User role (roles/iam.serviceAccountUser) on the specific runtime application service account.
The correct recommendation is to grant the Service Account User role (roles/iam.serviceAccountUser) to the CI/CD pipeline service account on the specific runtime application service account. This allows the pipeline identity to pass the runtime service account to Compute Engine instances without granting administrative privileges to alter service accounts or project IAM policies.
Step-by-Step Solution
Key Concept
Applying Least Privilege with Service Account User Roles in Deployment Pipelines
Estimated Time:1m 30s