What hardening means for a client site

A fresh WordPress install is built to be easy, not locked down. The theme and plugin file editor lets any administrator write PHP. xmlrpc.php accepts hundreds of password guesses in one request. ?author=1 and /wp-json/wp/v2/users hand out user names. Many hosts will run a PHP file uploaded to wp-content/uploads. None of this is a bug, and all of it is what automated attacks try first.

Hardening turns those defaults off. WordPress’s own hardening guide covers the basics; the hard part for an agency is doing it the same way on 50 or 200 sites and knowing it still holds after a host migration, a new cache plugin or a server change.

The switches Keptstone applies

The connector applies one security policy per site. The agency sets defaults once and can change any site on its own.

Switch What it does on the site Default
File editor off Defines DISALLOW_FILE_EDIT On
XML-RPC blocked xmlrpc.php answers 403, pingbacks and the X-Pingback header go; Jetpack’s signed requests still pass On
User listing blocked ?author=N redirects home for visitors, anonymous /wp/v2/users gets 401, no author in oEmbed or the users sitemap On
One login error The same message for a wrong username, email or password On
Version hidden No generator tag; readme.html blocked and deleted, again after core updates On
No PHP in uploads A deny rule in wp-content/uploads/.htaccess On
Sensitive files blocked debug.log, error_log, wp-config.php backups and .sql files denied; .git, .svn and .env answer 404 On
No folder listings Options -Indexes On
Security headers X-Content-Type-Options, Referrer-Policy, Permissions-Policy, no X-Powered-By, also on cached pages where .htaccess is read On
Framing blocked X-Frame-Options: SAMEORIGIN (turn off for sites embedded elsewhere) On
HSTS Raised one step each clean week: 5 minutes, then 1 week, 1 month and 1 year; never includeSubDomains or preload On
Login limit 5 failed logins in 15 minutes locks an address out for 30 minutes, even with the right password On
Breached passwords New passwords found in data breaches are refused; an administrator who logs in with one is told to change it On
Two-step login Required for administrators: see two-step login On
Code lock No plugin or theme zips uploaded from wp-admin and no file editors; installs from WordPress.org still work On
Administrator guard Only a signed-in administrator, WP-CLI or Keptstone can make an administrator On
Migration plugins off All-in-One WP Migration, Duplicator and similar stay off, with “Allow for 24 hours” for a real move Off
Application passwords off Turns WordPress’s application passwords off Off

The HSTS ramp is deliberate. A long max-age on a site whose certificate later lapses locks every returning visitor out, so the header grows only while the site stays healthy.

Lockouts use the visitor’s real address: REMOTE_ADDR, except that a request from Cloudflare’s published ranges uses CF-Connecting-IP, and one from the host’s own private proxy uses the last X-Forwarded-For entry, the one that proxy added. A header an attacker sends cannot choose who gets locked out.

Breached passwords are checked against Have I Been Pwned with the first five characters of the password’s SHA-1 hash, so neither the password nor its hash leaves the site.

Tested the way an attacker sees it

A switch that is on is not the same as a door that is closed. After applying a policy, every day, and on Check now, the site sends real requests to its own public address: the home page fresh and as cached, the login page, an XML-RPC call, ?author=1, /wp/v2/users, debug.log, .git/HEAD, readme.html and the uploads folder. Each control gets one of four results:

  • Verified: the request was refused or the header was there.
  • Not in effect: switched on, but the site still shows it, with the reason. A server that does not read .htaccess, such as nginx, is the usual one; the fix is a rule in the server’s own settings, which the host can add.
  • Off: the agency switched it off.
  • Not checked: the check could not run.

The score is the share of checked controls that are verified. The site sends these requests to itself, with a token only it can make, rather than Keptstone sending them, because a host’s bot protection reads requests for /.git/HEAD from an outside server as a vulnerability scan and may block that server. On sites behind such hosts, the checks still run through check-in mode.

Applied without breaking the site

Before saving a policy, the connector loads the home page, the login page and the REST root from the site itself. It saves the policy, writes its .htaccess blocks (marked # BEGIN Keptstone), and loads the pages again, once more after 5 seconds if something looks wrong. If a page that worked now fails, it puts the previous settings and files back and says so on the site’s card and in the activity log. It also puts a tiny PHP file in uploads, requests it and deletes it, to learn whether PHP runs there.

The code lock and the administrator guard

With a stolen administrator password, an attacker’s next step is adding code. The code lock has two strengths. Block uploads, the default, refuses plugin and theme zips uploaded from wp-admin and the file editors, and never lets a file manager or PHP snippet plugin be switched on, while installs and updates from WordPress.org keep working; every install by a person is a critical alert and, on the $4 plan, starts a malware scan. Block everything lets only Keptstone install code. Open for an hour lets a developer in, and the lock closes by itself.

The administrator guard watches every way WordPress hands out the administrator role. A grant from a scheduled task, a visitor’s request or anyone who may not make administrators is undone at once: the account gets its old role, a new random password and no sessions, and the agency gets a critical event naming the file that did it.

For the worst day there is Emergency lockdown: log everyone out, new passwords for every administrator, and DISALLOW_FILE_MODS until you lift it from the same dialog.

What is deliberately not set

Content-Security-Policy, COOP and COEP are not sent. They break too many sites without tuning per site. Keptstone also does not rename wp-login.php or change the database table prefix; login limits, two-step login and the code lock do more against real attacks.

What the agency and the client see

The Security page shows every site’s score, what is not in effect, failed logins and lockouts over 7 days, and Protect selected to switch chosen sites on with the defaults (start with two or three, check them, then the rest). Each site’s Protection card has the checks, its own settings and Check now.

The client sees “How your site is protected” on the Site care page in their WordPress: every check with its result and, when it is not green, the one-line reason. Nothing on that page can be switched.

Which plan it is in

Hardening, the daily checks, two-step login, the code lock and the administrator guard are in both plans, Care at $2 and Care + Protect + Speed at $4 a site a month. The firewall and malware scans need the $4 plan. See WordPress security for agencies for how the layers fit together.

Questions

What is WordPress hardening?

Hardening is changing a site's default settings so common attacks have less to work with: turning off the file editor, blocking XML-RPC, hiding user names, stopping PHP from running in uploads, blocking sensitive files and limiting login attempts. It does not fix vulnerable plugins; updates and a firewall do that.

Why would a hardening setting show as Not in effect?

Usually because the server ignores the method used. Several rules are written to .htaccess, which Apache and LiteSpeed read and nginx does not. Keptstone requests the blocked file or path from the site's own address and reports what actually came back, with the reason.

Can hardening break a client site?

It can, which is why Keptstone loads the home page, the login page and the REST API before and after it applies a policy, and puts the previous settings and files back if a page that worked now fails. Framing protection is the one most often turned off, for sites embedded in another site.

Is hardening in the $2 plan?

Yes. Hardening, two-step login, the code lock, the administrator guard and the daily checks are all in Care at $2 a site a month. The firewall and malware scans are on Care + Protect + Speed at $4.