Runtime hooks
vulnboxd's sensor sees every process, connection and file a service touches, straight from the kernel. What the kernel cannot tell is which request a syscall belonged to when one thread serves many requests in turn: an asyncio or Node event loop, goroutines, a JVM thread pool. A runtime hook fills exactly that gap. It reports a few small facts — "request 3 on the connection from 10.0.0.7:51234 starts now", "this request started child process 4711", "this request opened a connection from local port 39012" — and the sensor joins them with what the kernel saw, so a flow in the hub shows the shell command, the database query or the file write it caused.
Where the kernel already links requests exactly — a process or a thread per connection, PHP-FPM, CGI, forking servers — you need no hook at all; a hook there only adds request boundaries on keep-alive connections.
You rarely add one by hand. The hub reads each service's files, recognises each container's runtime and proposes the hook as a change; a player reviews it and approves it, and vulnboxd commits and deploys it (Hook proposals). Nothing is ever added automatically. Where the hub cannot do it, the cheat sheets show the steps, and local development covers running a hook on your own machine.
Which package for my service
Pick the row that matches how your service runs. Every package tries the least invasive way first: zero-code (nothing changes), compose-only (a read-only mount and an environment variable; image and source untouched), config-only (a mounted config file), and only then a source change.
| Your service | Package | How it gets in | Status |
|---|---|---|---|
| Any Python service (the base every Python package builds on) | P1 | compose-only (PYTHONPATH) | ready |
| Python WSGI: gunicorn, waitress, CherryPy/cheroot, Werkzeug; Flask, Django, Bottle, Pyramid, Falcon (uWSGI, bjoern, meinheld, mod_wsgi: kernel) | P2 | compose-only | ready |
| Python ASGI: uvicorn, hypercorn, daphne, granian; FastAPI, Starlette, Django ASGI, Quart, Litestar | P3 | compose-only | ready |
aiohttp, Sanic, Tornado, Twisted, raw asyncio servers, trio/anyio | P4 | compose-only | ready |
| gevent / eventlet, gunicorn's gevent and eventlet workers | P5 | compose-only | ready |
Python socketserver, hand-rolled select loops | P6 | kernel (forking/threading); source change (select loops) | ready |
| Python C-level clients: psycopg, mysqlclient, hiredis, pycurl (optional precision) | P7 | compose-only | ready |
| Any Node.js service | N1 | compose-only (NODE_OPTIONS) | ready |
Express, Koa, Fastify, Hapi, NestJS, Next.js, Nuxt, Restify, Sails, Remix, AdonisJS, http2 | N2 | compose-only (with N1) | ready |
ws, Socket.IO, net/tls and dgram servers (not uWebSockets.js) | N3 | compose-only (with N1) | ready |
| Bun | N4 | config-only (bunfig.toml) or compose-only | ready |
| Deno | N5 | compose-only (--preload, Deno ≥ 2.4) or source change | ready |
| Go services, unchanged: net/http (HTTP/1, HTTP/2), x/net/http2, gRPC, fasthttp, fiber; Go 1.17–1.26 | G1 | zero-code | ready |
| Go services you can rebuild (any binary, stripped too): net/http, chi, gorilla/mux, echo, gin, fasthttp, fiber, gRPC | G2 | source change (vendored module) | ready |
| Rust on tokio: axum, hyper, actix-web, warp, rocket, poem, salvo, tonic | R1 | source change (vendored crate) | ready |
| Rust on async-std/tide, smol, may, std threads, glommio/monoio | R2 | kernel (threads); source change | ready |
| Any JVM service (Java, Kotlin, Scala, Clojure) | J1 | compose-only (JAVA_TOOL_OPTIONS) | ready |
| Tomcat, Jetty, Undertow, Spring MVC/Boot, Javalin, Spark, Dropwizard, Clojure Ring | J2 | compose-only | ready |
| Netty, Spring WebFlux, Vert.x, Quarkus, Micronaut, Ktor (Netty, CIO), Helidon 4 | J3 | compose-only | ready |
| Kotlin coroutines | J4 | compose-only | ready |
.NET 6–10: Kestrel, ASP.NET Core minimal APIs, MVC, gRPC, SignalR; raw TcpListener and Native AOT apps | D1 | compose-only (DOTNET_STARTUP_HOOKS); source change (TcpListener, trimmed/AOT) | ready |
| Ruby: Puma, Unicorn, Falcon, Thin; Rails, Sinatra, Roda, Hanami, Grape | Y1 | compose-only (RUBYOPT) | ready |
PHP-FPM, mod_php, php -S, CGI | H1 | kernel (optional config-only: conf.d ini) | ready |
| Swoole, OpenSwoole, RoadRunner, FrankenPHP, ReactPHP, Amp, Workerman | H2 | config-only (conf.d ini) + one-line source change (FrankenPHP classic: config-only) | ready |
| Perl: Mojolicious, AnyEvent, Twiggy, Plack (CGI and prefork: kernel) | L1 | compose-only (PERL5OPT) | ready |
| OpenResty, nginx with Lua | L2 | config-only (nginx include) | ready |
| Standalone Lua: lua-http, Copas (Luvit: not supported) | L3 | compose-only (LUA_INIT) | ready |
| Erlang / Elixir: Cowboy, Phoenix, Bandit, Plug, ranch | E1 | compose-only (ERL_AFLAGS) | ready |
| C / C++: forking and thread-per-connection (kernel); epoll/poll loops, libevent, libev, libuv, Mongoose, CivetWeb, Boost.Asio/Beast, cpp-httplib, Crow, Drogon, Pistache, Seastar (hook) | C1 | source change (vendored vbxhook) | ready |
| Zig, Nim, Crystal, D, Odin, V | C2 | source change | ready |
| Swift, Dart, Kotlin/Native | C3 | source change | ready |
| Haskell, OCaml, Scala Native, Julia, R | C4 | source change | ready |
Shell scripts, CGI, socat EXEC:, ncat --exec | X1 | kernel (no hook) | ready |
| WebAssembly hosts: wasmtime, wasmer, WasmEdge, Spin | X2 | source change in the host (R1 / C1) | ready |
All packages are ready: each has sample services that pass the event, chaos and baseline checks of the test harness, a proposal (or a cheat sheet where the change is in the source), and a page here. Each page lists the package's known gaps.
The shared pieces everything above builds on are the core library vbxtrace every package reports through, the sensor side that finds the probes and joins hook events with kernel events, the hub's proposals (format), and the test harness.
How it gets in
vulnboxd keeps the hook files on the vulnbox in /usr/local/lib/vulnboxd/trace/. Nothing is installed into your containers or images. When the hub recognises a service's runtime, it proposes a change you approve and push like a rule change:
- for interpreted and VM runtimes, a compose change: a read-only mount of the hook directory at
/opt/vbxtraceand the runtime's startup variable (PYTHONPATH,NODE_OPTIONS,JAVA_TOOL_OPTIONS, …), appended to any value it already has; - for Go binaries with symbols, nothing at all;
- for compiled languages without another way in, a source diff that vendors the hook into the service directory, so the build needs no internet.
The hub proposes per container (compose service): a repository with an API, a frontend and a worker in three languages gets three proposals, approved together and committed one per container, so one container's hook can be reverted alone. Containers the kernel already covers (databases, plain nginx) get none. Where the hub cannot tell, or cannot make the change itself, the cheat sheets show how to add a hook by hand.
In the hub, a service's Runtime hooks page lists each container with its decision and lets you review and approve the change: see Hook proposals.
What a hook reports
Every package reports the same events, as probes in the core library:
| Event | When | What the sensor joins it on |
|---|---|---|
request_begin / request_end | a request (HTTP) or session (raw TCP) starts / ends | the accepted socket's peer address and port, and the request's number on that connection (or "unknown"¹) |
spawned | after a child process started | the child's pid |
connected | after an outgoing connection is established | the socket's local port |
opened | after a file is opened | the process and the file descriptor |
context_enter / context_exit | a thread picks up / puts down work the runtime does not track itself | the thread |
handoff | work moves to a task the runtime does not carry the request to | the two request ids |
¹ Some servers do not tell a hook which connection or keep-alive request it is handling (Bun.serve, Deno.serve, uWebSockets.js, some PHP and .NET setups). Their hooks report the request's number as unknown (VBX_REQUEST_INDEX_UNKNOWN, 0xFFFFFFFF). vulnboxd then links such a request to a connection only through other exact facts, such as the connections the sensor saw the process accept and which only that request can own, or not at all. It never guesses.
A hook carries only these small numbers: never request contents, headers, paths, arguments or file data. Everything else comes from the kernel. Nothing is added to your traffic.
Safety promises
A hook runs inside your service, so every package makes the same promises:
- Nothing to fail at run time. Each event is a USDT probe: a single no-op instruction the sensor attaches to. There is no socket, buffer, thread, allocation or I/O in the hook path. Without the sensor attached, a hook does nothing beyond checking that nobody listens.
- Loads anywhere. The core library has no libc dependency, no constructors, no thread-local storage and no global state beyond a counter, so one file per architecture (x86_64, aarch64) loads under glibc, musl (Alpine) and in distroless images.
- Never changes behaviour. Every wrapped call is guarded; a hook never changes arguments, return values, exceptions or timing beyond a constant. After a handful of internal errors it switches itself off for the process. Every package is tested with the core forced to fail, and its sample services' responses must stay byte-identical.
- Cheap. A fired probe costs a few microseconds and fires per request, spawn, connection or file open — not per syscall. Each package measures its overhead on its sample services.
- Easy to turn off. Set
VBXTRACE=0in the service's environment to switch a hook off without a rebuild, or revert the change that added it; vulnboxd's rollback covers a hook that breaks a service.
Checking the probes
The probes are standard SystemTap SDT probes, provider vbxtrace, so standard tools list them:
readelf -n /usr/local/lib/vulnboxd/trace/libvbxtrace-x86_64.so
sudo bpftrace -l 'usdt:/usr/local/lib/vulnboxd/trace/libvbxtrace-x86_64.so:*'