A DevOps team is setting up an automated deployment pipeline for a microservice in a GCP project named `project-staging`. The pipeline's dedicated service account must be able to push compiled container images to an Artifact Registry repository named `app-repo` and manage Kubernetes deployments within the project's GKE cluster. Following the principle of least privilege, which TWO role assignments should the team grant to the service account? (Select TWO.)
- Grant the Artifact Registry Writer (roles/artifactregistry.writer) role to the service account on the app-repo repository.Answer
- Grant the Kubernetes Engine Developer (roles/container.developer) role to the service account on project-staging.Answer
- CGrant the Editor (roles/editor) primitive role to the service account on project-staging.
- DGrant the Kubernetes Engine Admin (roles/container.admin) role to the service account at the parent Folder level.
Answer
The team should grant the Artifact Registry Writer role on the app-repo repository resource and the Kubernetes Engine Developer role on the project-staging project resource.
To satisfy security standards and the principle of least privilege, IAM permissions must be granted using fine-grained predefined roles scoped to the specific target resources. The Artifact Registry Writer role grants permission to push images to the app-repo repository without allowing administrative changes to the registry instance. The Kubernetes Engine Developer role allows creating and updating Kubernetes workloads in the project's GKE cluster without granting cluster creation or node modification permissions.
Step-by-Step Solution
Key Concept
Applying the Principle of Least Privilege using Predefined IAM Roles and Specific Resource Scopes