Web firewall
Turn on the 8G web firewall for a site, watch what it would block first, choose the rule groups, and add exceptions or extra patterns.
The web firewall checks every request to a site and refuses the ones that look like attacks, such as SQL injection, file-path tricks and scanners. It uses the 8G ruleset. Open the application, then select Web firewall in its sidebar, under Security. The screen says "Block common attacks, like SQL injection and bad bots, before they reach this site."
This is a firewall for one site's web requests. To open or close ports on the whole server, see the server's Firewall.
Turn the web firewall on
Start by watching. In watch mode nothing is blocked: the firewall only writes down what it would have blocked, so you can check that it does not catch your own visitors.
-
Open Web firewall. The card Web firewall (8G) shows the badge Off and "Requests reach the site without being checked." Under it, When to use this says "Blocks common attack patterns in web addresses, search terms, visitors and cookies before they reach the site."

-
Switch Use the web firewall on. The form shows Mode, Rule groups and Advanced: exceptions and extra patterns.

-
Choose the Mode:
- Just watch, don't block: "Nothing is blocked. Matches are logged so you can check them first." This is the choice when the firewall is first turned on.
- Actually block: "Matching requests are refused with an error page."
-
Under Rule groups, keep the groups you want. "Turn a group off only if it blocks something your site needs." The six groups are:
- Bad search terms: requests whose search terms carry SQL, script or
file-path tricks, the part of a web address after the
?. - Bad web addresses: requests for paths used to probe for installers, backups, config files and known exploits.
- Bad visitors: requests from scanners, scrapers and exploit tools that identify themselves in the User-Agent header.
- Bad links: requests arriving from links that carry injection payloads in the referring address.
- Bad cookies: requests whose cookies contain code or injection payloads rather than ordinary values.
- Bad request types: unusual HTTP methods such as TRACE and DEBUG that a normal visitor never sends.
At least one group stays on: "At least one rule group stays on."
- Bad search terms: requests whose search terms carry SQL, script or
file-path tricks, the part of a web address after the
-
Select Save firewall. You see "Saved." Discard puts the form back to what is saved.
The badge now says Watching only ("Checking requests, but not blocking any yet.") or Blocking attacks ("Requests that match the rule groups below are refused before they reach the site.").
Check what it caught, then start blocking
While the mode is Just watch, don't block, the card says how many requests were caught: "n requests caught while watching. Check them below before you switch to Block." or "Nothing caught yet while watching." Under the card, What it caught lists the requests that would have been blocked, newest first. "Requests that would have been blocked. Nothing was refused." Each row shows the request method, the address that was asked for, the visitor's IP address, the time and the user agent. The list reloads by itself every 30 seconds for 10 minutes while the page stays open.
- With nothing in the list you see "Nothing caught yet" and "The list fills in as visitors arrive."
- If the list cannot be read you see "This list couldn't be read" and "Your settings are unaffected."
When the list looks right, choose Actually block and select Save firewall. If a rule group blocks something your site needs, switch that group off, or add an exception.
Add exceptions and extra patterns
Open Advanced: exceptions and extra patterns. It opens by itself when the site already has some.
- Exceptions: "One per line. Requests whose address, search terms or visitor name
contain this text are never blocked." For example
my-plugin-name. An exception is part of a path, such as/wp-json/. It cannot contain..or?or a line break. - Extra blocked patterns: "One per line. Requests containing this text are
blocked." For example
xmlrpc.php. A pattern must be one line, with no control characters.
Each box counts its lines as n/50. Past 50 you see "At most 50 lines." Select Save firewall.
An exception skips the checks for every address that contains the text. Keep each one as specific as you can, such as a plugin's folder.
Servers that can't run it
The 8G firewall is written into the site's web server configuration. A server that runs OpenLiteSpeed cannot run it yet. On such a server the status is Not available and the card says "This server's web server (OpenLiteSpeed) can't run the 8G firewall yet."
Limits
- Up to 50 Exceptions and up to 50 Extra blocked patterns, one per line, each 1 to 255 characters.
- At least one rule group stays on.
- What it caught shows the newest 200 lines of the firewall's log.
- The firewall is not available on OpenLiteSpeed.
Who can do this
- Seeing the screen needs View on Web Firewall (
application.firewall). Turning it on or off and every change need Manage. With view only the screen says "You can view these settings. Ask an owner for manage access to change them." - What it caught lists IP addresses from the access log, so it needs access to the site's Logs. Without it the list is not shown.
- Web Firewall can be given in a server share. It has its own permission, separate from Password Protection.
- A change is recorded in the server's activity log with whether the firewall is on and its mode. See Application activity.
Common errors
- This section could not be loaded. The server's panel did not answer. Reload the page.
- At most 50 lines. Remove lines from Exceptions or Extra blocked patterns.
- An exception is part of a path, such as /wp-json/. It cannot contain “..”, “?” or a line break. Fix the line named under the box.
- A custom rule must be one line, with no control characters. Fix the pattern.