Application firewall
Every application has its own firewall in front of it. It checks each request before the application sees it: requests that look like attacks are blocked or written to a log, and one visitor can’t send requests faster than the rate limits allow. It works for every application type and is on from the start.
Open the application and go to Security › Password & access. The Firewall card has two settings and the list of rules.
Choose how the request filter works
Section titled “Choose how the request filter works”Under Request filter, pick one:
- Block attacks (the default): requests that are clearly attacks are blocked, for example attempts to read your database through the address, requests for
.envfiles and scans from known attack tools. Requests caught by the broader rules are only written to the firewall log. - Strict: every rule blocks. More protection, but the broader rules can catch normal requests. Watch the firewall log for a few days after switching.
- Log only: nothing is blocked; every match is written to the firewall log. Use it to see what the rules would catch.
- Off: no requests are checked.
Click Save. The change is checked and applied within a few seconds.
Why the default doesn’t block everything
Section titled “Why the default doesn’t block everything”The broader rules look for patterns that attacks often use, but some applications use them too: a search for a name with an apostrophe, a page builder that sends HTML in the address, a single sign-on or payment callback with a very long code, or a webhook that sends no browser name. Blocking those by default would break real sites, so the default blocks only requests that no normal application sends and logs the rest.
Choose the rate limits
Section titled “Choose the rate limits”Under Rate limits, pick one:
- Standard (the default): generous limits for pages, and stricter ones for login forms, so password guessing slows down.
- Strict: about half the standard rates, with tight login limits. Good for an application that is often attacked.
- Off: no limits, logins included.
A visitor who goes over the limit gets a “429 Too Many Requests” answer for a moment. Visitors behind Cloudflare are counted by their own address.
See what the firewall caught
Section titled “See what the firewall caught”The card shows how many requests were blocked and logged in the last 24 hours and which rules matched most. Click Open the firewall log to see each request. The log is also under Logs, as Firewall.
When a normal request is blocked
Section titled “When a normal request is blocked”A blocked visitor sees a page that says the request was blocked and shows a reference, the name of the rule, for example sqli-union. The same name is in the firewall log.
- Open Rules on the Firewall card.
- Find the rule with that name and click its switch to turn it off.
- Click Save.
The rule is off for this application only. Each rule shows whether it Blocks, Logs or is Off with the mode you chose.
Good to know
Section titled “Good to know”- The server’s own health checks are never blocked, and requests the server makes to itself never count toward the rate limits.
- A password-protected application is checked too: the firewall runs before the password prompt.
- When you clone an application or move it to another server, its firewall settings go with it.
- Changing the mode never touches your application’s files or database.