Prepare and test your skills
Prepare and test your skills
Free sample question, answered and explained below. The Professional Cloud Security Engineer practice bank has 1,343 more like it. Try 10 free: instant score, no account.
A security engineer is configuring a SAML 2.0 workforce identity pool provider using the Google Cloud CLI (gcloud). The organization has the following requirements for workforce users authenticating to Google Cloud:
assertion.attributes.department[0]) to a custom workforce attribute.SecOps-Engineers group claim and possessing an email ending with @example.com are permitted to authenticate to the workforce pool.Which configuration flags should the security engineer provide in the gcloud iam workforce-pools providers create-saml command?
--attribute-mapping="google.subject=assertion.subject.lowerAscii(),attribute.department=assertion.attributes.department[0],google.groups=assertion.attributes.groups" --attribute-condition="'SecOps-Engineers' in assertion.attributes.groups && assertion.attributes.email[0].endsWith('@example.com')"
Workforce Identity Federation allows enterprise users to authenticate directly to Google Cloud services using external Identity Providers (IdPs) via SAML 2.0 or OIDC without account synchronization. When establishing a provider, administrators configure attribute mappings to map IdP assertion claims to Google Cloud attributes (such as google.subject, google.groups, and custom attribute.* keys) and define attribute conditions using Common Expression Language (CEL) expressions to restrict authentication access at the provider boundary.
google.subject=assertion.subject.lowerAscii() ensures the unique subject identity is extracted from the SAML assertion and normalized to lowercase using the CEL .lowerAscii() string transformation function.attribute. prefix. Mapping attribute.department=assertion.attributes.department[0] correctly exposes the department claim to IAM policies and downstream access configurations.--attribute-condition="'SecOps-Engineers' in assertion.attributes.groups && assertion.attributes.email[0].endsWith('@example.com')" evaluates whether 'SecOps-Engineers' is present in the list of groups and verifies that the user's email ends with the mandatory @example.com domain using logical && and standard CEL list/string operators.false.attribute.department) and standard groups (google.groups) for use in IAM condition bindings and service access controls.This syntax strictly adheres to Google Cloud's CEL specification for Workforce Identity Federation providers, combining proper attribute naming conventions with valid CEL methods (.lowerAscii(), in, &&, and .endsWith()).
--attribute-mapping="google.subject=assertion.subject,google.custom.department=assertion.attributes.department,google.groups=assertion.attributes.groups" --condition="assertion.attributes.groups.contains('SecOps-Engineers') AND assertion.attributes.email.like('%@example.com')"
This option attempts to map attributes using a non-standard google.custom. namespace and supplies an invalid --condition flag with SQL-style syntax (AND, like) rather than Common Expression Language (CEL).
attribute.NAME prefix rather than google.custom.NAME.google.subject=assertion.subject omits .lowerAscii(), failing to normalize user subject identifiers.gcloud workforce provider commands use --attribute-condition rather than --condition. Furthermore, CEL does not support SQL keywords like AND or like('%...'); it requires && and CEL functions like .endsWith().The CLI tool accepted generic SQL-like syntax predicates and supported arbitrary google.custom naming conventions.
--attribute-mapping="google.subject=assertion.subject.toLower(),attribute.department=assertion.attributes.department[0],google.groups=assertion.attributes.groups" --attribute-condition="assertion.attributes.groups.has('SecOps-Engineers') && assertion.attributes.email[0].matches('*@example.com')"
This option defines attribute mapping and conditions using string and collection methods that do not exist in the CEL specification supported by Google Cloud Workforce Identity Federation.
.toLower() method; string casing transformations in Google Cloud CEL expressions must use .lowerAscii()..has() is not a standard list membership method in CEL for array inspection. Membership checks in CEL utilize the in operator (e.g., 'value' in list)..matches() function expects a valid RE2 regular expression (e.g., .*@example\.com$), whereas *@example.com is an invalid glob pattern that triggers a syntax compilation error..toLower() fail CEL compilation during workforce pool provider creation.Google Cloud CEL supported standard JavaScript/Python naming conventions such as .toLower() and .has() on primitive types and lists.
--attribute-mapping="google.subject=assertion.email,attribute.department=assertion.attributes.department,google.groups=assertion.attributes.groups" --attribute-condition="'SecOps-Engineers' in google.groups && google.subject.endsWith('@example.com')"
This option attempts to reference output target attributes (google.groups and google.subject) within the --attribute-condition expression rather than referencing incoming identity assertion attributes (assertion.*).
--attribute-condition is evaluated directly against the incoming IdP token payload via the assertion object prior to final Google attribute mapping. Referencing google.groups or google.subject directly within --attribute-condition causes attribute resolution errors.assertion.email is not passed through .lowerAscii(), which is recommended for consistent identity mapping.assertion.attributes.department[0]), so referencing unindexed list attributes where string values are expected can cause typing mismatches.Google Cloud evaluated provider attribute conditions strictly after full mapping transformation and allowed direct referencing of the google.* target namespace in condition filters.
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