Aegis — Web Application Firewall & Reverse Proxy Manager
Aegis is a production-grade Web Application Firewall (WAF) and Reverse Proxy Manager written in Go. It combines the host management experience of Nginx Proxy Manager with a full WAF engine that evaluates OWASP Top 10 rule sets on every proxied request. Single binary. SQLite storage. Zero risky dependencies. Aegis ships as a single static binary with an embedded admin UI, uses SQLite (WAL mode) for all persistent storage, and binds the admin dashboard to127.0.0.1:9443 by default for security. No Nginx, no Docker, no external database required — just run the binary and start adding hosts.
Design Principles
- NPM replacement — domain-based routing, load balancing, SSL/TLS termination, health checks, and WebSocket proxying without needing a separate reverse proxy
- Per-host WAF profiles — each proxy host independently runs in
off,detect, orenforcemode with its own rule chain - Zero-lock hot path — atomic pointer swaps for config, channel-buffered log writes, per-bucket rate limiters; no mutex on the request path
- First-run setup wizard — no default credentials; forces secure initialization on first launch
Feature Overview
Reverse Proxy
NPM-equivalent multi-host routing, load balancing, SSL/TLS, WebSocket proxying
WAF Engine
26 built-in OWASP rules, rate limiting, IP blacklists/whitelists, CORS enforcement
Allow Lists
IP/CIDR, local auth, OAuth/OIDC SSO, Active Directory access control
Custom Rules
Condition builder and raw regex rule authoring with live testing
CLI & Operations
CLI reference, configuration, service management, environment variables
API Reference
Full REST API for hosts, rules, traffic, analytics, SMTP, and system management
Quick Start
Build from source
First run
http://127.0.0.1:9443 in your browser to run the setup wizard, which prompts for:
- Admin username and password (minimum 12 characters)
- Email address (for magic link authentication, optional)
- SMTP configuration (optional, enables passwordless login and alerts)
Default Listeners
| Service | Default Address | Description |
|---|---|---|
| Admin UI | 127.0.0.1:9443 | Dashboard and API (localhost only) |
| HTTP Proxy | :80 | Inbound HTTP traffic + ACME HTTP-01 challenges |
| HTTPS Proxy | :443 | Inbound HTTPS traffic with TLS termination |
Architecture
Request Lifecycle
Concurrency Model
- Goroutine per request — Go’s
net/http.Serverdefault model - Atomic config reads —
atomic.Pointer[map[string]*runtimeHost]for zero-lock host lookups - Per-bucket rate limiting —
sync.Mapof token buckets with per-bucketsync.Mutex - Buffered log writes — request logs sent to a buffered channel, batch-inserted by a background goroutine
- Background health checks — periodic goroutine checks upstream health without blocking requests
Building
From source
With version injection
Requirements
- Go 1.22 or later
- No CGO required (uses
modernc.org/sqlite, a pure Go SQLite implementation)
Dependencies
| Module | Purpose |
|---|---|
modernc.org/sqlite | Pure Go SQLite driver (no CGO) |
golang.org/x/crypto | bcrypt password hashing, ACME/autocert for Let’s Encrypt |
gopkg.in/yaml.v3 | YAML configuration file parsing |
Authentication
- Password-based login with bcrypt hashing (minimum 12 characters)
- Passwordless magic link authentication via email
- Backup email address support
- Per-session CSRF token protection
- Session cookies with
HttpOnly,Secure,SameSite=Strict
Notifications
- SMTP sending profile management (create, update, delete, test connection)
- Encrypted SMTP password storage (AES-256-GCM)
- Magic link authentication emails
- Alert notification emails
- Configurable
Fromname and address
Admin Dashboard
- Real-time traffic analytics (request counts, block rates, 24h stats)
- Top attacker IPs with request and block counts
- Top attacked hosts breakdown
- Attack trend timeline with allowed/blocked/detected bucketing
- Rule effectiveness stats (hits per rule)
- Geographic analytics with country enrichment and local cache
- Live traffic streaming via Server-Sent Events (SSE)
- Audit log of all admin actions

