Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud DevOps Engineer practice bank has 1,455 more like it. Try 10 free: instant score, no account.
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?
This pattern creates a Workload Identity Pool and OIDC provider but binds the IAM role (roles/iam.workloadIdentityUser) to the entire pool principalSet (principalSet://iam.googleapis.com/.../workloadIdentityPools/POOL_ID/*) without restricting access using attribute conditions or specific subject identifiers.
principalSet://.../*), any GitHub user or repository that obtains a valid OIDC token from GitHub could exchange it and impersonate your Google Cloud service account.repository or repository_owner) provided in GitHub Actions OIDC tokens.The identity provider was an entirely single-tenant, private enterprise IdP (e.g., an internal corporate Okta or Entra ID tenant) where all authenticated tokens are strictly trusted employees with identical baseline authorization needs.
Fleet Workload Identity Federation and GKE attached clusters provide mechanisms to federate Kubernetes Service Accounts (KSAs) across attached GKE or non-GKE Kubernetes clusters (such as AKS, EKS, or on-premises clusters) into Google Cloud IAM using the default PROJECT_ID.svc.id.goog pool.
serviceAccount:PROJECT_ID.svc.id.goog[NAMESPACE/KSA_NAME].You were deploying containerized applications running inside an on-premises or multi-cloud Kubernetes cluster (such as Azure AKS or AWS EKS) and needed those in-cluster Pod workloads to securely access Google Cloud APIs.
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.
This method involves generating a static, long-lived Google Cloud service account JSON key, storing the key payload as a secret in Secret Manager, and attempting to retrieve it during workflow execution using another credential mechanism.
You were storing third-party API tokens, database credentials, or application passwords that legacy external systems must retrieve, where identity federation protocols like OIDC are not supported.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated