When you create a hierarchical, global, or regional network firewall policy,
Cloud Next Generation Firewall (Cloud NGFW) automatically adds predefined rules. You can
customize or override these rules to maintain your intended network
security posture. Predefined rules vary depending on whether you use the
Google Cloud console, gcloud CLI, or API.

This document helps network administrators and security engineers define rules
for firewall policies.

## Types of predefined rules

If you create a firewall policy using the Google Cloud console,
Cloud NGFW adds the following rules to the new policy:

1. [Goto-next rules for private IPv4 ranges](https://docs.cloud.google.com/firewall/docs/pre-defined-rules.md.txt#goto-next-pvt-ip)
2. [Predefined Google Threat Intelligence deny rules](https://docs.cloud.google.com/firewall/docs/pre-defined-rules.md.txt#deny-nti)
3. [Predefined geolocation deny rules](https://docs.cloud.google.com/firewall/docs/pre-defined-rules.md.txt#deny-geo)
4. [Lowest possible priority goto-next rules](https://docs.cloud.google.com/firewall/docs/pre-defined-rules.md.txt#goto-next-all-ips)

If you create a firewall policy using the Google Cloud CLI or the API, Cloud NGFW
adds only the [lowest possible priority goto-next rules](https://docs.cloud.google.com/firewall/docs/pre-defined-rules.md.txt#goto-next-all-ips)
to the policy.

> [!NOTE]
> **Note:** These predefined rules in firewall policies are different from the [implied and prepopulated VPC firewall rules](https://docs.cloud.google.com/firewall/docs/firewalls.md.txt#default_firewall_rules).

All predefined rules in a new firewall policy purposefully
use low priorities (large priority numbers) so you can override
them by creating [ingress](https://docs.cloud.google.com/firewall/docs/using-firewall-policies.md.txt#create-ingress-rule-target-vm) or [egress](https://docs.cloud.google.com/firewall/docs/using-firewall-policies.md.txt#create-egress-rule-target-vm) rules
with higher priorities. Except for the [lowest possible priority goto-next rules](https://docs.cloud.google.com/firewall/docs/pre-defined-rules.md.txt#goto-next-all-ips),
you can also [customize](https://docs.cloud.google.com/firewall/docs/using-firewall-policies.md.txt#update-rule)
the predefined rules.

### Goto-next rules for private IPv4 ranges

- An egress rule with destination IPv4 ranges `10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16`,
  priority `1000`, and `goto_next` action.

- An ingress rule with source IPv4 ranges `10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16`,
  priority `1001`, and `goto_next` action.

### Predefined Google Threat Intelligence deny rules

- An ingress rule with source Google Threat Intelligence list `iplist-tor-exit-nodes`,
  priority `1002`, and `deny` action.

- An ingress rule with source Google Threat Intelligence list `iplist-known-malicious-ips`,
  priority `1003`, and `deny` action.

- An egress rule with destination Google Threat Intelligence list `iplist-known-malicious-ips`,
  priority `1004`, and `deny` action.

To learn more about Google Threat Intelligence, see [Google Threat Intelligence for firewall policy rules](https://docs.cloud.google.com/firewall/docs/threat-intelligence-overview.md.txt).

### Predefined geolocation deny rules

- An ingress rule with source matching geolocations `CU`,`IR`, `KP`, `SY`, `XC`, and `XD`, priority `1005`, and `deny` action.

To learn more about geolocations, see [Geolocation objects](https://docs.cloud.google.com/firewall/docs/geolocation-objects-overview.md.txt).

### Lowest possible priority goto-next rules

You cannot modify or delete the following rules:

- An egress rule with destination IPv6 range `::/0`, priority `2147483644`, and `goto_next`
  action.

- An ingress rule with source IPv6 range `::/0`, priority `2147483645`, and `goto_next`
  action.

- An egress rule with destination IPv4 range `0.0.0.0/0`, priority `2147483646`, and `goto_next`
  action.

- An ingress rule with source IPv4 range `0.0.0.0/0`, priority `2147483647`, and `goto_next`
  action.

## What's next

- Modify predefined rules. For more information, see how to [update a global network firewall policy rule](https://docs.cloud.google.com/firewall/docs/manage-global-firewall-policies.md.txt#update-rule), [update a regional network firewall policy rule](https://docs.cloud.google.com/firewall/docs/manage-regional-firewall-policies.md.txt#update-rule), and [update a hierarchical firewall policy rule](https://docs.cloud.google.com/firewall/docs/manage-hierarchical-firewall-policies.md.txt#update-rule).
- Add your own rules. For more information, see the [Create a global network firewall policy](https://docs.cloud.google.com/firewall/docs/use-network-firewall-policies.md.txt#create-network-firewall-policy), [Create a regional network firewall policy](https://docs.cloud.google.com/firewall/docs/use-regional-firewall-policies.md.txt#create-network-firewall-policy), and [Create a firewall policy](https://docs.cloud.google.com/firewall/docs/using-firewall-policies.md.txt#create-policy) sections.