A DevOps engineer needs to grant a CI/CD service account permission to push container images to a single specific Artifact Registry repository within the project `prod-apps-123`. Following the principle of least privilege, the service account must be allowed to write artifacts to this repository without permissions to delete artifacts, alter repository administrative settings, or gain access to other repositories in the organization hierarchy. Which IAM configuration should the engineer apply?
- Assign the Artifact Registry Writer (`roles/artifactregistry.writer`) role to the service account bound directly to the target Artifact Registry repository resource.Cevap
- BAssign the Editor (`roles/editor`) primitive role to the service account at the project level.
- CAssign the Artifact Registry Repository Administrator (`roles/artifactregistry.repoAdmin`) role to the service account at the organization level.
- DAssign the Artifact Registry Writer (`roles/artifactregistry.writer`) role to the service account at the parent folder level containing the project.
Cevap
Assign the Artifact Registry Writer role (`roles/artifactregistry.writer`) directly on the specific Artifact Registry repository resource.
Assigning the predefined Artifact Registry Writer role (`roles/artifactregistry.writer`) directly on the specific Artifact Registry repository satisfies the exact functional requirements while enforcing both least role privilege and narrowest resource scope.
Adım Adım Çözüm
Anahtar Kavram
Applying least privilege by combining predefined roles with precise resource-level IAM bindings.