edge-stack is a lightweight edge gateway architecture that combines:
Caddyfor TLS termination and reverse proxyingCrowdSecfor IP reputation blockingCoraza (OWASP CRS)for WAF protections- A
Goauth/quota agent backed bySQLite
Instead of embedding large static code/config dumps here, this README now points to the source files directly.
Traffic flow:
- Request reaches
caddy CrowdSecbouncer applies threat-intel based decisionsCorazaWAF evaluates requests against CRS rulesforward_authcalls the Go agent (/v1/tenant-check)- Agent returns
X-Backend-Targetwhen access is allowed - Caddy proxies to the target Unix socket backend
- Orchestration:
docker-compose.yml - Caddy config:
caddy/Caddyfile - Caddy image build:
caddy/Dockerfile - Agent source:
agent/main.go - Agent module file:
agent/go.mod - Agent image build:
agent/Dockerfile
The agent uses three primary tables:
http: host config + quota state + rolling countershttp_now: current aggregation windowhttp_history: hour-based long-term history
See schema creation/migration logic in agent/main.go.
- Handler-focused E2E tests:
agent/main_e2e_test.go - Full Caddy+agent E2E tests (tagged):
agent/caddy_e2e_test.go
go test ./...
go test -tags=e2e ./... - Keep production config in source files, not duplicated docs.
- Update links above if files are renamed or moved.