An organization is implementing a zero-trust credential architecture to allow workloads running on an external on-premises Kubernetes cluster to retrieve sensitive credentials stored in Google Cloud Secret Manager. To comply with strict security standards, you must eliminate all static, long-lived service account keys and enforce least privilege. Arrange the operational and architectural steps in the correct chronological order required to establish Workload Identity Federation and securely retrieve the secret payload.
- 1Create a dedicated Google Cloud Service Account and grant it the Secret Manager Secret Accessor (`roles/secretmanager.secretAccessor`) IAM role scoped strictly to the target secret resource.
- 2Create a Workload Identity Pool and configure an OIDC Workload Identity Provider specifying the external Kubernetes cluster issuer URL and target audience.
- 3Grant the Workload Identity User (`roles/iam.workloadIdentityUser`) role on the Google Cloud Service Account to the specific external principal subject (`principal://...`).
- 4Exchange the external Kubernetes Service Account OIDC JSON Web Token (JWT) for a short-lived Google Cloud Security Token Service (STS) token, and generate a federated access token.
- 5Call the Secret Manager API (`secrets.versions.access`) using the short-lived access token to fetch the secret payload.
Answer
The correct sequence begins by creating the target Google Cloud Service Account with restricted Secret Manager Accessor permissions, followed by creating the Workload Identity Pool and OIDC Provider, granting the Workload Identity User role to the specific external principal subject, exchanging the external OIDC token for a short-lived GCP token via STS, and finally accessing the secret payload.
The sequence follows the compulsory architectural workflow for Workload Identity Federation: first defining the GCP service account with least privilege permissions, establishing the external trust boundary via Workload Identity Pool and Provider, binding the federated principal to the service account via Workload Identity User role, performing the runtime token exchange with STS, and using the resulting temporary token to access Secret Manager.
Step-by-Step Solution
Key Concept
Workload Identity Federation & Service Account Key Elimination