In the Rules subpage you can create and modify the firewall rules and attach them to certain sites.
A firewall rule can block or whitelist requests based on patterns. They can be assigned to sites directly or attached to a module.
To create a custom rule, click on the + Create Rule button.
A new page opens up with a firewall rule creation form (see the image below).
Adding a simple rule:
- Give your rule a name
- To the next field (If the IP address matches...) you can type an IP address, CIDR notation, or wildcards. For example:
- Next field is another condition - if the requesting URL contains - there you can type any URL pattern (e.g. contact-form/submit)
- In the last field you can choose, what action to take if your site visitor matches all the rules you just set. Your options are to
- When you choose "Redirect", a new field opens up, where you can type, which URL the visitor will be redirected to
- Having filled the fields, click Create Rule
Finally, you should see your created rule on the Rules page.
If you want this rule to take effect, you need to attach it to your sites. To do that:
- Click on "Action" and "Attach Sites"
- A popup appears with the list of all your sites
- Toggle the button to attach your rule. You can attach as many sites as you wish
- Close the popup
Now you need to sync your sites. To do that:
- Click on "Resync Sites" at the top right corner
- From the popup you can click "Resync All" so all your sites will be updated
You have now successfully created a firewall rule and attached it to your site!
In the next article let's take a look at Firewall Modules. A firewall module is a group of custom firewall rules, which can be applied to your sites.
Updated about 2 months ago