An enterprise organization is establishing an automated CI/CD release pipeline using Cloud Build and Cloud Deploy to manage infrastructure and application workloads across GCP environments. The security architecture team requires that the pipeline adheres strictly to the principle of least privilege, specifically ensuring Cloud Build can impersonate dedicated target execution service accounts without gaining administrative control over IAM permissions or using over-privileged roles. Which architectural configuration correctly satisfies these requirements?
- Grant the Cloud Build service account the Service Account User role (roles/iam.serviceAccountUser) on the specific target execution service accounts, and assign appropriate predefined Cloud Deploy roles for release creation.Cevap
- BAssign the primitive Owner role (roles/owner) to the Cloud Build service account at the GCP project level to simplify deployment permissions across all target environments.
- CGrant the Service Account Admin role (roles/iam.serviceAccountAdmin) to the Cloud Build service account on the target execution service accounts to enable deployment execution.
- DStore and manage Terraform state files on the Cloud Build runner's local ephemeral filesystem to bypass remote backend state permission requirements.
Cevap
Grant the Cloud Build service account the Service Account User role (roles/iam.serviceAccountUser) on the specific target execution service accounts, and assign appropriate predefined Cloud Deploy roles for release creation.
The principle of least privilege requires granting the minimal set of permissions necessary to execute pipeline tasks. To allow Cloud Build to impersonate dedicated deployment execution service accounts, the Cloud Build service account must be granted the Service Account User role (roles/iam.serviceAccountUser) specifically on those target service accounts.
Adım Adım Çözüm
Anahtar Kavram
Least-privilege IAM configuration for automated CI/CD pipeline service account impersonation.