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.
An enterprise organization is refining access controls to comply with the principle of least privilege across its development environments. The security team needs to grant an operational group the Compute Instance Admin role (roles/compute.instanceAdmin.v1) on a folder containing multiple projects.
The access policy must meet the following constraints:
environment: development Resource Manager tag (either directly attached or inherited).Which IAM condition expression should the security engineer attach to the role binding?
resource.hasTagKeyId() doesresource.hasTagKeyId() is an IAM Conditions function that evaluates whether a resource has any tag associated with a specific tag key ID, regardless of what value is assigned to that key.
environment). It does not differentiate between environment: development, environment: staging, or environment: production.environment key, including production workloads, directly violating the principle of least privilege.The security policy required administrative access on all instances categorized under any environment classification whatsoever, rather than specifically restricting access to development VMs.
resource.matchTag() isresource.matchTag() is an IAM Conditions function that checks for the presence of a Resource Manager tag on a resource using the organization's namespaced tag key (e.g., 123456789012/environment) and the tag value's short name (development).
environment tag key or development tag value and later creates a new tag key/value pair with the identical short names, the condition will immediately match the new tags.The requirement prioritized declarative infrastructure-as-code maintainability across tag recreation cycles over strict protection against tag reuse vulnerabilities.
resource.matchTagId() isresource.matchTagId() is an IAM Conditions function that evaluates whether a target resource has a specific Resource Manager tag attached or inherited, referencing the tag key and tag value by their globally unique, immutable permanent resource IDs (e.g., tagKeys/123456789012 and tagValues/567890123456).
true exclusively for resources that have the specific tag key and tag value pair applied directly or inherited down the resource hierarchy.environment: development), the new entity receives a brand-new permanent ID. Consequently, the existing condition will not match the recreated tag, preventing unauthorized or unintended privilege grants.While using short names via resource.matchTag() is convenient for declarative scripting, it carries the inherent risk that recreated tags with the same name automatically inherit historical IAM grants. Using resource.matchTagId() provides the highest level of security assurance against inadvertent privilege assignment.
resource.name.extract() doesresource.name.extract() is a string-manipulation function in IAM Conditions that extracts substrings from a resource's full Google Cloud resource name based on an extraction template, enabling prefix or pattern matching.
dev-vm-01) rather than evaluating Resource Manager tags.dev- prefix.The organization did not utilize Resource Manager tags and instead enforced access controls strictly through structured VM naming conventions across zones.
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