An enterprise security policy requires that an external automated CI/CD pipeline operating outside of Google Cloud deploy infrastructure into a project named `prod-app-services`. To eliminate security risks associated with long-lived credentials, a cloud administrator creates a dedicated deployment service account named `[email protected]` and configures Workload Identity Federation. Which IAM role configuration should the administrator apply to grant the external workload permission to act as the service account while following Google Cloud security best practices?
- Grant the external workload identity principal the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) directly on the deployer-sa service account resource.Cevap
- BCreate and export a Service Account JSON private key for deployer-sa and store the key securely in the external CI/CD pipeline's secret variables.
- CAssign the primitive Editor role to the external workload identity at the project level so it has complete control to manage and use service account credentials.
- DGrant the Service Account User role (roles/iam.serviceAccountUser) to the external workload identity at the Organization resource level, relying on project-level policy inheritance to restrict usage to deployer-sa.
Cevap
Grant the external workload identity principal the Service Account Token Creator role (roles/iam.serviceAccountTokenCreator) directly on the deployer-sa service account resource.
Granting the Service Account Token Creator role directly on the specific target service account allows the external workload identity to mint short-lived tokens for that exact account via Workload Identity Federation. This satisfies security requirements by maintaining a keyless authentication architecture while enforcing least privilege resource scoping.
Adım Adım Çözüm
Anahtar Kavram
Service Account Impersonation & Workload Identity Least Privilege