Professional Cloud DevOps Engineer
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
Your enterprise organization uses GitHub Actions CI/CD workflows to build and deploy multi-tier containerized applications to Google Cloud. Your security team mandates the elimination of all long-lived service account keys to mitigate credential leakage risks. Additionally, you must ensure that only CI/CD pipelines originating from specific repositories within your GitHub organization are permitted to impersonate the target deployment service accounts.
How should you configure Workload Identity Federation to meet these security and operational requirements?
Create a Workload Identity Pool and configure an OIDC Provider for GitHub Actions with attribute mappings and an attribute condition filtering on repository attributes, then grant the specific federated principal impersonation permissions on the deployment service account using the Workload Identity User role.
Register the GitHub runner infrastructure as an attached cluster in GKE Multi-Cloud and map Kubernetes Service Accounts using fleet-wide Workload Identity Federation.
Configure a Workload Identity Pool and OIDC Provider, and grant the Workload Identity User role on the deployment service account to all members of the workload identity pool principalSet.
Generate a long-lived service account JSON key, store it encrypted inside Google Secret Manager, and configure the GitHub Actions workflow to fetch the key via a bootstrap service account.
Workload Identity Federation enables external workloads—such as GitHub Actions CI/CD pipelines—to securely exchange external ambient credentials (such as an OpenID Connect token) for short-lived Google Cloud access tokens. By configuring a Workload Identity Pool, an OIDC Provider, and defining precise attribute mappings and attribute conditions, you establish identity federation without generating, distributing, or rotating static, long-lived service account JSON keys.
assertion.repository_owner == 'my-org' or checking specific repository paths) ensures that GitHub ID tokens issued to external tenants or untrusted repositories are rejected during the token exchange.roles/iam.workloadIdentityUser role on the specific service account to a targeted federated principal (e.g., principal://iam.googleapis.com/.../subject/repo:my-org/my-repo:... or an attribute-mapped subject) rather than opening it to an entire pool prevents lateral privilege escalation.https://token.actions.githubusercontent.com) and standard JSON Web Key Set (JWKS) validation.This approach aligns with Google Cloud's official security best practices for federating multi-tenant external identity providers. Attribute conditions provide strict boundary enforcement against multi-tenant spoofing risks while fully automating secure, short-lived credential issuance directly inside CI/CD workflows.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.
Still curious? Scout, our AI tutor, can explain this concept further and answer your follow-up questions.