You need to configure secure, keyless authentication for an external GitHub Actions CI/CD pipeline accessing Google Cloud resources using Workload Identity Federation. What is the correct sequence of steps to establish this setup?
- 1Create a Google Cloud Service Account and assign it the minimum necessary IAM roles required for the deployment tasks.
- 2Create a Workload Identity Pool and configure an OIDC Provider mapped to GitHub's issuer URL.
- 3Grant the GitHub repository principal the Workload Identity User role (roles/iam.workloadIdentityUser) on the target Service Account.
- 4Configure the GitHub Actions workflow step to authenticate via the Workload Identity Provider and obtain short-lived Google Cloud access tokens.
Answer
The correct sequence starts with creating the target GCP Service Account with minimal IAM roles, creating the Workload Identity Pool and Provider for GitHub, granting the external GitHub principal the Workload Identity User role on the service account, and finally configuring the CI/CD workflow to request short-lived tokens.
Configuring Workload Identity Federation requires defining the target GCP Service Account first, establishing the Workload Identity Pool and OIDC Provider, granting the Workload Identity User role to authorize impersonation by the external identity, and lastly configuring the external workload to exchange tokens.
Step-by-Step Solution
Key Concept
Workload Identity Federation for keyless authentication