A cloud engineer needs to set up secure, keyless authentication for an external CI/CD pipeline to deploy containerized microservices to Google Cloud Run using Workload Identity Federation. In what order should the engineer perform the following steps to configure the service account identity and authorization according to GCP security best practices?
- 1Create a dedicated user-managed service account in the GCP project to represent the CI/CD deployment workload.
- 2Grant the service account the minimum predefined IAM roles (e.g., Cloud Run Admin and Service Account User) at the project level.
- 3Create a Workload Identity Pool and Workload Identity Provider configured with the external identity provider's OIDC issuer URL and attribute mappings.
- 4Add an IAM policy binding granting the Workload Identity User role (`roles/iam.workloadIdentityUser`) on the service account to the external workload identity principal.
Answer
The correct sequence begins by creating the dedicated service account, granting it the required deployment roles, provisioning the Workload Identity Pool and Provider for external OIDC trust, and finally binding the Workload Identity User role on the service account to the external principal.
Establishing keyless deployment via Workload Identity Federation follows a clear dependency sequence: create the target GCP service account identity, grant it specific predefined permissions needed for the workload, set up the Workload Identity Pool/Provider to validate external OIDC tokens, and grant the external workload principal the Workload Identity User role on the service account to allow secure impersonation.
Step-by-Step Solution
Key Concept
Workload Identity Federation Service Account Configuration Sequence