How This Fortress Is Built

A tour of the walls around this site: no open ports, no SSH, a gate in front of the admin, and an AI helper that can't publish without me.

How This Fortress Is Built: a cliffside Norse fortress with layered walls of glowing shields

A security blog that gets popped is a punchline. So before writing much here, I built the walls. This is a tour of them, at the level of design rather than blueprints. It’s the same layered thinking I’d want on any public-facing system, sized for one person and a very small server.

The moat: nothing listens to the internet

The server is a small cloud VM in a Canadian data centre. It has no open inbound ports. Not 80, not 443, not 22. Instead, a tunnel daemon on the server dials out to Cloudflare, and visitors reach the site through that tunnel. If you scan the server’s address, there’s nothing to talk to.

Two firewalls back that up: the provider’s cloud firewall in front of the VM, and a deny-by-default host firewall on it. Either one alone would block inbound traffic. Having both means one mistake doesn’t open the gate.

No front door key under the mat: SSH is off

There’s no SSHSSH Secure Shell. The standard way to get a remote command line on a server, and one of the most attacked services on the internet. service running. When I need a shell, I use the provider’s out-of-band consoleout-of-band console A way into a server that doesn't depend on the server's own network services, like a provider's web console. It still works when SSH is off or broken., which sits behind my account login and multi-factor authenticationMFA Multi-factor authentication. Proving who you are with something beyond a password, like an authenticator app, passkey or hardware key.. It’s slightly less convenient. It also removes the single most attacked service on the internet from the picture.

The gatehouse: the admin isn’t public

The WordPress login and admin pages sit behind an identity-aware proxyidentity-aware proxy A gateway that checks who you are (and sometimes where you are and what device you're on) before letting your request reach an application.. Before WordPress ever sees a request, you have to prove who you are with a one-time code sent to my email, and pass a location check. Everyone else gets turned away at the edge. Password spraying against wp-login.php doesn’t work when the attacker can’t reach wp-login.php.

The archers: a WAF for the obvious stuff

A handful of custom firewall rules at the edge block the scanner noise every WordPress site attracts: probes for XML-RPCXML-RPC An old remote-control interface built into WordPress. Rarely needed today, and a favourite target for password-guessing attacks., config backups, .env files and the usual list of plugin paths I don’t run. It’s not sophisticated. It doesn’t need to be. It keeps the logs quiet enough that something unusual would stand out.

Inside the walls: WordPress, trimmed down

  • User names aren’t exposed through the REST APIREST API A web interface that lets programs read and change a site's data over HTTP. WordPress has one built in., author archives or the sitemap, so there’s no list of logins to guess against.
  • XML-RPC is off.
  • Application passwordsapplication password A separate password WordPress issues for a tool or script, which can be revoked on its own without touching your main login. only work on one endpoint, the one my assistant uses, and that endpoint has its own gate in front of it.
  • Security headers are set, and there’s a security.txt so anyone who finds a problem knows how to tell me.
  • Core updates for security land automatically. Plugins are kept to the minimum, and the defaults I didn’t need are gone.
  • The theme is my own. No page builder, no bundle of third-party code I haven’t read.

Since this post first went up, the site also gained a strict Content Security PolicyCSP Content Security Policy. A header telling the browser which scripts and resources a page may load, so injected code is refused., so an injected script is refused by the browser even if something upstream lets it through. That rollout got its own write-up.

The steward: an AI helper on a short leash

I use an AI assistant to help draft and edit here. It connects through that one gated endpoint with its own service credential, and its WordPress role is cut to what the job needs. It can write drafts and fix typos in published posts. It can’t change settings, can’t add raw scripts to pages, can’t delete anything that’s live, and can’t publish unless I’ve said so in plain words for that specific item. Every capability it has is one I chose to give it.

That’s the same rule I’d apply to any service accountservice account An identity used by software rather than a person. It needs an owner, the narrowest possible permissions and a regular review.: least privilegeleast privilege Give every person, service and tool only the access it needs for its job, and nothing more. When something is compromised, the damage stays small., a separate identity, and a human in the loop for anything irreversible.

The granary: backups

The database and uploads are backed up every night, with two weeks of copies kept. The whole build is in a GitGit Version control: a full history of every change to a set of files, with who, when and why, and the ability to roll back. repository, so if the VM vanished tomorrow I could rebuild it from scripts rather than memory. But a backup you haven’t restored is a hope, not a plan, so a full test restore is next on my list. I’ll write up how it goes.

Which wall stops what

Layers only make sense against specific threats. Here’s the map, so each control has a reason to exist:

ThreatMain layerBackup layer
Scanning and direct attacks on the serverNo open ports; traffic arrives only through the outbound tunnelCloud firewall plus a deny-by-default host firewall
SSH brute forceNo SSH service at allOut-of-band console behind account login and MFA
Password spraying the WordPress loginIdentity-aware proxy in front of the adminHidden usernames, so there’s no list to spray
Automated probes for known weaknessesEdge firewall rules for the usual scanner pathsMinimal plugins, XML-RPC off, my own theme
Stolen application passwordIt only works on one endpointThat endpoint has its own gate at the edge
Injected script (cross-site scripting)Content Security Policy with per-request noncesNo raw HTML for the AI account, and few plugins to inject through
An AI helper that gets misledA role without settings, users, plugins or deletion of postsPublishing needs my explicit approval per item
Data loss or a dead serverNightly backups, two weeks keptThe whole build in Git, rebuildable from scripts

Notice that every row has two entries. Any single control can fail, be misconfigured or be bypassed. The design goal is that one mistake never leaves a threat with nothing in its way.

What I’m not telling you

You’ll notice no addresses, account names, rule details or versions. Describing a design is useful to other defenders. Publishing the exact config mostly helps attackers. That line matters, and I’ll keep walking it as the homelabhomelab A small lab of servers and network gear at home for learning, testing and self-hosting, where breaking things is part of the point. posts come.

And if you’re the curious type, the walls aren’t the only thing worth inspecting. There are a few things hidden around here on purpose.

ᛟ ᛟ ᛟ