Prepare and test your skills

Prepare and test your skills

Manage Policy Overrides and Exceptions is the practice of keeping a strict organization-wide rule while allowing a controlled difference at a lower level. The Organization Policy Service (opens in a new tab) gives centralized, programmatic control over Google Cloud resources through restrictions called constraints. An organization policy containing those constraints can be enforced at the organization, folder, or project level. This structure lets a global security requirement stay in place while a development or testing environment gets the flexibility it needs.
Centralized governance with organization policies means one administrator defines rules that apply to resources and to descendants of those resources in the Google Cloud resource hierarchy. Each organization policy is made of constraints, which are the individual restrictions that allow or deny specific operations or field values. When a user tries to create or update a resource that violates an enforced constraint, Google Cloud blocks the operation and the resource is not created or updated. This model keeps security, compliance, and governance consistent without configuring each project separately.
The service offers two kinds of constraints for different levels of control:
| Constraint type | Level of control | Choose when |
|---|---|---|
| Predefined constraints | Built-in restrictions for various Google Cloud services | A standard governance rule already covers the need |
| Custom constraints | Granular control over specific fields on create or update | A standard rule is not specific enough, such as requiring customer-managed encryption keys (CMEK) or restricting a field on a repository or instance |
Custom constraints extend governance when predefined constraints are too broad. For example, a custom constraint can restrict any field passed during creation of an Artifact Registry repository or a Memorystore for Valkey instance. That restriction enforces encryption or configuration standards at creation time.
Policy inheritance across the resource hierarchy means an organization policy enforced at a higher level automatically flows down to everything below it. By default, if a policy is enforced on an organization, Google Cloud enforces the policy on all folders and projects under it. If a policy is enforced on a folder, Google Cloud enforces the policy on all projects in that folder. Any new project added to that organization or folder inherits the same constraints without extra configuration.
A resource hierarchy from organization to folders to projects where production inherits a strict baseline policy and development uses a targeted override that applies only to its branch.
Exam tip: A policy set on a folder applies to every project in that folder by default; an exception requires a different policy set directly on the lower-level folder or project.
Creating overrides and exceptions at the folder or project level means applying a different organization policy at the child to change what the inherited parent policy would otherwise require. The parent organization keeps the strict global rule, while the child folder or project that hosts development or testing enforces a less strict or more specific policy. The lower-level policy applies to that folder or project and its own descendants, so the exception stays contained and does not weaken protection for the rest of the organization. Behavior for merging parent and child policies and for turning off inheritance is defined by hierarchy evaluation rules.
This pattern balances security with productivity in a clear order. First, the strict constraint is enforced at the organization level to establish the baseline. Then, an administrator sets a targeted policy on the development or testing folder or project where the exception is justified. Only that branch of the hierarchy operates under the exception, while production folders and projects continue to inherit the strict baseline.
Roles required to manage overrides center on the Organization policy administrator role (roles/orgpolicy.policyAdmin) on the organization resource. That role contains permissions to list constraints, get and set policies, and create, list, update, and delete policies. These permissions include orgpolicy.policies.create, orgpolicy.policies.update, orgpolicy.policy.get, and orgpolicy.policy.set. Testing an exception may require a service-specific admin role on the same resource, while the Organization Policy Service itself is offered at no charge.
Distinguish and Apply Constraint Types means knowing how the two main built-in restriction styles enforce different operational rules. The Organization Policy Service (opens in a new tab) attaches an organization policy made of constraints at the organization, folder, or project level. Boolean constraints turn a single restriction on or off, while list constraints control which specific values or services are allowed.
Boolean constraints are on-or-off rules that either enforce or lift a specific operational restriction for a hierarchy node. A boolean constraint has an enforced state of true or false, so there is no list of values to manage. When a boolean constraint is enforced as true on an organization or folder, the same restriction applies to every descendant project unless inheritance is changed. Choose a boolean constraint when the decision is binary, such as blocking a behavior everywhere under a folder.
List constraints are value-based rules that permit a request only when its value matches the allowed list and is not denied. A list constraint evaluates each request to create or use a resource against allowedValues and a denied list. Three common list constraints show how this enforces operational restrictions:
allowedValues, such as us-central1, us-east1, us-east4, us-west1, and other US regions.bigquerydatatransfer.googleapis.com, that require customer-managed encryption keys (CMEK) for at-rest data.When gcp.resourceLocations is set, no resources can be created in any other regions, multi-regions, or locations outside the selection. Making the list less restrictive can undermine data residency by allowing data to be created or stored outside a compliant boundary.
Exam tip: A list constraint like gcp.resourceLocations limits where or which services are allowed through allowedValues, while a boolean constraint only turns one restriction on or off.
Applying constraints across the hierarchy means the policy flows from a parent resource to its descendants. By default, organization policies are inherited, so a policy enforced on a folder is enforced by Google Cloud on all projects in that folder. The Organization Policy Service provides built-in managed constraints for many services, and administrators can also create custom constraints for granular control over specific resource fields, such as securesourcemanager.googleapis.com/Instance. Use a higher-level attachment for consistent governance, and use a lower-level attachment when a folder or project needs a stricter or more specific rule.
Analyze Policy Inheritance and Effective State means tracing how a parent decision determines the effective rules for child resources. Policy inheritance in Google Cloud carries controls from the organization node through folders to projects without redefining them at each level. The Organization Policy Service (opens in a new tab) provides that centralized, programmatic control, so understanding the flow shows why a parent decision controls what can happen below it.
What organization policies control is the set of allowed operations and field values for Google Cloud resources and their descendants. An organization policy is a set of restrictions called constraints, and the organization policy administrator defines the policy. Google Cloud blocks operations that violate an enforced constraint, and if a create or update request is noncompliant while a custom constraint is enforced, the operation fails. Organization Policy provides built-in managed constraints for many services, while custom constraints give more granular control over specific fields.
Where policies can be enforced is at any of the main levels of the hierarchy, with coverage flowing downward to everything below the attachment point. The policy applies to resources and descendants of the resource where it is attached. Setting a policy once at the organization or folder avoids setting the same rule project by project.
How inheritance flows to lower levels is from the organization node to each folder below it, then from each folder to each project inside that folder, then from each project to its resources. Policy inheritance means descendants automatically inherit the organization policies enforced on their ancestors by default. For example, if a policy is enforced on a folder, Google Cloud enforces the policy on all projects in the folder. Any project later added to that organization or folder inherits the same constraints, so the effective policy state for a project combines inherited parent policies plus any policy set directly on the project.
Policy Analyzer with Cloud Asset Inventory can show this effective coverage by revealing which resources are covered by what organization policies. The view connects the enforcement source at the top to the affected resource at the bottom. This connection makes it possible to confirm that inheritance is working as intended.
When enforcement takes effect is for new create and update operations after the policy is enforced, rather than rewriting existing configurations on its own. A new policy does not change an existing configuration until that configuration is changed through the console, command line, or API into a noncompliant state. Scheduled maintenance that does not change configuration does not by itself trigger enforcement, and some automatically created backups are not constrained by the policies themselves.
Exam tip: Inheritance is on by default — a policy on a folder covers all current and future projects in that folder, but it does not retroactively fix existing resources that were already created.
allowedValues that are not denied.gcp.resourceLocations, gcp.restrictServiceUsage, and gcp.restrictNonCmekServices are list constraints that limit resource locations, API service usage, and services requiring customer-managed encryption keys.Boolean constraints enforce a single on-or-off restriction with an enforced state of true or false, while list constraints permit a request only when its value matches the allowed list and is not denied. A list constraint like gcp.resourceLocations limits where resources can be created through allowedValues, while a boolean constraint only turns one restriction on or off.
By default an organization policy enforced at a higher level automatically flows down to everything below it, so a policy on an organization covers all folders and projects under it and a policy on a folder covers all projects in that folder. Any new project added to that organization or folder inherits the same constraints without extra configuration, and the effective state for a project combines inherited parent policies plus any policy set directly on the project.
Apply a different organization policy directly on the child folder or project to change what the inherited parent policy would otherwise require. The parent organization keeps the strict global rule while only that child branch and its own descendants operate under the exception, so production folders and projects continue to inherit the strict baseline.
The Organization policy administrator role (roles/orgpolicy.policyAdmin) on the organization resource contains permissions to list constraints, get and set policies, and create, list, update, and delete policies. These permissions include orgpolicy.policies.create, orgpolicy.policies.update, orgpolicy.policy.get, and orgpolicy.policy.set.
Your company is establishing security governance across all Google Cloud projects in the organization hierarchy. The security team has defined two mandatory policies:
europe-west1 and europe-west3).Which combination of organization policy constraint types should you use to implement these requirements?
Last updated