Cloudflare Firewall Configuration

The following documentation provides detailed instructions on how to configure a custom rule in the Cloudflare firewall to ensure the proper functioning of an API when the 'Under Attack' mode is active. This is particularly useful to allow the desired traffic to pass through without compromising the security of the site.

Steps

1) Login to clouflare

2) Choose the domain on which you want to perform this operation

3) Go to rules > Configuration Rules

4) Create new rule

5) We enter a name for the rule in this case 'API Rule' is recommended

6) Configuring the condition, In the 'If' section, add a condition that matches the API URL. Let us put, URL Path, then as operator we enter contains and then as value we enter '/api/v1'. Eventually we should have this:

7) Under "Then the settings are…", let's go for "Security level" and let us add. Under "select security level" let's set 'essentially off

8) Now we press on deploy and that's it.

Last updated