Wharf is a revolutionary approach to Content Management System (CMS) security that separates administration from runtime. Instead of plugins with full system access running on your live site, Wharf uses an offline controller (the Wharf) and a read-only runtime (the Yacht) connected via a Zero Trust mesh network.
The gun should not be in the safe.
Traditional CMS security is like storing the vault’s drill, dynamite, and blueprints inside the vault. If an attacker gets in, they use your own tools against you.
Wharf inverts this:
-
The Yacht (Live Site): A neutered runtime. It serves content but cannot install plugins, edit code, or change configuration.
-
The Wharf (Controller): Your offline workshop. It holds the keys, runs diagnostics, and makes all administrative decisions.
-
The Mooring: A cryptographically secured connection that temporarily allows the Wharf to sync state to the Yacht.
THE WHARF (Offline Controller) THE YACHT (Online Runtime)
+--------------------------------+ +------------------------------+
| [Physical/Local Hardware] | | [Cloud/Edge Server] |
| | | |
| 1. IDENTITY (The Keys) | | 4. THE SHIELD (Rust Agent) |
| • Nitrokey / FIDO2 | | • eBPF Force Field |
| • Argon2id + LUKS | | • Header Airlock |
| | | • DB Proxy (AST Aware) |
| 2. INTENT (The Brain) | | |
| • Nickel Config Schema | | 5. THE PAYLOAD (Legacy) |
| • Nebula CA (Offline) | | • WordPress / Drupal |
| • Rust Compiler | | • Read-Only Filesystem |
| | | • Ephemeral RAM Disk |
+---------------+----------------+ +--------------+---------------+
| |
| THE MOORING (Zero Trust) |
| |
+==========================================+
| • Hidden UDP Port (Nebula Mesh) |
| • Mutual TLS (mTLS) |
| • Invisible to Public Internet |
+==========================================+The Yacht Agent acts as a SQL proxy, parsing queries using an Abstract Syntax Tree (not regex!) to enforce security policies:
-
Mutable Tables (Blue Zone): Content like comments and orders—allowed to write
-
Immutable Tables (Red Zone): Config like users and plugins—blocked unless from Wharf
-
Hybrid Tables (Grey Zone): Mixed content like
wp_options—conditional rules
-- ALLOWED: User comment
INSERT INTO wp_comments (comment_content) VALUES ('Great post!')
-- BLOCKED: New admin user
INSERT INTO wp_users (user_login, user_pass) VALUES ('hacker', 'password')
-- Error: Policy violation: write to immutable table 'wp_users'The Yacht filesystem is mounted read-only with specific writable "playgrounds":
| Path | Type | Purpose |
|---|---|---|
|
Persistent, No PHP |
User media files |
|
RAM Disk (tmpfs) |
Temporary cache—wipes on restart |
|
OverlayFS |
"The Lie"—plugins think they write, but it’s ephemeral |
A Rust-based HTTP proxy strips dangerous headers and injects security headers:
# Stripped (Information Leakage)
- Server: Apache/2.4.41
- X-Powered-By: PHP/8.1
# Injected (Security Hardening)
+ Cross-Origin-Opener-Policy: same-origin
+ Cross-Origin-Embedder-Policy: require-corp
+ Permissions-Policy: camera=(), microphone=()-
Rust (via rustup)
-
Podman (or Docker)
-
Just (command runner)
-
Optional: Nebula, named-checkzone (bind-utils)
# Clone the repository
git clone https://gitlab.com/hyperpolymath/wharf.git
cd wharf
# Initialize the workspace
just init
# Build everything
just build# Create zone file variables
cat > vars/example.json << 'EOF'
{
"domain": "example.com",
"ip": "192.0.2.1",
"ipv6": "2001:db8::1",
"nameserver": "ns1.example.com",
"nameserver2": "ns2.example.com",
"rpemail": "hostmaster.example.com",
"serial": "2025112601",
"ttl": "3600",
"nsttl": "86400"
}
EOF
# Build DNS zone files
just build-zones
# Audit the generated zone
just audit-zone dist/example.db example.com
# Detect if dedicated or shared hosting
just detect-env example.com 192.0.2.1Wharf includes four DNS templates for different environments:
| Template | Use Case | Key Difference |
|---|---|---|
|
Modern minimum viable |
Basic records + email deliverability (SPF, DMARC, CAA) |
|
Shared/Virtual hosting |
Uses CNAMEs, includes provider SPF, no SSHFP |
|
Dedicated IP |
Explicit FTP A record, full control |
|
Enterprise/Security-focused |
DANE, SSHFP, OPENPGPKEY, HTTPS/SVCB, LOC |
Wharf includes adapters for popular CMS platforms:
# Copy the DB proxy drop-in
cp adapters/wordpress/db.php /var/www/html/wp-content/db.php
# The Yacht Agent must be running on 127.0.0.1:3307# Include the settings override
echo "include_once '/opt/wharf/adapters/drupal/settings.php';" >> sites/default/settings.phpWharf assumes:
-
The live server (Yacht) is hostile territory
-
Attackers may have SQL injection or file upload vulnerabilities
-
Network is untrusted (even internal networks)
| Attack Vector | Wharf Defense |
|---|---|
SQL Injection → New Admin User |
Database proxy blocks writes to |
File Upload → PHP Shell |
Uploads directory has |
Plugin Backdoor |
Plugins directory is read-only (OverlayFS) |
Config Tampering |
|
Network Sniffing |
Nebula mesh encrypts all admin traffic |
Wharf uses Nickel for declarative configuration:
-
configs/fleet.ncl- Define your Yachts -
configs/policies/database.ncl- Database virtual sharding rules -
configs/policies/airlock.ncl- HTTP header rules -
configs/policies/filesystem.ncl- File immutability policies -
configs/policies/auth.ncl- FIDO2 and session policies -
configs/policies/network.ncl- Nebula mesh and firewall rules
just init # Initialize workspace
just build # Compile everything
just moor <target> # Connect to a Yacht
just audit <target> # Security audit
just gen-nebula-ca # Generate mesh CA
just gen-yacht-cert # Generate Yacht certificate
just gen-email-records # Generate SPF/DKIM/DMARC
just deploy-yacht # Deploy agent to serverContributions are welcome! Please ensure:
-
Code passes
just lintandjust fmt-check -
Tests pass with
just test -
Security-sensitive changes are documented
