Skip to content

Container Discovery & Opt-In Logging ​

Routewarden automatically discovers Docker containers via /var/run/docker.sock. It operates on a pure opt-in model to eliminate log noise, avoid guessing based on container names, and ensure the dashboard never logs unrelated containers on your host.


How to Enable Logging for a Container ​

To send security logs from any gateway container (Traefik, Caddy, NGINX, or TCP Warden) to Routewarden's dashboard, add the label routewarden=true (or routewarden.logs=true) to the container:

services:  traefik:    image: traefik:latest    container_name: traefik    labels:      - "routewarden.logs=true"  caddy:    image: caddy:2-alpine    container_name: caddy    labels:      - "routewarden.logs=true"  nginx:    image: openresty/openresty:alpine    container_name: nginx    labels:      - "routewarden.logs=true"  tcp-warden:    image: ghcr.io/routewarden/tcp-warden:latest    container_name: tcp-warden    labels:      - "routewarden.logs=true"

Whenever a container carries routewarden=true or routewarden.logs=true, rwarden dashboard and rwarden monitor automatically discover the container and stream its stdout/stderr logs into the real-time visualization engine.


Why Pure Opt-In? ​

Relying on container name patterns (e.g. traefik*, nginx*) is fragile in real-world deployments where containers are dynamically provisioned, clustered, or renamed. The pure opt-in label approach provides distinct advantages:

  1. Zero Self-Logging: Dashboard containers are never scraped because they do not carry the opt-in label.
  2. Zero Host Pollution: Other containers running on the Docker host (PostgreSQL, Redis, background workers, or unrelated web services) are completely ignored by default.
  3. No Brittle Name Pattern Matching: Container naming conventions (my-nginx, staging-proxy, prod-traefik) do not matter—only containers you explicitly designate with routewarden=true are ingested.
  4. Clean Log Extraction: Log streams are cleanly parsed, multiplexed, and translated into standard Combined log format.

UDP Log Support ​

Routewarden handles UDP logs across two key dimensions:

1. Layer 4 UDP Protocol Security Events ​

TCP Warden guards Layer 4 UDP protocols such as:

  • DNS on port 53 (detecting domain tunneling, high-frequency query flood, and blacklisted domains)
  • BitTorrent DHT/uTP
  • Custom UDP services

When a datagram is dropped, rate-limited, or blocked, TCP Warden emits a structured JSON event. The pipeline automatically extracts transport="udp", protocol="dns", and normalizes action="blocked" into verdict="BLOCK", seamlessly integrating Layer 4 UDP defenses into your real-time security dashboard alongside Layer 7 HTTP events.

2. Network UDP Syslog Ingestion ​

You can stream raw syslog or JSON events directly over network UDP (127.0.0.1:1514) from external proxies, routers, and firewalls:

{  "timestamp": "2026-10-01T15:30:00Z",  "plugin": "tcp-warden",  "service": "dns",  "protocol": "dns",  "transport": "udp",  "client_ip": "198.51.100.22",  "action": "blocked",  "reason": "blocked_domain"}

Structured Log Normalization ​

When security events are ingested, Routewarden normalizes diverse fields across different gateways into a unified schema:

Ingested FieldNormalized Stream LabelDescription
verdict / actionverdict="BLOCK\|ALLOW\|THROTTLED"Primary filter for security dashboards
type="routewarden_block"verdict="BLOCK"Traefik HTTP security block event
type="routewarden_allow"verdict="ALLOW"Whitelisted or permitted traffic
gateway / plugingateway="traefik\|caddy\|nginx\|tcp-warden"Gateway or reverse proxy identifier
levellevel="warn\|info\|error"Event severity
protocol / transportprotocol="dns\|ssh\|http"Protocol and transport layer
country_codecountry_code="US\|DE\|LAN"GeoIP origin identifier
client_ip / ipclient_ip (Structured Metadata)IP address for high-cardinality indexing
pathpath (Structured Metadata)Target URL or endpoint probed
matched_patternmatched_pattern (Structured Metadata)Specific defense signature triggered
rule_idrule_id (Structured Metadata)Unique rule identifier

By storing high-cardinality values (client_ip, path, matched_pattern) as structured fields, Routewarden ensures forensic parsing remains blazing fast without memory bloat.

Released under the MIT License.