Security & Firewall

Two-layer network protection so only your API server can reach the databases.

Security Model

Internet / random IPs  ──X──►  DB ports (blocked)
API server 72.60.223.44 ──✓──►  DB ports (allowed)
Admin                     ──✓──►  SSH port 22
Anyone                    ──✓──►  HTTP/HTTPS 80/443 (wiki + admin)

Layer 1 — UFW Firewall

RuleWhoPort
SSHAny IP22
PostgreSQL72.60.223.445432
MongoDB72.60.223.4427017
Redis72.60.223.446379
Qdrant72.60.223.446333, 6334
Neo4j72.60.223.447687
HTTP/HTTPSAny IP80, 443

Layer 2 — DOCKER-USER Chain

Docker can bypass UFW. The DOCKER-USER iptables chain enforces the same IP restriction:

  1. Established connection → allow
  2. From 72.60.223.44 → allow
  3. Everything else → drop

Application Security Rules

Per-App Isolation

DatabaseIsolation method
PostgreSQLSeparate DB + user per app
MongoDBSeparate DB + user per app
RedisACL user scoped to myapp:* key prefix
QdrantCollection naming: myapp_documents
Neo4jLabel prefix: MyApp_User + dedicated user

What Is NOT Exposed