Hierarchical Firewall Policies and goto_next in Cloud NGFW

GCP Study Hub
November 14, 2026

A Cloud NGFW hierarchical firewall policy is a set of firewall rules associated with the organization or with a folder, and every project under that node inherits it automatically, including projects created later. Hierarchical policy rules are evaluated before VPC firewall rules and network firewall policies, regardless of the priority numbers any of those rules use, so project owners cannot override them with their own rules or policies. That makes hierarchical policies the scalable, low-cost way to apply organization-wide or folder-wide controls. For the Professional Cloud Network Engineer exam, the details to know are the three rule actions, especially goto_next, and the priority order inside a policy.

Inheritance and evaluation order

When a hierarchical firewall policy is associated with the organization node or a folder, it applies to every project below that point. New projects pick it up without any extra setup. Because hierarchical rules are checked first, the rules that project teams write in their own VPC firewall rules or network firewall policies only come into play for traffic that the hierarchical policy has not already decided.

Allow, deny and goto_next

Each hierarchical rule's action determines what happens next to matching traffic:

  • Allow or deny. When a hierarchical rule with an allow or deny action matches, that decision is final. The traffic never reaches lower-level rules, so nothing in a project can change the result.
  • goto_next. The traffic is handed down to the next level for evaluation without a verdict. Rules at the lower level, including the implied deny ingress rule in the VPC network, then decide what happens.

An allow and a goto_next differ in what they guarantee. An allow guarantees the traffic is permitted everywhere below the policy. A goto_next only declines to block it, which leaves a project team free to deny it, or simply leaves the implied deny to drop it if no lower rule allows it.

Priority order inside a policy

Rules within a hierarchical policy are evaluated in priority order, lowest number first, and the first rule that matches applies its action. Because allow and deny are final, the order of a narrow rule and a broad rule decides the outcome. A broad deny with a smaller priority number than a narrower exception matches first and takes the exception's traffic with it, so the exception never applies. The narrower rule needs the smaller number.

Combining an exception with a broad deny

A common design blocks a port for most sources at the organization or folder level while treating one trusted source range differently. The action on the exception decides how much control the lower levels keep:

  • An allow for the trusted range, evaluated before the broad deny, permits that range in every network below the policy. No project can block it, and no project can open the port to anyone else.
  • A goto_next for the trusted range, evaluated before the broad deny, hands that range down to each network without a verdict. Networks that should accept it add their own allow rules, and every other network, including networks created later, drops it through the implied deny ingress rule. All other sources still match the hierarchical deny, which no network-level rule can override.

Either way, the broad deny ends evaluation for everything it matches, so a design that needs per-network decisions for some traffic has to let that traffic leave the hierarchy through goto_next first.

Folder-level policies

Hierarchical policies also work when different parts of the organization need opposite rules. Associating one policy with one folder and a different policy with another folder, such as one that allows a port and one that denies it, covers every project in each folder, including future ones, with one policy per folder to manage.

That inheritance is the advantage over rules created inside each project. However they are managed, project-level rules remain rules that project owners can outrank, and they add upkeep in every project.

Where hierarchical policies do not apply

Hierarchical firewall policies are enforced on VM network interfaces. They cannot filter traffic sent to a load balancer's external IP address, because that traffic terminates at Google's edge proxies. With a global external Application Load Balancer, traffic arriving at the backends comes from Google's proxy ranges rather than from the original clients. Filtering at that edge is the job of Google Cloud Armor, which enforces its policies on Google's edge proxies before requests are forwarded to the backends.

When we read a Professional Cloud Network Engineer scenario about organization-wide firewall control, we would decide first whether each source should get a final verdict at the hierarchy or be handed down with goto_next, and then set the priorities so the narrower rule is evaluated before the broad one.

Our Professional Cloud Network Engineer practice exams cover hierarchical firewall policies and goto_next alongside VPC firewall rules and Google Cloud Armor, with detailed explanations that drill these distinctions.

Get tips and updates from GCP Study Hub

arrow