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 manages a Google Cloud resource hierarchy consisting of an Organization node, several environment folders (Production, Staging, Development), and dozens of child projects. The security team wants to implement tag-based access control (TBAC) with IAM Conditions to grant the Cloud Operations team (cloud-ops@example.com) administrative permissions across virtual machines under the following requirements:
roles/compute.admin dynamically only on resources evaluated with the environment: production tag value.Production folder must automatically inherit production tag enforcement without requiring per-project configuration, while allowing descendant resources to override the tag value when necessary.Which strategy should the security engineer implement?
environment: production directly to the Production folder, grant roles/compute.admin unconditionally at the folder level, and deploy an Organization Policy with a DENY rule matching !resource.hasTagKeyId().This option grants the Compute Admin role unconditionally to the operations team at the Production folder level, relying on an Organization Policy constraint to deny actions on untagged resources.
Production hierarchy without a baseline tag state.roles/compute.admin unconditionally at the folder level grants full administrative rights over every compute resource in every project under that folder, regardless of specific resource-level tag overrides or fine-grained tag evaluations.The requirement was to enforce a preventive compliance guardrail across the organization preventing the creation or modification of untagged VM resources via custom organization policy constraints.
environment: default to the Organization resource, attach the tag value environment: production to each project under the Production folder, and grant roles/compute.admin using an IAM condition with resource.matchTag() using namespaced names.This option creates a safe default at the organization level and assigns the production tag directly to each child project individually, while using the resource.matchTag('ORGANIZATION_ID/environment', 'production') function in the IAM condition expression.
Production folder directly propagates the tag down to all child projects automatically, making manual per-project tagging redundant and operationally inefficient.resource.matchTag()) introduces security vulnerabilities around identifier reuse. If an administrator deletes the tag key or value and recreates it with the exact same display and short name, the IAM policy condition will automatically evaluate to true on the new resource, creating unintended access drift.The infrastructure was managed exclusively via declarative infrastructure-as-code tools that regularly destroy and recreate tag definitions and do not support static permanent tag IDs, and where folder-level inheritance was not required.
env=production to compute instances, configure a custom organization policy to enforce the label across folders, and grant roles/compute.admin conditionally using resource.labels in the IAM policy binding.This option proposes using Compute Engine resource labels (env: production) combined with custom organization policies and evaluating access via IAM conditional expressions checking resource.labels.
The objective was to allocate and breakdown Google Cloud billing charges across different cost centers or filter audit logs within Cloud Logging rather than governing IAM permissions across a resource hierarchy.
environment: default to the Organization resource, attach the tag value environment: production to the Production folder, and grant roles/compute.admin to cloud-ops@example.com at the organization level using an IAM condition with resource.matchTagId() referencing the permanent tag key and value IDs.This architecture combines Resource Manager tag inheritance, safe default tag bindings, and IAM Conditions using permanent resource IDs (tagKeys/KEY_ID and tagValues/VALUE_ID) to dynamically enforce least-privilege administrative access across the Google Cloud resource hierarchy.
environment: default at the root Organization resource ensures that all descendant folders, projects, and resources automatically inherit a baseline non-production tag state through hierarchy inheritance.environment: production directly to the Production folder overrides the organization-level safe default for that entire subtree. All child projects and compute instances under the Production folder automatically compute an effective tag of environment: production without manual project-level tagging, while retaining the capability to be overridden at lower levels if needed.roles/compute.admin at the organization level with a condition using resource.matchTagId() ensures that members of cloud-ops@example.com only obtain administrative rights when acting against resources whose effective tags match the production tag identifier.tagKeys/123456789012 and tagValues/567890123456) ensures that if a tag key or value is deleted and subsequently recreated with identical short names or namespaced names, unauthorized access is not unintentionally restored or granted to the new tag resources.This approach aligns with Google Cloud security best practices by implementing safe defaults at the root node, delegating environment-specific governance to folder structures, and utilizing immutable permanent identifiers in IAM CEL expressions to eliminate privilege escalation vectors.
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