Cloudflare Docs
Firewall
Visit Firewall Rules on GitHub
Set theme to dark (⇧+D)

Use lists in expressions

Expression Builder

To use an IP List in the Expression Builder :

  1. Select is in list or is not in list from the Operator drop-down list.

    Selecting an IP List from the Value drop-down list when configuring the expression of a firewall rule

  2. Select an IP List from the Value drop-down list.

  3. When you are done composing your rule, click Deploy to commit your changes and enable your rule. Click Save as draft if you are not ready to enable the rule.

Expression Editor

To use an IP List in the Expression Editor specify the in operator and use $<list_name> to specify the name of the list.

This expression filters requests from IP addresses that are in an IP List named office_network:

(ip.src in $office_network)

Note that names for IP Lists can only include lowercase letters, numbers, and the underscore (_) character.

For more on creating lists, refer to Use IP Lists: Manage lists .

To create a new rule via API using the Cloudflare Open Proxies Managed List, use the following expression:

(ip.src in $cf.open_proxies)