Prepare and test your skills
Prepare and test your skills
Centralized governance and hierarchical policy enforcement is the practice of setting security baselines once at the top of the resource hierarchy and having them apply to everything below. In Google Cloud, Organization Policy (opens in a new tab) governs how resources can be configured, while Hierarchical Firewall Policy (opens in a new tab) governs what network traffic is allowed. Together they keep folders and projects consistent without requiring each team to recreate the same rules.
Organization Policy is a centralized control that limits what users can do with resources across an organization, its folders, and its projects. A constraint set at the organization level becomes the baseline for all child folders and projects, so a risky configuration blocked at the top cannot be created below. This lets central teams govern resource usage while project teams still work independently.
Central baselines commonly restrict identity, data location, and cluster configuration. Examples supported in the controls include:
constraints/iam.disableServiceAccountKeyCreation and constraints/iam.disableServiceAccountKeyUpload to disable creation and upload of user-managed service account keys (opens in a new tab)When key creation is disabled by policy, requests to create or upload a service account key are denied before the key material exists. That removes persistent key files that could be copied from gcloud CLI configuration, local file systems, or code repositories. Teams must then use more secure alternatives for authentication, which supports least privilege because workloads receive only the short-lived credentials they need.
Hierarchical Firewall Policy is a centralized network control that enforces allowed and denied traffic rules across the hierarchy. Firewalls provide the first line of defense by controlling inbound and outbound traffic based on configurable security policies, with intrusion detection and prevention inspecting traffic for unauthorized entry. Traffic flows from the customer private network through the firewall and intrusion detection system before it reaches resources inside the perimeter.
The baseline starts with default deny to prevent unintentional access and data leakage, then adds explicit allowances as needed. Central firewall baselines include:
Because the policy sits above individual VPC firewall rules, a project cannot open a port that the higher-level baseline blocks. If a special case must bypass normal inspection, such as a plaintext port or excluded IP range, that traffic must be natively encrypted and authenticated and limited by Kubernetes network policies to prevent eavesdropping or modification.
Policy inheritance means a control attached at the organization level flows down to every folder and project beneath it. Security Command Center (opens in a new tab) and Security Health Analytics monitor that inheritance to keep the security posture consistent over time. When a lower-level change weakens or removes the baseline, it is reported as drift rather than silently accepted.
The following table compares what each control governs and how consistency is checked.
| Control | What it governs | How consistency is checked |
|---|---|---|
| Organization Policy | Resource configuration, such as keys, locations, and cluster settings | Findings for Org Policy Canned Constraint Deleted, Org Policy Canned Constraint Drifted, custom constraint deleted or drifted, location restriction, and Confidential VM policy |
| Hierarchical Firewall Policy | Network reachability, such as allowed ports and address ranges | Findings for open SSH, RDP, database, and other sensitive ports and overly permissive rules |
The audit trail preserves who changed what and when. Critical audit log events (opens in a new tab) include user authentication and authorization requests, generation and revocation of authentication tokens, all administrative access and changes, all control plane API actions, and all security events including intrusion detection, intrusion prevention, firewall, and anti-virus events. All access is audit logged with role-based and attribute-based authorization, so administrators can trace unauthorized access from the identity through the policy decision to the affected resource.
Exam tip: Organization Policy controls what resources can be configured, while Hierarchical Firewall Policy controls what traffic can reach them — a drifted organization constraint and an open firewall port are different findings that require different fixes.
Network perimeter security with VPC Service Controls (opens in a new tab) creates a data transfer boundary around Google Cloud APIs to prevent exfiltration. A service perimeter is a logical boundary managed at the organization level and enforced at the project level. Traffic from outside the perimeter, including the console, developer workstations, and deployment pipelines, is denied access to restricted services inside unless an explicit exception allows it. This protection is independent of Identity and Access Management (IAM) and does not replace IAM least-privilege controls.
VPC Service Controls isolates sensitive API-based services such as BigQuery, Cloud Storage, and Cloud Run by placing their projects inside a perimeter and restricting which services are protected. Resources and services inside the same perimeter can communicate freely when IAM and network permissions allow it, while API calls that cross the boundary are checked and blocked by default. The perimeter is intended to control exfiltration between an organization and external sources, not to replace granular IAM allow policies for individual projects or resources. Because careless enablement can break applications, perimeters should be planned during architecture design and tested before enforcement.
A common unified perimeter is a single large perimeter that contains all sensitive projects and provides the strongest protection against data exfiltration with the lowest management overhead. With one perimeter, management focuses mainly on north-south access from the internet and outside identities into the perimeter, since east-west traffic inside the perimeter is already allowed. Multiple smaller perimeters require managing both north-south access and east-west traffic between perimeters, which can create considerable overhead as the number of perimeters grows.
The choice depends on protection needs and management cost:
| Design | Protection and overhead | Choose when |
|---|---|---|
| Common unified perimeter | Strongest exfiltration protection, lower overhead focused on outside-to-inside access | Default choice for most organizations to keep design simple |
| Multiple perimeters | More granular isolation, higher overhead to manage traffic between perimeters | Data must be separated by trust, regulation, or tenancy |
Multiple perimeters are appropriate when data sharing or compliance requires separation. An organization might use one perimeter for high-trust healthcare data and a separate perimeter for de-identified data shared with partners. Regulated data subject to standards such as PCI DSS, or independent third-party tenants hosted in the same organization where tenant-to-tenant movement counts as exfiltration, also justify separate perimeters.
Perimeter design starts by qualifying which projects belong inside and enabling all supported protected services. Leaving an API unprotected creates an additional exfiltration vector, so any decision to protect one API and not another should be reviewed and justified. All new projects should go through a review that asks whether the workload has a hard dependency on a service that VPC Service Controls does not support, and whether the project holds no sensitive data and consumes no sensitive data from other projects. If the answer to either question is yes, the project should stay outside the perimeter or isolate the unsupported requirement into a separate project.
Network configuration must not provide a bypass around the perimeter. There must be no network route from VPC networks in the perimeter to the private VIP at private.googleapis.com, because that path negates protection from insider exfiltration. Instead, VPC networks should use Private Google Access with traffic directed to the restricted VIP range 199.36.153.4/30 (restricted.googleapis.com), combined with firewall rules that deny general egress and allow only TCP port 443 to that range. For workloads such as Cloud Run (opens in a new tab), organization policies should further require internal or internal-and-cloud-load-balancing ingress and all-traffic VPC egress so traffic stays subject to VPC controls.
Ingress and egress rules are the controlled exceptions that allow authorized data movement across a perimeter boundary without opening the perimeter. An ingress policy specifies which identities and sources outside the perimeter can access specific protected resources and API methods inside, while an egress policy specifies which protected identities and resources inside can access specific services and resources outside. Access levels based on conditions such as IP ranges or managed devices apply only to requests coming from outside toward protected resources, so an egress rule is still required to let data flow outward.
Valid access patterns should be documented before rules are written:
A BigQuery example shows how the rules pair together. To let a BigQuery project query an external table in a Cloud Storage project in another perimeter, the Cloud Storage perimeter adds an egress rule that allows operations on storage.googleapis.com to the BigQuery project, and the BigQuery perimeter adds a matching egress and ingress allowance for the Cloud Storage project. Dry-run mode (opens in a new tab) should be used to log violations from these flows without blocking before the rules are enforced.
Communication between protected resources in different perimeters is enabled by coordinated ingress and egress rules, sometimes described as a service bridge. The bridge depends on both sides: the source perimeter must allow the egress to the destination identity and service, and the destination perimeter must allow the corresponding ingress from the source. This two-sided dependency ensures that data flows from the source project to the destination service only when both perimeters explicitly permit that direction, method, and resource.
Bridge designs should be kept as simple as possible to avoid creating new exfiltration paths. Complex designs with multiple bridges, perimeter network projects, DMZ perimeters, and complex access levels increase the chance of misconfiguration and management burden. When multiple perimeters are required, the threats addressed by the separation and the exact access paths needed for intended operations should be clearly defined. Layered controls such as blocking direct internet egress, enforcing least privilege, and restricting VPC accessible services provide additional defense inside each perimeter (opens in a new tab).
Exam tip: Access levels control only outside-to-inside access to protected resources; they cannot authorize a protected resource to send data outside, which requires an egress rule.
Context-aware access and comprehensive audit logging combine zero-trust access enforcement with continuous visibility into who did what. Access decisions evaluate identity plus request context on every API request, while audit logs record administrative actions and access patterns for investigation and compliance. Together, user-centric controls, resource perimeters, and monitoring reduce the impact of compromised credentials.
Chrome Enterprise Premium (opens in a new tab) access levels enforce granular, user-centric conditions that are checked on every API request. An administrator configures an access level and binding to selectively allow attributes such as IP-based access or certificate-based access for mutual TLS (mTLS). A request that uses compromised authorization credentials but does not meet the defined policy conditions is rejected.
Device context comes in part from Endpoint Verification, but not all device attributes collected by Endpoint Verification are evaluated during every API request. This means an access level must rely on the attributes that are actually evaluated at request time, such as network source or mTLS certificate presence. The result is zero-trust enforcement where identity alone is not enough.
Chrome Enterprise Premium is a user-centric control that rejects user API traffic that does not meet defined conditions. VPC Service Controls is a resource-centric control that defines the perimeters within which resources can communicate. When used together, Chrome Enterprise Premium and VPC Service Controls reduce the effectiveness of compromised credentials on an attacker-controlled machine that is outside the environment.
The two controls differ in scope and coverage:
| Control | Focus | Identities covered |
|---|---|---|
| Chrome Enterprise Premium | Rejects user API traffic that fails access-level conditions | Only user identities within the organization |
| VPC Service Controls | Defines perimeters where resources can communicate | All user identities and service account identities |
Exam tip: Chrome Enterprise Premium applies only to user identities in your organization, while VPC Service Controls applies to all user and service account identities.
Identity-Aware Proxy (IAP) (opens in a new tab) integration with Cloud Service Mesh (opens in a new tab) defends mesh services against token replay attacks by exchanging long-lived external tokens for short-lived internal tokens. A request from outside the mesh must include a token, such as a JWT or a cookie, to be authenticated and authorized by the mesh service. At the ingress of the mesh, IAP exchanges that external token for a RequestContextToken, which is a short-lived, mesh-internal token with limited scope that Cloud Service Mesh uses for authorization.
The exchange follows an ordered flow from the outside caller to the mesh service:
RequestContextToken with limited scope.Because the internal token has limited scope and lifetime, an attacker cannot reuse a token stolen inside the mesh to access other services. IAP token exchange is different from Cloud Service Mesh user authentication, where IAP exchanges external tokens for short-lived internal tokens to defend against replay, whereas user authentication uses web browser-based external calls to web application services.
Cloud Audit Logs (opens in a new tab) provide the central audit trail that administrators monitor alongside mesh and policy signals to verify that security configuration is working as expected. Administrators use these observability resources to verify enforcement and to monitor any exceptions to security policy enforcement, including ports or addresses intentionally excluded from sidecar handling. Continuous monitoring supports detection of compromised credentials, misconfiguration, and policy drift.
Mesh administrators are expected to monitor a combined set of audit and observability sources:
Organization Policy governs resource configuration such as service account keys, locations, and cluster settings, while Hierarchical Firewall Policy governs network reachability such as allowed ports and address ranges. Both are set at the top of the resource hierarchy and inherit down to folders and projects, so a project cannot create a configuration blocked by Organization Policy or open traffic blocked by the higher-level firewall baseline.
A common unified perimeter containing all sensitive projects is the default choice because it provides the strongest protection against data exfiltration with lower management overhead focused on outside-to-inside access. Multiple smaller perimeters should be used when data must be separated by trust, regulation, or tenancy, such as high-trust healthcare data versus de-identified shared data, regulated data subject to PCI DSS, or independent third-party tenants. Multiple perimeters provide more granular isolation but require managing both outside-to-inside and between-perimeter traffic.
Chrome Enterprise Premium enforces user-centric access levels that are checked on every API request and applies only to user identities within the organization, while VPC Service Controls enforces resource-centric perimeters that define where resources can communicate and applies to all user and service account identities. When used together they reduce the effectiveness of compromised credentials on an attacker-controlled machine outside the environment.
Identity-Aware Proxy at the mesh ingress exchanges a long-lived external JWT or cookie from a caller outside the mesh for a short-lived RequestContextToken with limited scope that Cloud Service Mesh uses for authorization. Because the internal token has limited scope and lifetime, an attacker cannot reuse a token stolen inside the mesh to access other services.
An enterprise organizes its Google Cloud resource hierarchy into distinct folders for network infrastructure and business workloads. The Shared VPC host project resides in the Core-Networking folder, while multiple service projects containing Compute Engine virtual machines (VMs) reside in the App-Workloads folder.
The central security team applies a hierarchical firewall policy to the Core-Networking folder that denies ingress TCP traffic on port 22. To allow remote access, a development team attaches another hierarchical firewall policy directly to the App-Workloads folder with a high-priority rule allowing ingress TCP traffic on port 22. However, SSH traffic to the VMs connected to the Shared VPC subnets remains blocked.
Why is the ingress traffic on TCP port 22 still blocked on these VM instances?
The hierarchical firewall policy applied to the App-Workloads folder requires an Organization Policy override to take effect on Compute Engine instances.
Hierarchical firewall policies assigned at a parent folder level permanently override all rules defined on any child folders regardless of priority.
In a Shared VPC deployment, VM network interfaces are governed by the hierarchical firewall policies of the host project hierarchy rather than the service project hierarchy.
Service project VM instances only evaluate local VPC firewall rules and ignore all organization or folder-level hierarchical firewall policies.
Last updated