RAIA™ Specification

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.

← Back to Developer Hub TEXTBOOK SPECIFICATION
🧩 Section A: In Plain English

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.

ZONE 01: PUBLIC INTERNET Public Lettings/Sales User IP: Dynamic / Client WAN Access: www.estateaigents.org 🕵️ Threat / Port Scanner Bot Launches Brute-Force Scans Target: Public IP 31.97.113.196 Blocked Ports: 22, 80, 443, 9120 UFW FIREWALL (PUBLIC GATE DENY) BLACK-HOLE DROP ZONE Hits Public DNS CDN DROP (No Reply) ZONE 02: ENCRYPTED TAILSCALE VPN (WIREGUARD MESH) 💻 Dev Laptop (Zenbook) Tailscale IP: 100.115.42.16 Key Expiry: Enabled (180d) Credential: SSH Key Auth 📱 Dev Mobile (Honor Aussie) Tailscale IP: 100.119.89.23 Biometric APP LOCK: ACTIVE Key Expiry: Enabled (180d) ⚙️ Peer Servers (geneius/lt) IPs: 100.64.21.3 / 100.65.12.8 Key Expiry: Disabled Sovereign Node Peer Exchange 🖥️ SECURE VPS NODE (gb-mnc-01) Tailscale IP: 100.120.31.7 Public IP: 31.97.113.196 (FIREWALLED) Key Expiry: DISABLED (Forever Active) 🌐 Nginx Server (Port 80/443) Binds strictly to Tailscale virtual socket! server { listen 100.120.31.7:80; ... } docs.estateaigents.com -> /html/docs kanban.estateaigents.com -> /kanban 📟 Hermes Gateway & TUI (Port 9120) Proxies terminal console over Tailscale Binds to interface: tailscale0 Access: http://100.120.31.7:9120 🗄️ PostgreSQL Database (db_raia) Enforces strict Row-Level Security (RLS) db_raia (suazhpquxpzuhbtritxj) db_esoteric (bwrnydpssbudswttqbry) CRITICAL GATES (ADR-250): • Tenancy: Sequential (active count <= 1) • Sales: Singular (completed count <= 1)
================== --> UFW Border (Blocked) Encrypted WireGuard Mesh Internal VPS Secure Bindings Peer Exchange

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.

🔧 Section C: Developer Guide

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
SECURITY ARCHITECTURE — DEFENCE IN DEPTH 1. NETWORK GATE Tailscale Identity Network-level Auth 🔐 Tailscale Gate 2. APPLICATION GATE RBAC Enforcement Session Validation 🛡️ Auth Layer 3. DATA GATE RLS & Encryption Audit Logging 🔒 Data Protection Defence-in-depth: network gate → application gate → data gate with audit logging at every layer Tailscale identity · Role-based access · Row-level security · Full audit trail Network / Identity Gate Application / Auth Layer Data / Encryption Layer Data flow →

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
Repo Reference RAIA

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.