Cloudflare Docs
Waf
Visit WAF on GitHub
Set theme to dark (⇧+D)

Custom Firewall rules

Custom Firewall rules allow you to control incoming traffic by filtering requests. You can perform actions like Block or JS Challenge on incoming requests according to rules you define.

Like other rules evaluated by Cloudflare’s Ruleset Engine , Custom Firewall rules have an expression and an action:

  • The expression specifies the criteria you are matching traffic on using the Rules language .
  • The action specifies what to perform when there is a match for the rule.

Getting started

To create Custom Firewall rules using the Cloudflare dashboard, refer to Create Custom Firewall rules in the dashboard .

You can also create Custom Firewall rules using the Rulesets API . Refer to Create Custom Firewall rules via API for more information.