Where a WordPress firewall can run

A web application firewall reads each request to a site and refuses the ones that match an attack. For WordPress it can run in two places:

  • In front of the server, in the cloud: traffic passes through the provider’s network first. It stops floods before they cost the server anything, but knows little about the site behind it.
  • On the site, before WordPress: in the same PHP process, often through auto_prepend_file in php.ini or .user.ini, or a must-use plugin. It sees each request as WordPress will, and can know which plugins the site runs.

Keptstone’s firewall is the second kind. When protection is on, the connector writes a small must-use loader, wp-content/mu-plugins/keptstone-firewall.php. WordPress loads must-use plugins before every other plugin, so the firewall sees a request before a vulnerable plugin can. The loader finds the connector by its folder name, with no absolute paths, so it keeps working when a site moves hosts, and it does nothing once the connector is deactivated.

What it checks, in two stages

Stage Rules Applies to
Before plugins load The agency’s blocked addresses; attack tools by user agent (sqlmap, nikto, wpscan, nuclei and others); requests for files WordPress never serves (.env, .git/, phpmyadmin, wp-config.php backups, .sql dumps, web shells); path tricks (../../, /etc/passwd) and remote file tricks (php://, data://, phar://) in the address Everyone except allowed addresses
Once WordPress knows the user Path and remote file tricks in posted data; SQL injection; script injection in the query, form fields and JSON bodies; PHP files uploaded by people who may not upload code, and PHP hidden inside an uploaded “image”; serialized PHP objects; dangerous functions where a callback name is expected; a visitor asking for an administrator, editor or shop manager role Visitors, subscribers and customers. Editors and up are trusted, since they post HTML and code legitimately

Values are decoded once more to catch double encoding, and nested fields are followed six levels deep. A blocked request gets a plain 403 page saying the site’s firewall blocked it. Anything going wrong inside the firewall lets the request through.

Bad crawlers

Crawlers that take and give nothing back (Bytespider, Sogou, PetalBot, MJ12bot, DotBot, BLEXBot and a few others) get a 403 before WordPress does any work. Search engines, AI search and SEO tools such as Semrush and Ahrefs are not on the list.

Learning first

A firewall that blocks a client’s real customers on day one gets switched off by day two. So every new site learns for 14 days: each match is logged, and nothing is blocked except addresses already on your agency’s blocklist and the patches for known holes. When the 14 days end, the site starts blocking by itself.

On the site’s Protection card:

  • Start blocking now ends learning early;
  • Back to learning returns to logging only;
  • Allow on a false alarm stops that rule checking that field on that page, on that site only;
  • single rules can be set to log only.

Proof it is working

Keptstone sends each site a harmless test attack, /?keptstone_fw_test=../../../../etc/passwd, from the site itself. In blocking mode a 403 shows as Verified. Anything else shows Not in effect, for example when a page cache answers before WordPress loads. While learning, it shows Off with the date blocking starts.

One attacker, every site protected

Attackers rarely hit one site. Keptstone looks at the firewall events from all your sites together, at most once a minute, and blocks an address on every site for a day when, in the last 24 hours, it:

  • hit two or more of your sites with a strong rule (attack tools, file probes, path tricks, SQL injection, uploads, object injection, patched holes);
  • made 10 or more strong hits on one site; or
  • showed up on three or more sites with any rule.

An address that comes back after its block ended is blocked for a week. Never blocked: private addresses, Keptstone’s own server, the servers your sites run on, and the addresses you allow. Owners and admins can also Block everywhere by hand and unblock.

Changes reach sites at once; sites behind a host firewall get them at their next check-in, and every heartbeat compares the site’s settings with the current ones, so a missed push heals within 15 minutes.

Patches for the holes on your sites

When a plugin on one of your sites has a known hole, the fix is the update. Until it arrives, the firewall can carry a virtual patch: a rule that refuses the specific requests the hole is reached through (virtual patching).

  • Keptstone writes these by hand for holes found on the sites it looks after: a handful of tested rules, not a large vulnerability database.
  • A site gets a patch only while it runs the vulnerable version, and loses it when the plugin is updated.
  • Patches block in every mode, learning included.

When a plugin has a High or Critical hole that nothing covers (no fixing update, no fixing zip in your Library, no patch), the firewall locks that plugin’s entry points for visitors who are not signed in: its logged-out AJAX actions and its REST routes. Signed-in people pass, and while the site is still learning the lock only logs. The lock lifts by itself once the plugin is updated, removed or patched. How holes are found and matched: vulnerability alerts.

What the agency and the client see

You see each event: the rule, the address, the method, the page, the field and what matched. What matched is never kept for fields named like a password, card number, CVV or token. The Security page shows every site’s status and the blocklist.

Your client sees, in the monthly report’s security section, the attacks blocked and from how many addresses (branded client reports). Inside their WordPress, the Site care page shows whether the firewall is blocking or learning, the attacks it stopped this month by kind, and the patches in force by title, never an address.

Limits

  • It is not a cloud firewall. Requests still reach the server, so a large flood still costs it. Pair it with the host’s protection or a CDN for that.
  • Cached pages skip it. A page served by a page cache before WordPress loads never reaches the firewall. That is usually fine, since those pages do not run plugin code.
  • Logged-in editors are trusted by the script and code rules.
  • A handful of patches, written for holes on the sites Keptstone looks after. Updating remains the fix.
  • It fails open. A fault in the firewall lets requests through rather than taking the site down.

Which plan it is in

The firewall, virtual patches, plugin lockdown and bad-crawler blocking are in Care + Protect + Speed at $4 a site a month, with malware scanning and repair tools and the file watch. The Care plan at $2 keeps hardening, two-step login, the code lock and the administrator guard. See pricing and the WordPress security overview.

Questions

Does a WordPress site need a firewall if the host has one?

A host's firewall protects the server from broad attacks, and many hosts do that well. A firewall on the site sees each request as WordPress does, knows which plugins the site runs, and can carry patches for that site's holes, so the two cover different things.

Will the firewall block the client's editors?

Editors and administrators are trusted by the rules that look for injected script and code, because they post HTML legitimately. During the first 14 days nothing but known attackers and patched holes is blocked, and a false alarm gets an Allow button that ends it for that field and page.

Does a WordPress firewall slow the site down?

Keptstone's settings are checked and indexed once, when they arrive, and a request with no query string, form or upload skips the second stage of checks. Pages a cache serves before WordPress loads never reach it at all.

Can I use it with Cloudflare?

Yes. Behind Cloudflare the firewall reads the visitor's real address from Cloudflare's header, and only when the request really comes from Cloudflare's published ranges, so lockouts and blocks hit the attacker, not Cloudflare.

What happens if the firewall itself fails?

It lets the request through. Anything going wrong inside the firewall is caught, so it can never take the site down.