Watching with metrics
vulnboxd serves Prometheus metrics on http://127.0.0.1:9330/metrics. This is also what vulnboxctl top reads.
Keep it on localhost
The metrics say which of your rules are firing, which is exactly what an attacker would like to know. Leave metrics bound to 127.0.0.1, and reach it over your team's own network or an ssh tunnel.
During a game, the quickest look is:
curl -s localhost:9330/metrics | grep rule_hitsThe one to watch
vulnboxd_rule_hits_total counts every time a rule fires, labelled with the service, port, rule name and what it did: blocked, stalled, rewritten, or matched for a rule set to action: log. That last one lets you see what a rule would have blocked before you let it.
vulnboxd_rule_hits_total{action="blocked",port="8080",rule="scanners",service="web"} 1432
vulnboxd_rule_hits_total{action="matched",port="8080",rule="watch logins",service="web"} 87Everything else
See the metrics reference for the full list. The ones worth a panel:
vulnboxd_sla_upis whether the checker found each service working in the latest tick, which is the one number that says whether you are scoring. With no game mode there is nothing to ask, so it is absent rather than zero.vulnboxd_flags_out_last_tickis how many flags left the box in the last tick. Your checker's reads make a steady baseline; a rise above it is someone's exploit working.vulnboxd_http_responses_total{class="5xx"}climbing means a service is unwell, or a rule is breaking requests.vulnboxd_upstream_errors_totalmeans the proxy could not reach the service at all.vulnboxd_deploy_msis how long the last deploy took; it should stay well under the window.vulnboxd_builds_total{result="failed"}andvulnboxd_git_polls_total{result="failed"}mean a new version is not going to arrive.vulnboxd_bypassed_totalclimbing while nobody on your team is testing means your bypass value has leaked.vulnboxd_mirror_totalshows whether a mirrored rewrite agrees with the real service.
The hub has metrics of its own, for whether the agent is connected and assembly keeps up; see hub metrics.
Grafana
contrib/grafana/vulnboxd.json is a ready-made dashboard, also in every release:
- Overview: services, whether the gameserver answers, open connections, rule hits and flags per tick with their trend, how many ports and services are down, and rollbacks. A tile turns red or amber only when something is wrong.
- Health: which ports answered their checks, and the checker's verdicts, over time.
- Traffic: connections, throughput (into the service above the axis, back out below it), HTTP responses by class, and requests the service never got.
- Rules: hits per rule and action, the busiest rules, stalled connections, bypassed requests, mirror comparisons. Actions keep one colour throughout: blocked red, stalled purple, rewritten amber, matched blue.
- Flags: flags that went out in each tick, and the total per service and port over the time range.
- Deploys: how long the last deploy took against the window, deploys and builds (ok green, failed red) and rollbacks.
Deploys and rollbacks are also marked on every graph. A filter at the top narrows it to some services.
To use it, point a Prometheus at vulnboxd. The metrics stay on localhost, so run Prometheus on the box itself, or reach them through an ssh tunnel:
scrape_configs:
- job_name: vulnboxd
scrape_interval: 5s
static_configs:
- targets: ["127.0.0.1:9330"]Then, in Grafana, go to Dashboards → New → Import, upload vulnboxd.json and pick that Prometheus.
To change the address, or turn metrics off:
metrics: 127.0.0.1:9330 # or null to disableDebugging vulnboxd itself
vulnboxd, vulnboxd-agent, vulnboxd-pcap and vulnboxd-sensor also report on their own insides: memory, the async runtime, every long-running loop by name, and the internals of the proxy, Git, deploys, the agent's uplink and spool, the capture, and the sensor. None of it matters during a normal game; it is what to look at when something is stuck, slow or growing. Each serves its own, on localhost:
| process | address | config key |
|---|---|---|
| vulnboxd | 127.0.0.1:9330 | metrics |
| vulnboxd-agent | 127.0.0.1:9331 | agent.metrics |
| vulnboxd-pcap | 127.0.0.1:9332 | pcap.metrics |
| vulnboxd-sensor | 127.0.0.1:9333 | sensor.metrics |
null turns one off, and --metrics <ADDR> on the command line overrides the config. Next to /metrics, each serves /debug/tasks, which lists every loop with what it is doing, what it waits on, when it last got anything done and how it last failed:
curl -s localhost:9331/debug/tasks | jq '.[] | {name, state, waiting_on, since_progress_seconds, last_error}'contrib/grafana/vulnboxd-internals.json, also in every release, puts it on one dashboard. It needs them scraped, with these job names (the sensor only when it runs):
scrape_configs:
- job_name: vulnboxd
scrape_interval: 5s
static_configs:
- targets: ["127.0.0.1:9330"]
- job_name: vulnboxd-agent
scrape_interval: 5s
static_configs:
- targets: ["127.0.0.1:9331"]
- job_name: vulnboxd-pcap
scrape_interval: 5s
static_configs:
- targets: ["127.0.0.1:9332"]
- job_name: vulnboxd-sensor
scrape_interval: 5s
static_configs:
- targets: ["127.0.0.1:9333"]Its rows, top to bottom:
- Overview: how long each process has been up and how often it restarted, whether Prometheus reaches it, and its memory, heap, CPU, file descriptors and threads side by side. vulnboxd is blue, the agent purple, the broker orange and the sensor yellow throughout.
- Memory: per process, resident memory against what the heap holds, what it has freed but kept, and its large mapped allocations. Resident memory far above "heap in use" with a large "heap free" is the allocator holding on, not a leak.
- Tokio: alive async tasks (a steady climb is a task leak), the queue of tasks waiting for a worker, how busy the workers are, and how often they sleep.
- Tasks: a table of every named loop of all four processes with its state, how long since it last made progress, and its restarts. A loop that says it is running or waiting but has made no progress turns amber after a minute and red after five: that is a stuck loop. Idle loops are waiting for work and stay green. Beside it, the same over time, restarts, and loops that failed or panicked.
- Proxy: connections and bytes buffered in flight, how long reaching the service takes, the HTTP connection pool and how often it is reused, how long rules take to evaluate, and the queue and writes of the rule-hit log the agent follows. The service filter at the top applies here.
- Git & deploys: Git operations by kind with their duration and failures, waits for the checkout lock the agent and vulnboxd share and how often one timed out, deploy steps and each service's deploy state, docker compose commands, the main loop's duration and lag, gameserver requests, webhook alerts, and upgrade handovers.
- Agent uplink & spool: whether the agent is connected to the hub, frames and bytes each way, why connections ended, how long the hub takes to acknowledge, what is waiting to be sent, what the spool holds against its budget and what it had to drop, disk latency, rule pushes step by step, and how far the agent is behind on vulnboxd's rule-hit log.
- Capture & pcap: whether the broker is capturing, its readers, packets and bytes captured, relayed and read by the agent, how far its readers are behind, and the agent's own capture backlog and segments.
Every new metric is listed in the metrics reference.