Skip to content

Real-Time Security Dashboard (dashboard) ​

Routewarden includes a turnkey, ultra-lightweight real-time security dashboard powered by Routewarden's embedded Go server and SQLite persistence.

It provides an ultra-fast, live executive SOC dashboard consuming only ~8MB of RAM with zero external dependencies.


Performance & Resource Efficiency ​

MetricTraditional Monitoring StacksRoutewarden SOC Dashboard
Memory Footprint~500 MB – 1.2 GB RAM~8 MB RAM
Containers RequiredMultiple heavy containers0 containers (runs in single binary)
Startup Time15–30 secondsInstant (< 50ms)
Real-time UpdatesPolling intervals (5s–10s)Real-time SSE (< 10ms)
Storage OverheadHeavy time-series volumesEmbedded SQLite WAL (with 30-day auto-prune)
ConfigurationComplex multi-file configsZero configuration

Architecture Overview ​

Architecture Graphmermaid

Real-time SOC Architecture: Gateways → rwarden monitor → Routewarden SOC Engine → Web UI (http://localhost:7890)


Key SOC Capabilities ​

1. Embedded SQLite Telemetry Persistence ​

  • Logs and security events are buffered and asynchronously written to ~/.routewarden/dashboard/events.db in WAL mode every 200ms or 100 events.
  • Restart Survival: Historical metrics, threat breakdown ratios, and top attacking IPs persist across dashboard restarts.
  • Auto-Pruning: Telemetry older than 30 days is automatically pruned to keep disk usage lean (~10–30 MB).

2. Live SOC Stream, Pagination & Stream Controls ​

  • Verdict Tabs: Filter stream instantly by ALL, BLOCK (🛑), TARPIT (⏳), or ALLOW (🛡️).
  • Connected Node & Source Filtering: Dedicated 📡 All Nodes matrix dropdown and interactive badges in the 🌐 MONITORED NODES ribbon with active glow states to isolate events by container, remote agent, or log file.
  • Server-Backed Pagination: High-throughput SQLite pagination with selectable page sizes (25, 50, 100, 250), direct page jump, First / Prev / Next / Last buttons, and keyboard controls ([ / ] or Left/Right arrows).
  • Time Range Selector: Rolling time windows (1m, 5m, 15m, 30m, 1h, 6h, 24h, Custom Date Range) querying SQLite directly via GET /api/logs.
  • Stream Pause / Resume: Freeze table updates with ⏸ Pause or Space to inspect active security events; incoming logs are buffered with a counter badge (⏸ PAUSED (+N new)).

3. Password Protection & Custom Auth Screen (--auth) ​

  • Dedicated Cyber Auth Screen: When --auth <user:password> is enabled, browser visits to http://localhost:7890 are presented with a sleek, cyber-themed authentication screen (/login) complete with the Routewarden shield logo, operator ID & access key inputs, password visibility toggle, and error messaging.
  • Session Cookie & Sign Out: Successful login issues a secure session cookie (routewarden_auth) with 30-day persistence. Operators can sign out at any time via the 🚪 Sign Out button in the dashboard header.
  • Protected Endpoints: Protects GET /, /api/logs, /api/stream, /api/stats, /api/sources, and /api/ip-lookup.
  • Flexible Auth Channels: Supports standard HTTP Basic Auth (Authorization: Basic), Authorization: Bearer <token>, session cookies, and query parameters (?auth= / ?token=).
  • Whitelisted Endpoints: Static branding assets (/favicon.ico, /icon.svg) and cryptographic agent ingestion (/api/v1/*) remain open so remote edge agents can push without knowing dashboard passwords.
  • HUD Indicator: Active cyan 🔒 AUTH: <username> badge in the sticky topbar.

4. Mobile & Tablet Optimization ​

  • Responsive Layout (< 768px & < 480px): Complete mobile optimization with touch-friendly 36–44px controls and viewport-fit formatting.
  • Compact 2-Column KPI Grid: Displays all critical security indicators (Blocks, Tarpits, Total Events, EPS) in a neat 2-column layout instead of oversized vertical scrolling cards.
  • Mobile Cyber Hero: Automatically replaces the large raw ASCII banner with a clean, branded mobile hero header on smaller screens to prevent horizontal overflow.
  • Touch-Optimized Filters & Search: Full-width search bar and grid-based filter dropdowns with 16px inputs that prevent iOS auto-zooming.
  • Mobile Bottom-Sheet Modals: IP Threat Dossiers and Event Detail inspectors transition to native-feeling bottom sheets on mobile devices.
  • Auto-Hiding Desktop Shortcuts: The fixed bottom keyboard shortcut bar automatically hides on touch devices to maximize screen real estate.

5. Threat Intelligence Dossier ​

  • Inspect top attacking client IPs and click any row to reveal autonomous systems (ASN), reverse DNS, origin country, CIDR prefix, and one-click AbuseIPDB lookup.

6. Automated Data Retention & Storage Pruning (--retention, --max-events) ​

  • Automated Lifecycle Management: Configurable retention periods (--retention 30d, 7d, 48h, or 0 for unlimited). Expired telemetry rows are automatically purged on background intervals (--prune-interval 1h).
  • Maximum Event Row Capacity: Hard capacity limits (--max-events 100000) protect host disks from uncontrolled event flooding or high-traffic spikes.
  • Automatic SQLite Compacting (VACUUM): When significant batches of events are deleted, SQLite database pages are reclaimed via automated VACUUM to keep the .db file footprint minimal on disk.
  • Access Log Rotation (--max-log-size): Multiplexed access.log is automatically rotated to access.log.1 when exceeding configured size limits (default: 50MB).
  • Interactive Storage Modal: Accessible via the 💾 Storage topbar button or REST API (GET /api/v1/storage), displaying real-time database footprint, event count, age breakdown, and a one-click 🧹 Prune & Compact Now trigger (POST /api/v1/prune).

7. Keyboard Shortcuts (Desktop) ​

  • Space — Stream Pause / Resume
  • T — Toggle Theme (Auto / Light / Dark)
  • W — Focus Time Range filter
  • / — Focus Search / Grep filter
  • F — Focus Country filter
  • [ / ] (or ← / →) — Previous / Next Page in log stream
  • R — Reset all active filters
  • ESC — Close active modal dialog

Quick Start CLI Management (rwarden dashboard) ​

The Routewarden CLI embeds all dashboard assets, SQLite migrations, and templates directly in the binary. You can launch, inspect, and stop the dashboard with single commands:

# 1. Start the security dashboard (auto-discovers labeled containers & opens http://localhost:7890)rwarden dashboard# 2. Launch in background (detached daemon mode)rwarden dashboard -d# orrwarden dashboard up --detach# 3. Launch with optional HTTP Basic Auth protectionrwarden dashboard up --auth admin:supersecret# 4. Start on a custom port and bind to localhost only without opening browserrwarden dashboard up --port 8080 --host 127.0.0.1 --no-open# 5. Monitor a specific container by name or IDrwarden dashboard --container traefik# 6. Monitor an NGINX or Apache access log filerwarden dashboard --file /var/log/nginx/access.log# 7. Configure automated data retention, event row cap, and log rotationrwarden dashboard up --retention 30d --max-events 100000 --prune-interval 1h --max-log-size 50MB

When launched, rwarden dashboard starts an internal HTTP server and SSE stream on: 👉 http://localhost:7890


How Container Discovery Works ​

rwarden dashboard automatically inspects running Docker containers via /var/run/docker.sock and auto-tails any container labeled with routewarden=true or routewarden.logs=true:

services:  traefik:    image: traefik:v3.1    labels:      # Opt-in for Routewarden auto-discovery      - "routewarden=true"  caddy:    image: caddy:2-alpine    labels:      - "routewarden.logs=true"  nginx:    image: openresty/openresty:alpine    labels:      - "routewarden=true"

Containers with routewarden.logs=true are also automatically recognized. If multiple containers are discovered (e.g. traefik, caddy, and nginx), their log streams are multiplexed concurrently into the dashboard in real time with individual node attribution.


Standalone Docker Compose Deployment ​

If you prefer deploying the dashboard without the CLI binary, export the configuration and run with Docker Compose:

# Export dashboard configuration to local directoryrwarden dashboard export ./dashboardcd ./dashboard# Launch standalone SOC dashboard with Docker Composedocker compose up -d

Reverse Proxy Deployment (Traefik, Caddy, NGINX) ​

To expose Routewarden's security dashboard publicly with SSL/TLS, custom domains (soc.example.com), and proper Server-Sent Events (SSE) streaming configuration without buffering issues, follow the dedicated guide:

👉 Reverse Proxy Setup Guide — Complete configurations and Compose stacks for Traefik, Caddy, and NGINX.


Storage & Data Retention REST API ​

Routewarden exposes dedicated REST endpoints to inspect telemetry storage metrics and execute on-demand pruning and database compaction.

1. Get Storage Telemetry & Retention Policy (GET /api/v1/storage) ​

Queries live SQLite database file footprint, stored row counts, oldest/newest timestamps, active retention policy, and access log status:

curl -s http://localhost:7890/api/v1/storage

2. Trigger On-Demand Pruning & Compacting (POST /api/v1/prune) ​

Executes an immediate prune pass according to configured retention and maximum event capacity, followed by a SQLite VACUUM to compact database pages:

curl -s -X POST http://localhost:7890/api/v1/prune

Command Reference ​

Subcommand / FlagTypeDefaultDescription
up, startsubcommand—Launch real-time SOC security dashboard (default)
down, stopsubcommand—Stop running background dashboard daemon
status, pssubcommand—Display running status, PID, and URL of dashboard
export [dir]subcommand./dashboardExport compose and configuration assets to disk
-d, --detachboolfalseRun dashboard in background (detached) daemon mode
-a, --authstring""Optional HTTP Basic Auth credentials (user:password or RW_DASHBOARD_AUTH)
--userstring""Optional Basic Auth username (used with --password)
--passwordstring""Optional Basic Auth password (used with --user)
--hoststring""Host IP interface to bind (e.g. 127.0.0.1 or 0.0.0.0, default: all interfaces)
--portint7890Port for SOC dashboard UI and SSE stream
-f, --filestring""Log file to monitor (default: auto-discovered Docker containers)
-c, --containerstring""Tail a specific Docker container by name or ID
-l, --labelstring"routewarden=true"Docker label to filter containers
--dirstring~/.routewarden/dashboardWorking directory storing dashboard files
--no-openboolfalseDo not automatically launch the browser upon startup
--retentionstring"30d"Data retention window (30d, 7d, 48h, or 0 for unlimited)
--max-eventsint100000Maximum event row capacity before pruning (0 = unlimited)
--prune-intervalduration"1h"Background automated pruning frequency (1h, 30m)
--max-log-sizestring"50MB"Maximum access.log size before rotating to access.log.1

Environment Variables ​

VariableDefaultDescription
RW_RETENTION / RW_DASHBOARD_RETENTION30dCutoff age for retained events (30d, 7d, 48h, 0 = unlimited)
RW_MAX_EVENTS / RW_DASHBOARD_MAX_EVENTS100000Maximum rows retained in SQLite persistence
RW_PRUNE_INTERVAL1hFrequency of automated background prune supervisor
RW_MAX_LOG_SIZE50MBMaximum size of access.log before rotation to access.log.1
RW_DASHBOARD_AUTH""Dashboard authentication credentials (user:password)
RW_DASHBOARD_HOST""Default IP interface to bind
PORT7890Default listening port

Released under the MIT License.