Command line
vulnboxd comes as four binaries on the vulnbox:
vulnboxdis the daemon. systemd runs it; you rarely start it by hand.vulnboxctlis everything else: installing, setting up a box, upgrading, running compose for a service, rolling back and watching.vulnboxd-pcapis the capture broker, which runs as its own service.vulnboxd-agentis the traffic analysis agent, which runs as its own service too.
vulnboxd-hub, the hub the agent talks to, runs on your team's cluster instead.
vulnboxd and vulnboxctl take the same options:
| option | |
|---|---|
-c, --config <FILE> | config file (default /etc/vulnboxd/config.yml); defaults are used if it does not exist |
--services-dir <DIR> | overrides services_dir from the config file |
-h, --help | print help |
-V, --version | print the version |
vulnboxd-pcap and vulnboxd-agent take -c, -h and -V, but not --services-dir.
Log verbosity is set with the RUST_LOG environment variable, for example RUST_LOG=debug. The default is info.
vulnboxd
sudo vulnboxd -c /etc/vulnboxd/config.ymlRuns the daemon: discovers services, deploys them, proxies their ports and watches them. See How it works.
vulnboxd-pcap
vulnboxd-pcap [-c <FILE>] [--cmd <COMMAND>] [--listen <ADDR>] [--metrics <ADDR>]Captures traffic and serves it over PCAP-over-IP, using the config's pcap section. systemd runs it as vulnboxd-pcap; you rarely start it by hand. See Capturing traffic.
| option | |
|---|---|
--cmd <COMMAND> | capture command, instead of the config's. Also read from PCAP_COMMAND |
--listen <ADDR> | where readers connect, instead of the config's. Also read from LISTEN_ADDRESS |
--metrics <ADDR> | where to serve its own metrics and debug pages, instead of the config's pcap.metrics (127.0.0.1:9332); keep it on localhost. Also read from VULNBOXD_PCAP_METRICS |
The two environment variables are the ones fox-it's pcap-broker reads, so a unit written for that one works here. With pcap.interfaces it runs one tcpdump per interface and serves them merged as LINUX_SLL2; --cmd goes back to a single capture command of your own.
vulnboxd-agent
vulnboxd-agent [-c <FILE>] [--metrics <ADDR>]
vulnboxd-agent keygen <DIR>Sends the capture and vulnboxd's state to the hub and applies its rule pushes, using the config's agent section; the rest of the config tells it where vulnboxd keeps what it reports. systemd runs it as vulnboxd-agent. It refuses to start while agent.enabled is off. See Setting up the agent.
--metrics <ADDR> (or VULNBOXD_AGENT_METRICS) serves the agent's own metrics and debug pages there, instead of where the config's agent.metrics says (127.0.0.1:9331); keep it on localhost.
keygen writes a new certificate and key for the agent into DIR, as agent.crt and agent.key, the key readable by its owner only. Give the hub the certificate; the key stays on the box. It refuses to replace either file, since the hub is pinned to the old certificate: move them away first if you mean to.
sudo vulnboxd-agent keygen /etc/vulnboxdvulnboxd-sensor
vulnboxd-sensor [-c <FILE>] [--metrics <ADDR>] [--stdout] [--cgroup <PATH>]... [--trace-all] [--force]
vulnboxd-sensor listen [<SOCKET>]Records what the services' processes do, with eBPF, and sends it to the agent, using the config's sensor section and its state_dir and services_dir. Runs as root. systemd runs it as vulnboxd-sensor; it refuses to start while sensor.enabled is off unless given --force. See The host sensor.
--metrics <ADDR>(orVULNBOXD_SENSOR_METRICS) serves its metrics and debug pages there instead of atsensor.metrics(127.0.0.1:9333).--stdoutprints the events as JSON lines instead of sending them to the agent.--cgroup <PATH>watches another cgroup as well, relative to/sys/fs/cgroupor absolute.--trace-allwatches every process on the box, for trying it out; never during a game.
listen listens on the agent's socket (the config's, or SOCKET) and prints what a sensor sends, one JSON event per line: the agent's part, for looking at the sensor without one.
vulnboxctl setup-interactive
vulnboxctl setup-interactiveThe same as init, with a terminal wizard that asks for every setting first and shows each service's progress. Needs an interactive terminal.
export GITHUB_TOKEN=ghp_... # or GITLAB_TOKEN=glpat-... for GitLab
sudo -E vulnboxctl setup-interactivevulnboxctl init
vulnboxctl init [--install]Prepares a vulnbox without asking anything: a git repository per service, pushed to a private GitHub or GitLab repository with its own deploy key, the capture tools' configuration, and vulnboxd's own config. It reads its settings from the config file and the token from GITHUB_TOKEN or GITLAB_TOKEN.
| option | |
|---|---|
--install | also install and start vulnboxd, as vulnboxctl install does |
Safe to run again: it only does what is left, and a failed service can be fixed and retried without touching the others. Exits non-zero if any service failed. See Getting started for the steps.
vulnboxctl install
vulnboxctl install [OPTIONS] [SERVICES_DIR]Installs vulnboxd on this box: both binaries into /usr/local/bin, a config for the services directory, the systemd unit and the compose guard, then starts it and checks it came up. Needs root.
| option | |
|---|---|
SERVICES_DIR | one directory per service, each with a compose file; defaults to the config's, or /srv |
--tick <DURATION> | tick length of the game, such as 60s |
--window <DURATION> | the end of each tick vulnboxd restarts services in, such as 5s |
--poll <DURATION> | how often git is checked for new commits |
--no-start | install everything, but do not start vulnboxd yet |
--force | replace an existing config |
The positional SERVICES_DIR and the global --services-dir do the same thing; the positional one wins if both are given.
Run it again to repair an installation. An existing config is kept unless --force is given.
It also says whether the Docker daemon answers on its socket, and which version it is (a warning when it does not answer, or speaks an API older than 1.41); see docker.
vulnboxctl upgrade
vulnboxctl upgrade [FROM]... [--now] [--pcap] [--version <TAG>] [--repo <OWNER/NAME>]Installs a new build and asks the running daemon to take it up, which it does without closing a port. Needs root. See Upgrading.
FROM is a release archive, a directory holding the build, or the binaries themselves under any name — they are identified by what they answer to --version. With no FROM it fetches a release from GitLab, or from GitHub if upgrade.from says so, and checks it against its SHA-256.
| option | |
|---|---|
--now | take the new build up as soon as nothing is being deployed, rather than at the end-of-tick window |
--pcap | replace vulnboxd-pcap too, which restarts it and interrupts the capture |
--version <TAG> | release to fetch; the latest by default. Only when fetching a release |
--repo <PATH> | repository to fetch from, instead of the config's upgrade.repo: the project's path on GitLab, or owner/name on GitHub |
A private repository needs a token that can read it, in upgrade.token or the VULNBOXD_UPGRADE_TOKEN environment variable.
vulnboxctl compose
vulnboxctl compose <SERVICE> [ARGS]...Runs docker compose for a service with vulnboxd's port override applied, passing every argument after the service name through. The service's own compose files (its override, or what COMPOSE_FILE names) are passed first, as compose would find them, and vulnboxd's override last. It replaces itself with docker compose, so the terminal, exit status and Ctrl+C behave exactly as they would with docker compose itself.
sudo vulnboxctl compose web ps
sudo vulnboxctl compose web logs -f --tail 100
sudo vulnboxctl compose web exec app shvulnboxctl rollback
vulnboxctl rollback <SERVICE>Undoes the latest change to a service, its code or its rules, whichever came last, with a commit that is pushed. The running daemon picks it up like any other change: rules within a second, code at the end of the tick. Running it twice undoes the rollback. See Rollback.
vulnboxctl allow-compose
vulnboxctl allow-compose <SERVICE> [CODE]Shows, and allows, a compose change the daemon held back because it grants containers more than the deployed version. Without a code it lists what the change adds and prints its code (exit code 1 while something is waiting; with nothing waiting it lists what the deployed version grants). With the code, exactly that list is allowed, and the daemon builds the change at once and deploys it in the next window. A list that changed since is refused, and so is a wrong code. The approval is kept in the service's state directory (compose-allowed.json, root only) and is cleared once the change is deployed.
vulnboxctl git-remote
vulnboxctl git-remote <SERVICE> [URL]Shows the remote vulnboxd fetches the service from and pushes it to (its own record in <state_dir>/git-remotes.json) next to what .git/config says. With a URL it records the new address and sets the repository's git.remote to it as well. vulnboxd ignores edits to .git/config made any other way. See what vulnboxd does not take from the repository.
vulnboxctl bisect
vulnboxctl bisect <SERVICE> [start|stop|show] [--good <COMMIT>] [--bad <COMMIT>] [--json]Finds the commit that broke a service among those since the version that worked, by deploying versions in between, and reverts only that one. See Bisecting.
show (the default) | where the service's bisect is, or how the latest one ended; --json prints bisect.json |
start | start one: the version that worked goes back first, then the search runs. --good and --bad say between which commits; by default, what the latest rollback went between, or the version that worked and what runs |
stop | stop one; the newest version it found working goes back |
start and stop leave a request for the running daemon and wait up to five seconds for its answer, printing it (exit code 1 when it refused, or did not answer).
vulnboxctl top
vulnboxctl topAlias: vulnboxctl dashboard.
A terminal dashboard of the running daemon: services, ports and whether they answer, open connections and how often each rule fires. A compose service on the host network shows as <service>: HOST NETWORK in red among the ports: nothing of it is behind the proxy (see services on the host network). ↑/↓ select a service, r refreshes, q quits.
It reads the daemon's metrics endpoint, so it needs metrics left on; with metrics: null there is nothing for it to read.
vulnboxctl inventory
vulnboxctl inventory [--json]Prints the container inventory the daemon keeps in <state_dir>/inventory.json: the host interfaces the capture sees (by interface index), and for every service how each proxied port reaches its container (docker-proxy or dnat), and each container's cgroup, process, networks with their bridges, published ports, mounts and root filesystem. A container on the host network shows net host (the host's own network: …): it is not behind the proxy, and every port it listens on is public. --json prints the file as it is. A file left by a daemon that is no longer running is still shown, with a note that it may be out of date.
vulnboxd-hub
vulnboxd-hub <ingest | assemble | api | migrate | keygen <DIR>>The hub, one binary and one container image with a subcommand per part. The Helm chart sets all of this for you; the flags matter when you run it some other way. Every flag can also be given as the environment variable next to it.
| subcommand | |
|---|---|
ingest | receives the capture and vulnboxd's state from the agent, and delivers rule pushes to it. Run exactly one |
assemble | assembles stored segments into flows |
alert | learns each service's baseline and raises alerts on what falls outside it. Run exactly one |
api | serves the API and the web UI |
migrate | creates or updates the ClickHouse schema, and exits |
keygen <DIR> | writes a new certificate and key for the hub, hub.crt and hub.key, into DIR. Refuses to replace a pair that is there already |
Every subcommand except keygen takes these:
| option | environment | default | |
|---|---|---|---|
--clickhouse-url | HUB_CLICKHOUSE_URL | http://127.0.0.1:8123 | ClickHouse's HTTP interface |
--clickhouse-user | HUB_CLICKHOUSE_USER | default | |
--clickhouse-password | HUB_CLICKHOUSE_PASSWORD | empty | |
--clickhouse-database | HUB_CLICKHOUSE_DATABASE | vulnboxd | |
--storage | HUB_STORAGE | file:///var/lib/vulnboxd-hub/segments | where raw segments are kept: file:///<directory>, or s3://<bucket>/<prefix> with the usual AWS_* variables for any S3-compatible store (AWS_ENDPOINT for one that is not Amazon's, AWS_ALLOW_HTTP=true for one without TLS) |
--metrics | HUB_METRICS | none | where Prometheus metrics are served, such as 0.0.0.0:9100. ingest, assemble and api serve their own metrics |
ingest
| option | environment | default | |
|---|---|---|---|
--listen | HUB_INGEST_LISTEN | 0.0.0.0:7443 | where the agent connects. Ignored with --dial |
--dial | HUB_INGEST_DIAL | connect out to an agent in listen mode at this host:port instead | |
--cert | HUB_CERT | the hub's certificate, PEM. Required | |
--key | HUB_KEY | the hub's key, PEM. Required | |
--agent-cert | HUB_AGENT_CERT | the agent's certificate, the only one accepted. Required | |
--window | HUB_INGEST_WINDOW | 32 | segments the agent may send ahead of acknowledgements |
--relay-listen | HUB_INGEST_RELAY_LISTEN | the internal port the API reaches the agent through, for containers and shells; keep it inside the cluster. None turns them off | |
--relay-token | HUB_RELAY_TOKEN | the relay's secret, at least 16 characters, the same as the API's. Required with --relay-listen |
assemble
| option | environment | default | |
|---|---|---|---|
--rewind | HUB_ASSEMBLE_REWIND | 300 | seconds of capture before the checkpoint read again on start, to rebuild the connections that were open |
--from-seq, --to-seq | reprocess this range of stored segments and stop, rather than following new ones; the rows written replace the old ones, which is also how data stored before anomaly detection existed (or while it was off) gets analysed | ||
--anomaly-detection | HUB_ANOMALY_DETECTION | auto | HTTP anomaly detection: auto follows the hub's anomaly_detection setting (changed in the UI or with PUT /api/settings, read again every 30 s), on and off override it for this assembler |
alert
| option | environment | default | |
|---|---|---|---|
--delay | HUB_ALERT_DELAY | 30 | seconds the alert worker stays behind the linker's join pass and the clock, for links written when the linker reads its window again |
api
| option | environment | default | |
|---|---|---|---|
--listen | HUB_API_LISTEN | 0.0.0.0:8080 | |
--ui | HUB_UI | /usr/share/vulnboxd-hub/ui | the built web UI, served at / |
--auth | HUB_AUTH | oidc | oidc: the hub signs users in against an OpenID Connect issuer. proxy: an authenticating proxy in front sets the user header |
--user-header | HUB_USER_HEADER | X-Forwarded-User | the header the user's name is passed in. With oidc the hub sets it and drops any a client sent; with proxy the proxy must |
--public-url | HUB_PUBLIC_URL | the hub's external base URL, such as https://hub.example.org. The issuer sends users back to <public-url>/auth/callback, and only this origin may make changes. Required with oidc; with proxy it turns the same origin check on | |
--oidc-issuer | HUB_OIDC_ISSUER | the issuer, such as https://dex.example.org; its discovery document is read at start | |
--oidc-client-id | HUB_OIDC_CLIENT_ID | ||
--oidc-client-secret | HUB_OIDC_CLIENT_SECRET | ||
--oidc-scopes | HUB_OIDC_SCOPES | openid profile email groups | separated by spaces |
--oidc-username-claim | HUB_OIDC_USERNAME_CLAIM | email | the ID token claim users are named by; taken as it is. When it is missing, the verified email, or else the first of preferred_username, name and sub qualified with the claim's name, such as name:Alice |
--oidc-allowed-groups | HUB_OIDC_ALLOWED_GROUPS | only members of one of these groups may sign in, comma separated | |
--oidc-allowed-emails | HUB_OIDC_ALLOWED_EMAILS | only these addresses, with email_verified true, may sign in, comma separated. With both lists empty anyone the issuer authenticates may; with both set, either suffices | |
--session-key | HUB_SESSION_KEY | the secret sessions are sealed with, at least 32 bytes, such as openssl rand -base64 48. Required with oidc. Changing it signs everyone out | |
--session-ttl | HUB_SESSION_TTL | 12h | how long a sign-in lasts |
--relay | HUB_RELAY | ingest's relay, host:port, for containers and shells. None leaves the Containers screen with the inventory alone | |
--relay-token | HUB_RELAY_TOKEN | the relay's secret, the same as ingest's | |
--shell-idle | HUB_SHELL_IDLE | 15m | how long a shell may go without input (the agent's shell_idle caps it) |
--shell-sessions-per-user | HUB_SHELL_SESSIONS_PER_USER | 4 | shells one user may have open at once, per API replica |
--adminer-origin | HUB_ADMINER_ORIGIN | the separate origin Adminer is served on, such as https://adminer.hub.example.org: a second host name for the API, never the hub's own. None turns Adminer off |
/healthz answers without a session, for probes.