3.5 Layered Security & OpenRouter API Content Isolations
We hide all our developer databases and services behind an encrypted Tailscale network, making our systems look completely powered off and non-existent to anyone on the public internet.
Security Architecture Guide — Zero-Trust Network & Perimeter Hardening
We hide all our developer databases and services behind an encrypted Tailscale network, making our systems look completely powered off and non-existent to anyone on the public internet.
💡 ELI5 Summary
We hide all our developer databases and services behind an encrypted Tailscale network. To anyone on the public internet, our systems look completely powered off and non-existent.
Preamble: Hardening the Perimeter
A single security slip or open port in a decentralized property intelligence platform can lead to catastrophic financial liabilities, GDPR data leakage fines, and severe legal actions. To completely eliminate network exposure, we implement a **Zero-Trust network architecture** enforced at the OS IP level. By locking all VPS nodes behind an encrypted **Tailscale Private Subnet**, restricting reverse proxies strictly to Tailscale virtual interfaces, and black-holing the public ports via local firewalls (UFW), we guarantee that all specifications, data-mining backfills, and system-operator controls are entirely invisible to the public internet.
01. Interactive Network Topology & Permission Mapping
Below is the official dark-themed network topology diagram detailing our IP-level permission gating, local firewall (UFW) boundaries, and the encrypted WireGuard subnet routing.
02. Chapter 1: The Zero-Trust Topology (The Firewall Black Hole)
To prevent public-facing bots, brute-force algorithms, and automated exploit scanners from discovering our nodes, the public network interfaces of all our servers are completely black-holed. We enforce this configuration at the Linux kernel packet level using the **Uncomplicated Firewall (UFW)** on the nodes.
Our Production UFW Configuration (Applied to gb-mnc-01)
The following sequence denies all public incoming requests by default, selectively allowing incoming ssh, nginx web, and Hermetic TUI traffic ONLY when packets originate from the virtual interface device tailscale0.
# 1. Deny everything by default sudo ufw default deny incoming sudo ufw default allow outgoing # 2. Allow SSH strictly via the Tailscale virtual interface sudo ufw allow in on tailscale0 to any port 22 proto tcp comment 'Secure SSH via Tailscale' # 3. Allow Nginx virtual hosts strictly via Tailscale sudo ufw allow in on tailscale0 to any port 80 proto tcp comment 'Private Developer HTTP Nginx' sudo ufw allow in on tailscale0 to any port 443 proto tcp comment 'Private Developer HTTPS Nginx' # 4. Allow Hermes Agent Gateway strictly via Tailscale sudo ufw allow in on tailscale0 to any port 9120 proto tcp comment 'Hermes Gateway Connection' # 5. Explicitly deny public traffic on default web and SSH ports sudo ufw deny 22/tcp comment 'Block Public SSH' sudo ufw deny 80/tcp comment 'Block Public HTTP' sudo ufw deny 443/tcp comment 'Block Public HTTPS' # 6. Enable the ruleset sudo ufw enable
Operational Outcome: The Black Hole Phenomenon
If a scanner executes an IP scan on our public address 31.97.113.196, the VPS does not return an "Access Denied" or TCP Reset packet. UFW drops the packet silently at the network card level. To the scanner, the server behaves as if it is powered off or completely non-existent, eliminating targeted exploit scans.
03. Chapter 2: Tailscale ACLs & Permission-Led Gating
To prevent device theft from compromising the secure perimeter, the Tailscale VPN console is governed by strict, tag-based access control lists (ACLs) and aggressive device-specific expiration policies.
Server Node Policy (gb-mnc-01, geneius, lt)
- Key Expiry: Strictly **Disabled** in the Tailscale admin panel. Prevents automated cron tasks, backup syncs, and background agent loops from suddenly losing credentials and dropping offline.
- ACL Tagging: Tagged as
tag:prod-server. Authorized to communicate amongst themselves for node peer data exchanges over the private WireGuard mesh.
User Device Policy (Laptops, Phones)
- Key Expiry: Enforced with an aggressive **180-day rotation limit**. The user must perform full SAML multi-factor authentication (MFA) again to re-authorize device keys.
- The Mobile Lockout Rule: All connected mobile devices must have **App Lock (biometrics / FaceID / secure PIN check)** active inside the Tailscale app settings. If a phone is physically stolen, the thief is blocked from accessing the mesh.
- One-Click Revocation: In the event of theft, an operator logs into the Tailscale Admin console from any phone or backup browser and clicks **Remove Machine**. Access is severed cryptographically and instantly.
04. Chapter 3: Hostname Resolving & Nginx Virtual Hosts
Access control at the network level is backed by strict host-binding rules inside the reverse proxy itself. Nginx is configured to explicitly bind its sockets to the Tailscale virtual interface IP (100.120.31.7) instead of binding globally (0.0.0.0).
Our Nginx Virtual Host Bindings (Secure Vhost Block)
This Nginx configuration blocks standard public requests at the application level. It listens strictly on the Tailscale virtual network card's IP address.
# 1. Developer Documentation Host
server {
listen 100.120.31.7:80;
server_name docs.estateaigents.com;
root /var/www/html/docs;
index guides_index.html;
location / {
try_files $uri $uri/ =404;
}
}
# 2. Local Kanban Task Manager
server {
listen 100.120.31.7:80;
server_name kanban.estateaigents.com;
location / {
proxy_pass http://127.0.0.1:9119;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Architectural Safeguard: The Domain Resolving Chain
The domain name docs.estateaigents.com has its DNS **A Record** configured strictly inside our secure Tailscale MagicDNS server. It resolves directly to 100.120.31.7. If a public DNS client query is launched against the domain, it returns no public record, guaranteeing that the domain name and IP are invisible to outsiders.
Architecture Details
The security architecture implements a defence-in-depth model with perimeter authentication, internal authorisation, data encryption, and audit logging at every layer. Access is gated through two independent layers: Tailscale identity verification at the network level, followed by role-based access control within the application.
- Core Component: Security gate guard and RBAC enforcement
- Data Flow: Request → Tailscale Gate → Authentication → Authorisation → Audit Log → Response
- Integration Points: Tailscale ACLs, Supabase Row-Level Security, session tokens, and audit log sinks
Configuration Reference
Key configuration parameters for this system:
| Parameter | Type | Default | Description |
|---|---|---|---|
| gate_enabled | boolean | true | Enable Tailscale gate guard for all pages |
| allowed_hosts | string[] | docs.estateaigents.com, localhost | Whitelist of permitted hostnames |
| session_ttl_minutes | integer | 60 | Session token time-to-live |
Figure 2: Security architecture — component interaction and data flow.
Troubleshooting
| Issue | Cause | Resolution |
|---|---|---|
| 401 Unauthorized on tailnet | Tailscale not running or wrong node | Verify Tailscale is connected and node is authorised |
| Gate guard redirect loop | Hostname not in allowed_hosts list | Add hostname to the gate guard whitelist |
This component is part of the RAIA (Real estate Artificial Intelligence Agent) platform mono-repo. Implementation details, API contracts, and integration tests are available in the repository.