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 engineer is tasked with evaluating the operational impact of a new constraint for the gcp.restrictServiceUsage organization policy across an enterprise resource hierarchy. The organization already has an active live policy configured on the organization node that restricts certain API services.
The engineer needs to configure the new constraint rules in dry-run mode to generate violation logs in Cloud Audit Logs without disrupting developer operations or modifying the existing live enforcement rules.
Which procedure should the security engineer follow using the Google Cloud CLI?
The Organization Policy Service supports testing policies prior to live enforcement using the dry-run mode specification (dryRunSpec). A policy defined under dryRunSpec evaluates incoming resource requests against configured list or boolean rules without rejecting non-compliant API calls. When a non-compliant action occurs, an organization policy audit log is emitted to Cloud Logging showing the potential violation. Setting the --update-mask=dryRunSpec flag ensures that only the dry-run configuration is updated on the target resource, preserving the active spec configuration.
dryRunSpec ensures that API calls violating the new service restrictions are permitted rather than blocked.dryRunSpec are captured directly in audit logs, allowing administrators to quantify impact.--update-mask=dryRunSpec instructs gcloud to update exclusively the dry-run specification without overwriting, modifying, or clearing the currently enforced live rules in the spec field.spec rules.spec (enforced live) and dryRunSpec (simulated) to coexist on the same resource.dryRunSpec rules unless explicitly overridden.This approach leverages the native Organization Policy Service v2 architecture. Alternative methods that place test rules in the live spec field risk service outages or disable enforcement entirely.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.