Professional Cloud Security 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.
A security architect is configuring Workload Identity Federation to allow external CI/CD pipelines running on a third-party OpenID Connect (OIDC) identity provider to access Google Cloud resources without using service account keys.
The incoming OIDC ID token contains the following claims:
sub: A unique subject string (under 127 bytes)repository_owner: The organization owning the repository (e.g., example-org)ref: The branch reference (e.g., refs/heads/main)environment: The deployment target environment (e.g., production)The security requirements are:
example-org targeting production can exchange tokens for Google Cloud credentials.Which configuration strategy should the architect implement?
Workload Identity Federation allows external workloads (such as third-party CI/CD runners, Kubernetes clusters, or multi-cloud services) to authenticate to Google Cloud by exchanging external OIDC or SAML assertions for short-lived Google Cloud federated tokens. Attribute mappings define how incoming token claims (assertion.CLAIM_NAME) map to standard Google attributes (google.subject) and custom attributes (attribute.CUSTOM_NAME). Attribute conditions use Common Expression Language (CEL) expressions evaluated by Google Cloud's Security Token Service (STS) to validate and filter assertions before issuing any federated credentials.
--attribute-condition="assertion.repository_owner == 'example-org' && assertion.environment == 'production'" ensures that the Workload Identity Pool Provider evaluates the incoming OIDC token assertions upon receipt. If the workload is not from example-org or is not deploying to production, STS immediately rejects the exchange request and refuses to issue a token.--attribute-mapping flag maps google.subject=assertion.sub (ensuring unique principal identity tracking under 127 bytes) and creates custom attributes attribute.owner and attribute.env from assertion.repository_owner and assertion.environment respectively.principalSet://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/attribute.env/production ensures that any authenticated identity carrying the mapped attribute.env value of production from that pool receives the necessary IAM permissions without managing long-lived keys.google.subject attributes appear directly in Cloud Audit Logs to provide traceability for every external workload action.Evaluating attribute conditions at the provider level minimizes security exposure and computational overhead by rejecting untrusted pipelines immediately. Leveraging mapped custom attributes in IAM principal sets ensures a least-privilege access model without creating individual service accounts or keys for each repository.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.