Setting up the box
The quickest way onto a fresh vulnbox is the setup wizard. It installs vulnboxd, gives every service a git repository and a private GitHub or GitLab repository to push to, and writes the configuration for vulnboxd and for the traffic capture tools. The quick start is the short version of this page.
Prerequisites
- An x86_64 Linux box with systemd (other architectures: build it yourself).
- Docker with the compose plugin.
ssh-keygen, for the per-service deploy keys.- Optionally a GitHub token with repo access, or a GitLab token with the
apiscope, if the services should be pushed there.
Git itself is not required: vulnboxd drives the repositories through libgit2. You will probably want it on the box anyway, for working on services by hand.
Run the wizard
Unpack a release, and run the wizard from it. It installs both binaries on the box itself:
curl -fsSL https://gitlab.com/nirvati-ug/ctf-garden/vulnboxd/-/releases/permalink/latest/downloads/vulnboxd-x86_64-unknown-linux-gnu.tar.gz | tar -xz
export GITHUB_TOKEN=ghp_... # needs repo access; it is never written to disk
# or, for GitLab: export GITLAB_TOKEN=glpat-... # needs the api scope
sudo -E ./vulnboxd-x86_64-unknown-linux-gnu/vulnboxctl setup-interactiveThe wizard asks for:
| question | what it is for |
|---|---|
| services directory | one directory per service, each with a compose file |
| game | the game mode: GENERIC, FAUST_2026 or ECSC_2026 |
| team number, gameserver | your team on the gameserver, to read the checker's verdicts; only with a game |
| vulnbox address | this box's address, for the capture tools' config; the game's if left empty |
| tick length | how long a round lasts, such as 60s; only without a game, which knows its own |
| deploy window | the end of each tick vulnboxd restarts services in, such as 5s |
| flag format | the game's flags, which rules write as {flag}; the game's if left empty |
| alert webhook | a Discord webhook for alerts; the setup posts its own progress there too |
| bypass value | the header value that lets your team's requests skip every rule; a random one is made up |
| roll back automatically | whether vulnboxd undoes a change that breaks a service |
| health timeout, port check interval, failed checks before an alert | how patient the checks are |
| push to | github or gitlab, whichever the repositories go to |
| gitlab url | a GitLab of your own, such as https://gitlab.example.com; gitlab.com if left empty. Only for GitLab |
| repository owner, token | where the repositories go: a GitHub organisation or user, or a GitLab group, subgroup (team/services) or user. Leave the owner empty to push nowhere |
| repository prefix | put in front of each service's repository name, service- by default |
| ssh directory | where the per-service deploy keys are kept |
| capture config directory | where tulip.json and shovel.yaml are written |
| services file | optional: a plain list of every service listener — name, address, port — for tools that want to be told where the services are |
| capture traffic | run the PCAP-over-IP broker as its own service |
| capture served on, capture ports, capture filter | where readers connect, and what is captured; only with capture on |
| releases from, release repository, release gitlab url, release token | where vulnboxctl upgrade gets releases; the token only for a private repository |
| install and start vulnboxd | install the binaries, the unit and the compose guard, and start it; needs root |
Every question is pre-filled from the existing config, so a second run is mostly confirming the answers. Picking a game fills in its gameserver, and dims the questions that game answers itself.
↑ ↓ or Tab move between questions, typing edits, Space or ← → change a yes/no or a choice, Enter starts and Esc cancels. The mouse works too: click a question to select it, click it again to change a yes/no or a choice, scroll to move, and click Start or Cancel. If an answer does not add up (a directory that does not exist, a window longer than a tick, a game without a team) the wizard says so instead of starting.
Services are then prepared in parallel, each shown with its progress.
Without a game mode, set the tick start
A GENERIC config has tick.start: 1970-01-01T00:00:00Z. Set it to when the game actually began, so vulnboxd's restart windows line up with the real ticks. See Deploys.
Or script it
vulnboxctl init does the same without asking. It reads everything from the config file and the GITHUB_TOKEN or GITLAB_TOKEN environment variable:
sudo -E vulnboxctl init --installWithout --install it prepares the repositories and writes the configs, but leaves installing and starting the daemon to you.
What happens to each service
Every service goes through these steps, in order, and stops at the first that fails:
- git repository:
git initif it is not one already. - branch: rename the branch to
mainif it is something else. - large files: anything at or over
init.max_file_size(500 MiB) is added to.gitignorerather than failing the push later. - initial commit: commit the current state as
vulnboxd.
With a GitHub or GitLab owner and token, also:
- deploy key: an ed25519 key for this service alone, in the ssh directory.
- hosted repository: a private
service-<name>repository. On GitHub it goes in the organisation or, failing that, the user account; on GitLab in the group, subgroup or user named. The prefix isinit.repo_prefix, and a name that belongs to something else gets a number:service-web-2,service-web-3, and so on. - key on the host: the deploy key is added to that repository with write access. On GitLab,
mainis also protected with the deploy key allowed to push to it. GitLab protects the default branch after its first push, and a deploy key may only push to a protected branch it is named in, so without this every rollback push would be refused. Naming a deploy key in a branch's protection needs GitLab 18.10 or later on the Free tier; on an older GitLab, allow it by hand. - ssh access: the key is recorded in the repository, so
git pushby hand uses it too, along with the host keys (see below). - remote:
originis pointed atgit@github.com:<owner>/service-<name>.git, or the ssh address GitLab gives for the project. A remote that was there before is kept asorigin-before-vulnboxd. - push:
mainis pushed and set to track the remote.
Safe to run again
Every step looks before it acts, so a second run only does what is still undone. If one service fails, the others carry on, and the run ends with a list of what went wrong and a non-zero exit status. Fix the cause and run it again: only the failed service is touched.
The overview of each service
With a webhook set, init.webhook_url or the top-level webhook_url, the setup posts one message per service once every service has been prepared. A service that failed is described too:
| Repository | the origin it is pushed to, or that it is local only |
| Listeners | every public port, as published/transport → compose service:container port |
| Excluded from git | the files left out for being at or over init.max_file_size, with their size |
| Repository size | what the latest commit holds, in bytes and files, and what .git takes on disk with its history |
| Languages | what the committed code is written in, by share of its bytes. Worked out with the linguist crate, which carries the language list, content heuristics and vendored-code patterns of GitHub Linguist but is not Linguist itself: a file is known by its modeline, name, extension or those heuristics, and a script with no extension by its shebang. Only programming and markup languages count, each under its group (TSX as TypeScript). Vendored code, anything under one percent, and a file still ambiguous after all that are left out, where GitHub's classifier would guess; so the shares can differ a little from GitHub's language bar |
Working out the languages gets ten seconds per repository. For the first five, each file's content is looked at; after that, the files left are judged by name alone, and past ten seconds the rest are not counted. Either way the message says the languages are partial.
Each message goes out after the one before, so they arrive in the order the services are listed. If Discord asks it to slow down, it waits as long as Discord says, up to ten seconds, and tries again.
Somewhere other than GitHub or GitLab
GitHub and GitLab are what init can create repositories and deploy keys on. Any other remote works, you just do that part yourself: leave init.github_owner and init.gitlab_owner empty, and the setup makes each service a git repository locally without pushing it anywhere. Add your own origin afterwards and vulnboxd polls it like any other.
For authentication it uses the deploy key for that service if there is one, and otherwise whatever ssh would use, including an agent. A service that already has an origin keeps it.
Host keys
A fresh vulnbox knows no ssh hosts, so the first connection to GitHub or GitLab would normally be a question nobody is there to answer: the daemon refuses it outright (invalid or unknown remote ssh hostkey) and the git cli would wait for a yes.
vulnboxd carries the host keys of GitHub and of gitlab.com, so it recognises both without being told. Each key is only believed from the host it belongs to. Nothing else is taken on trust: on a game network, where every other team is a neighbour, accepting whatever key is offered the first time is exactly what you do not want.
Setup also writes them to <ssh_dir>/known_hosts and points each service's core.sshCommand at it, and at root's ~/.ssh/known_hosts, with StrictHostKeyChecking=yes. Pushing by hand verifies the host the same way and still needs no yes.
A GitLab of your own has keys vulnboxd cannot carry. Put them in root's ~/.ssh/known_hosts before running the setup, having checked them against what the GitLab's admins publish:
ssh-keyscan gitlab.example.com | sudo tee -a /root/.ssh/known_hosts
sudo ssh-keygen -lf /root/.ssh/known_hosts # compare the fingerprintsGitHub and GitLab rotate their keys rarely and announce it when they do. If one has, pushes stop with an unknown host key until vulnboxd is upgraded; adding the new key to ~/.ssh/known_hosts also works, since any host vulnboxd does not carry keys for is looked up there as usual.
After setup
Once vulnboxd is running it takes over the services at the end of the next tick. That moves every public port behind the proxy and recreates the containers, which costs a few seconds of downtime once. After that:
- Each service has a
vulnboxd-rules.yml, committed and pushed. Edit it through git or on the box; see Rules. - Use
vulnboxctl compose <service> ...instead ofdocker compose; see Day-to-day operation. - Watch it with
vulnboxctl top.
Checking it worked
systemctl status vulnboxd
vulnboxctl topIn the first window you should see one deploy per service and then nothing: ports answering, rules loaded, no rollbacks. journalctl -u vulnboxd | grep -i warn is the quickest way to find anything it did not like — a rules file that would not load, a port the compose file does not publish.