Layer 4 Defense (TCP Warden)
Protocol-aware reverse proxy protecting SSH, SMTP, IMAP, PostgreSQL, MySQL, Redis, and game servers.
Stop sensitive file leaks (.env, .git, backups), protect non-HTTP services (SSH, SMTP, DBs), and block threats before requests reach your backends.
RouteWarden is a unified edge defense suite built for reverse proxies and servers. It protects both web traffic (Layer 7) via Traefik, Caddy, and NGINX, as well as infrastructure services (Layer 4) via TCP Warden.
Every server exposed to the public internet gets hammered by automated scanning scripts hunting for .env files, .git trees, backup archives, open databases, and unauthenticated management ports. RouteWarden filters these threats out at the perimeter before they consume backend resources.
Get protected in seconds with your preferred gateway:
services:
traefik:
image: traefik:latest
command:
- "--experimental.plugins.routewarden.modulename=github.com/routewarden/traefik-warden"
- "--experimental.plugins.routewarden.version=v1.4.2"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.middlewares=warden@docker"
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- "traefik.enable=true"
# Global EntryPoint Shield: protects ALL services automatically
- "traefik.http.middlewares.warden.plugin.routewarden.enabled=true"
- "traefik.http.middlewares.warden.plugin.routewarden.enableDefaultPatterns=true"
webapp:
image: nginx:alpine
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=PathPrefix(`/`)"
- "traefik.http.routers.app.entrypoints=web"RouteWarden evaluates inbound HTTP requests in five stages:
methods (default: ["GET"]). Non-matching methods bypass inspection immediately.allowedIps via socket RemoteAddr, X-Forwarded-For, or X-Real-IP. Trusted addresses bypass checks immediately.%252e%252e), strips matrix parameters (/;param/.env), normalizes backslashes (\), and removes null bytes.allowPatterns) first. If not exempted, checks built-in sensitive dictionaries and custom blockPatterns.With enableDefaultPatterns: true active, RouteWarden blocks common exposure paths without requiring custom rules:
Blocks /.env, /.env.local, /.env.production, /.aws/credentials, and /.ssh/id_rsa.
Prevents source disclosure via /.git/config, /.git/HEAD, /.svn/entries, and /.hg/.
Catches accidental exposure of /dump.sql, /db.bak, /backup.tar.gz, and /site.zip.
Guards server manifests like /config.yaml, /app.ini, /phpinfo.php, and Spring /actuator/*.
Attackers often obfuscate request paths to bypass string matching. RouteWarden normalizes paths before evaluation:
| Evasion Technique | Raw Attacker Payload | RouteWarden Normalized Candidate | Action |
|---|---|---|---|
| Double URL Encoding | /%252e%252e/%252eenv | /.env | Blocked |
| Semicolon Matrix Traversal | /public;param=1/..;param=2/.env | /.env | Blocked |
| Windows / Backslash | /static\..\.git\config | /.git/config | Blocked |
| Null Byte Injection | /.env%00.png | /.env | Blocked |
| Dot-Segment Traversal | /images/../.aws/credentials | /.aws/credentials | Blocked |
When a path matches a block rule, choose how RouteWarden defends your server:
json, html, text, xml, or a deceptive fakeSuccess (200 OK honeypot).gzipBomb (~1000× RAM expansion), reset connections via silentDrop, or delay scanners with tarpit.captcha (Turnstile / hCaptcha / reCAPTCHA), rate-limit via rateLimitChallenge (HTTP 429), or divert to a canary backend via proxy.Real-world deployment patterns demonstrating how engineering teams protect their applications using RouteWarden:
Public photo/album sharing while strictly cloaking administrative, login, and user management APIs under a 404.
Lock down Stripe/GitHub payment webhook ingress using official provider IP CIDRs and silent TCP drops.
Shield Prometheus /metrics and Spring Boot /actuator from public scanners while keeping internal scrapers active.
Defeat brute-force and XML-RPC attacks on wp-login.php using interactive Cloudflare Turnstile / hCaptcha challenges.
Allow public mobile password sync while restricting /admin strictly to WireGuard or Tailscale subnets.
Crash scanning bots with gzipBomb decompression traps, reset TCP connections with silentDrop, and cloak staging preview clusters.
Emit structured JSON security audit events directly into CrowdSec to automatically ban attacker IPs across your firewall on their first request.