We already explained the five types of built-in rule sets in [App WAF Rule] (app-waf-rule.md).
But what if you want to add a custom WAF rule?
First, click the
Then, click the
Global WAF on the left-side navigation bar to enter
the WAF Rule Set page.
This page already contains the five built-in rule sets. These read-only rule sets can neither be modified nor be deleted.
Click first the
New Rule Set button to create your own WAF rule.
The WAF rules need to be written by yourself with EdgeLang statements.
So you need to get familiar with EdgeLang grammar and how to use waf-config in advance.
In the simple example below, requests where uri is prefixed with
/static/ will be intercepted by the WAF rule,
reject action, 403 is returned to the client-side.
In fact, EdgeLang statements can help realize more sophisticated WAF rules.
Submit button at the bottom right-hand corner, and the
system will test and compile EdgeLang statements. There will be prompts
if something is wrong,
If not, they will be directly saved.
Now, a global WAF rule is successfully set.
If you proceed to create another or revise a [App WAF Rule] (app-waf-rule.md),
you will see the newly added WAF rule that is already in the WAF Rule Set dropdown list.