Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/heimdall

HISTORY.md

Heimdall: history and details

Heimdall was first built for one job only: to inspect untrusted data safely. Short sandboxed jobs parse, verify or scan the data and hand back a signed result. It has since grown into a general system-call filter for programs and services. The static filter is released. The graph filter works for pure Rust programs: a program runs under a filter that follows it call by call, made from the program's build alone.

The filters

All filters work at the same place: the kernel checks every system call of the program when the call enters the kernel (Linux seccomp). They differ in how the filter is made and in what it knows about the program. Two exist: the static filter (released) and the graph filter (works for pure Rust programs, not released yet). A third, the call-site filter, is not built as a filter of its own: alone it adds little, because an attacker can jump to the real wrapper of the call they want. The program counter is worth it only inside the graph filter, where it tells the follower which call site made the call.

The in-kernel follower (November 2026)

The in-kernel follower exists on main (not released yet). In disposable VMs (Ubuntu kernels 6.8.0-139 and -142), the complete generated graph of a profiled example program (A {B C D}* F) runs under Enforce with 0 kills, a call made in an order the graph forbids is killed while the static filter allows it, and the follower adds a median +131.5 ns per call over the identical static floor (9 paired runs, 30,078 calls each). It also handles fork and threads, exec, children that outlive their parent, timeouts, its own cgroup, the clone3 cgroup escape, and attaching before the program starts.

It is not ready for production yet: jobs and services still run under the static filter, and their signed record says so; production attachment, authenticated receipts and complete graphs of real programs are still open. Its parts are released since 0.5.0 (crate nordisk-heimdall-graph). The design and its current state: docs/v2/graph-filter.md, section 12.

heimdall graph bin (binary to graph, experimental) reads a linked ELF program, a shared library, an object or a static archive without running it and writes its graph in the same tables; it calls nornir's nornir-mimir-bin from crates.io: docs/v2/binary-graph.md.

  1. Static analysis gives the graph. The program is described as a graph that matches the code 1:1: every place in the code that can make a system call, and the places that can come after it.
  2. The profiler checks the graph. Every call seen in a real run, and every pair of calls that follow each other in one thread, must be in the graph. If one is not, the analysis is wrong and is fixed. Nobody edits the graph by hand.

The filter then follows each thread of the program through the graph and allows only the calls that can come next. For example, a call that the program makes only once at start can be refused for the rest of the run. The static filter must allow it for the whole run.

Real programs with C code are refused for graph mode today and run under the static filter: every C effect the analysis cannot prove stays open. PostgreSQL 17 has about 65,000 open sites, mostly memory effects and the choice of which definition is linked. Closing them is staged work: first the identity of the exact build, then a memory model.

Call-site filter (hybrid): not as a filter of its own

The kernel reports, with every system call, the address of the instruction that made it (seccomp_data.instruction_pointer). Heimdall's profiler already receives it. A call-site filter would learn, in the same profiled runs, where each call is made: a location inside a pinned binary or library (the module and the offset). It would then allow a call only from the locations seen, and, combined with the graph filter, only from those locations in the current graph state.

  1. The profiler records the call and its location. Each measured call is stored with its module-relative location, against the hashes of the exact binary and libraries.
  2. The filter allows each call only at its recorded locations.

It depends on the runtime profiling: only locations seen in real runs are allowed. A path no run reached, such as a rare error or signal path, is refused (it fails closed), so coverage of the tests decides how often a legitimate run is killed.

Its limits:

The three filters

Static filter (allowlist) Graph filter (order) Call-site filter (only with the graph)
What it allows One fixed set of calls for the whole run For each thread, only the calls that can come next in the program's graph Each call only from the code locations where it was measured
What makes it The profiler: the calls measured in real runs The static analysis: the graph of the program (Mímir) The profiler: the calls and their code locations in real runs
What checks it The static analysis: the measured calls against the possible calls The profiler: the calls and call orders seen in real runs The static analysis, where a graph exists: the locations against the graph's sites
Depends on profiling runs Yes No: the graph comes from the code; runs only confirm it Yes: an unseen location is refused
Kernel mechanism Classic seccomp BPF A seccomp floor program, and the launcher as supervisor: each checked call waits for its check (December 2026). Earlier work: the static filter as the floor, plus an eBPF follower (tracepoints, kprobe, BTF; heimdall kernel needs --mode graph-follower) Classic seccomp on the instruction pointer (fixed addresses only), or the eBPF follower
Catches A call outside the set An allowed call in a forbidden order An allowed call from the wrong place in the code
Misses Order and place The place inside a shared wrapper; arguments Order (unless combined with the graph); callers behind a shared wrapper; a jump to a real syscall instruction
When it is wrong It kills the program (fails closed) It kills the program on an invalid step (fails closed) It kills the program at an unseen location (fails closed)
Cost per call Only the classic filter With the supervisor: not measured yet. With the eBPF follower: +131.5 to +210.7 ns over the static floor on the example program (two measured series in disposable VMs) About the classic filter (instruction-pointer compare); with the follower, like the graph filter
Status Released; the current release is 0.6.1. Default for jobs and services Works for pure Rust programs on the development branch (December 2026): a program runs under Enforce with every call checked. Released in 0.5.0: graph import, check, reference decision, tables and floor. On main: the in-kernel follower, proven on a profiled example program (Enforce, 0 kills). Programs with C code are refused Not built alone. Planned only as part of the graph filter

The design treats all three as one model with one check. The static filter has one position that never changes. The graph filter has a position for each thread. The call-site filter adds the place in the code to the position.

Heimdall and gVisor

gVisor and Heimdall both protect the kernel from a program, in different ways.

gVisor                                         Heimdall
 program                                        program
    │ system calls                                 │ system calls
    ▼                                              ▼
 Sentry: a second kernel in user space (Go)     seccomp filter: the allowlist (graph mode later:
    │ a small fixed set of host calls               │ only the calls that can come next)
    ▼                                              ▼
 Linux kernel                                   Linux kernel
gVisor Heimdall static filter Heimdall graph filter
Model A second kernel in user space An allowlist of calls, fitted to each program The allowlist as a floor, plus "only what can come next" per thread
Kernel bug in an allowed call Shielded by the Sentry Reachable Reachable only where that call can come next
Compatibility Not every Linux call or feature is implemented Native Native
Cost per system call Microseconds: the call takes a detour through the Sentry About 20 ns; 50 to 60 ns with argument rules The floor's cost, plus about +131.5 ns for the follower (measured on the example program; production cost not measured yet)
Status Mature, in production use Released Works for pure Rust programs (development branch, December 2026); not yet for production jobs

Measured on oden (2026-11-08, see bench/floor-cost and docs/v2/graph-filter.md §8): a call the filter allows outright costs about 20 ns extra, a call checked against argument rules 50 to 60 ns. Only the few calls Heimdall's own jobs hand to the supervisor cost more: about 4.5 µs when it answers "continue", 8 to 11 µs when the broker opens the file itself.

Heavy I/O is not slowed down. The filter checks each call once, at the kernel's entry, in a few tens of nanoseconds, and the data never passes through Heimdall. A database writing to disk, a broker on the network or a program using io_uring talks to the real kernel at full speed: reads and writes go straight to the disk or the network card, and one io_uring_enter call submits many operations past a single check. gVisor's Sentry, by contrast, handles every file and network operation itself. One note: seccomp sees io_uring_enter, not the operations inside the ring, so Heimdall allows io_uring only when the program's measured profile needs it.

The two can also be stacked: a program under gVisor with a Heimdall profile. We have not yet measured gVisor in our own bench.

A two-node Kubernetes benchmark with every pod under a profile learned by Heimdall's profiler: docs/bench/ovn-bench.

PostgreSQL 17 under pgbench in a container, with no filter and under the static filter generated from LOG runs of it (one workload, busy shared hosts, the graph row pending): the filter's cost, expected at about 0.3 % of the server's CPU per transaction, is below what those hosts can resolve. docs/bench/postgres-filter.

A node's seccomp floor made only by tools, one per network variant (bridge, aya, OVN upcoming), with a matrix of static filter and graph filter: docs/v2/node-floors.md.

The process

Six steps make and verify the filters for an appliance image: Record, Generate, Cross-check, Assign, Join to the kernel, Verify. Steps 1 and 2 are Heimdall commands. Step 3 uses the separate static analysis. Steps 4 to 6 are done by the appliance build that uses Heimdall. The control command of step 6 is ongoing. The steps in full are at the top of "Static filter details" below.

Install and use

Heimdall needs Linux and Rust 1.89 or newer. The profiler needs Linux 5.5 or newer. The jobs and services of heimdall-container need Linux 5.9 or newer (from 0.8.0).

git clone ssh://anonymous@git.gunnar.rs:2222/nordisk/heimdall.git
cd heimdall
cargo build --release

Make a filter for a program. The program's test runs are listed in profiles/<workload>/workload.toml.

heimdall profile probe <workload>    # run the test runs and record the calls
heimdall profile gen <workload>      # write the filter; a person reviews the diff
heimdall profile check <workload>    # measure again; fail on a call outside the filter

Run one sandboxed job on untrusted input, then verify its signed result.

heimdall run --job wasm --module <guest.wasm> --trust-root <key> --in <dir> --out <dir> [--policy <file>]
heimdall verify-result <out>/result.signed --key <pinned key> [--files <dir>]

From source to a filter the program runs under, with one worked example (a Rust program with C) and every verb: docs/MIMIR-HEIMDALL-FROM-ZERO.md. Every command is in docs/CLI.md. The filters are described in docs/SECCOMP.md, and the Rust API in docs/API.md. The crates are on crates.io as nordisk-heimdall-*; the table is under "Static filter details" below.

Releases

Static filter details

This part describes what exists today, in release 0.6.0.

The process, step by step

Process: make and verify the filters for an appliance image

  1. Record. Run each program under the Heimdall profiler. The profiler writes an evidence file: the list of system calls that the program made.
  2. Generate. Run heimdall profile gen. It writes one profile for each program from its evidence file.
  3. Cross-check. Compare the recorded calls with the calls that the static analysis finds in the code. Review each difference.
  4. Assign. Give each container in the image its generated profile.
  5. Join to the kernel. List the kernel options that the recorded calls need, with the program and the call for each option.
  6. Verify. A control command does these checks and stops with an error if one fails:
Check Stop with an error if
Profiles A profile has no evidence file, or the profile is not identical to the output of step 2 for that evidence file.
Pods A container has no generated profile and is not in the exceptions list.
Kernel A kernel option from step 5 is disabled, or an enabled option has no recorded reason.

If all checks pass, the command writes a receipt: each profile, the digest of its evidence file, the tool versions, the kernel, the exceptions. The image is built only with a receipt that passed.

Who does each step, and what exists:

The inspection job

Heimdall is a defensive sandbox for inspecting content. All content is untrusted until it is verified. That includes signed content: a digital signature is itself untrusted input until it has been checked, and the check must not be able to attack the checker. So Heimdall parses, verifies and scans in an isolated job:

Pure Rust, static binaries. A long-running program (a daemon that serves a socket) runs as a service in the same container a job gets, since 0.4.1 (docs/API.md, "Services").

Users

Layers

Each job runs inside every layer below; an attacker must break all of them. The static filter is the seccomp allowlist row.

Layer What it does
Kernel The node runs a kernel trimmed to what its rows declare (tinyconfig plus the declared needs), so less kernel code can be attacked; a measured trim (to what its programs actually use) is planned.
Container (youki) Namespaces, read-only root, no network unless allowed, all capabilities dropped, no-new-privs, cgroup v2 limits, image checked at every start.
Seccomp allowlist Only the system calls the job really uses, with fixed arguments where possible. Anything else kills the program that makes the call. Every filter also allows the four calls the kernel itself makes a program issue (restart_syscall, rt_sigreturn, exit, exit_group), and no profile can deny them (the base set).
Landlock File access only to the job's input (read) and output (write).
Syscall broker The few risky calls (open, socket, connect) are paused and checked by Heimdall, which opens the file or socket itself, so the job cannot race the check.
Wasm host (optional) The parser runs as signed WebAssembly with no file or network access, under fuel, time, memory and stack limits.
Signed result The verdict and the output hashes are signed with a per-boot Ed25519 key.

How the filter and the kernel are fitted

Nothing is guessed. Heimdall measures what a program does and allows only that. A checked-in filter is called a profile.

  1. Build the program and the node kernel (Build Thing).
  2. Probe: run the program's full test suite and fuzz corpus on a probe kernel, in learning mode. Heimdall records every system call with its important arguments; the probe kernel records which kernel code ran.
  3. Generate: Heimdall merges the runs into the smallest seccomp profile per program, architecture and libc (a Rust table plus reviewable JSON). The kernel side lists kernel options no program used, explained through the Kconfig dependency graph.
  4. Review: a person checks the diff and commits it. Nothing is merged automatically.
  5. Enforce: production runs the checked-in profile; any call outside it kills the program that makes it. Kernel options are removed one at a time, each with a full test rerun.
  6. Drift check: every CI run probes again and fails if a program makes a call its profile does not have, naming the call and the test that made it.

Paths a test never reached are missing from the profile, so they fail closed. The probe therefore runs error paths, failover and fuzzing, not only normal use.

The static analysis is Mímir's (nornir); heimdall graph src runs it on a Rust workspace and writes each program's possible set (docs/CLI.md). The cross-check is dwarves' dwarves-tune-graph. They compare the measured set with the possible set and give four lists: confirmed, gap, untested and near miss. The lists guide review and tests and add no rule (docs/v2/graph-filter.md, section 2). The kernel side is optional and is a separate tool too: docs/BUILD-THING.md says how Build Thing drives the tuning, docs/v2/kernel-tooling.md describes the kernel tooling as built, and docs/v2/kernel-fit.md is the process step by step.

The probe and the profiles

Details: docs/SECCOMP.md.

Command line

Command What it does
heimdall run, heimdall verify-result Run one wasm job; verify a signed result
heimdall profile probe, gen, check Measure a workload, write its profile, check for drift
heimdall profile probe-exec, probe-container, merge Measure one program where it really runs; join evidence files
heimdall profile probe-oci Measure a container under its OCI runtime, the runtime's own calls included (since 0.4.3)
heimdall kernel needs [--json] Print the kernel options a strict runner needs, each with its reason
heimdall trace run, verify, diff Dynamic-trace jobs

Details and exit codes: docs/CLI.md. The policy file: docs/POLICY.md. One job step by step: docs/RUN.md.

Kernel needs

Feature Kernel If it is missing
seccomp-bpf with KILL_PROCESS 4.14 Heimdall refuses to start
seccomp USER_NOTIF with CONTINUE 5.5 No probe; the broker refuses brokered calls
openat2, pidfd_getfd; NOTIF_ADDFD 5.6; 5.9 The broker runs in check-only mode
Landlock (ABI 1; ABI 4 for network rules) 5.13; 6.7 Logged, or refused in strict mode
cgroup v2 with the memory, pids and cpu controllers 4.15 and later Refused in strict mode
Unprivileged user namespaces CONFIG_USER_NS Refused in strict mode

Heimdall reports the features it got on every start, and each signed result names them. The whole table is in docs/SPEC.md, section 10.

Crates

On crates.io the packages are named nordisk-heimdall-* (the name heimdall-core there belongs to an unrelated project). The library names are unchanged, so code keeps writing use heimdall_core::…:

heimdall-core = { package = "nordisk-heimdall-core", version = "0.4" }
Package Library What it is
nordisk-heimdall-core heimdall_core Job, policy and signed-result types, per-boot Ed25519 key, canonical encoding, verification
nordisk-heimdall-seccomp heimdall_seccomp Profile types per workload, architecture and libc; a pure-Rust BPF builder; enforcing and audit modes; the USER_NOTIF API
nordisk-heimdall-probe heimdall_probe The profiler: learning mode, merge and minimise, the profile generator, the drift check
nordisk-heimdall-profiles heimdall_profiles The generated, checked-in profiles, compiled into the runners that enforce them
nordisk-heimdall-broker heimdall_broker The syscall broker: checks open, socket, connect, bind and exec, and opens the file or socket itself
nordisk-heimdall-container heimdall_container The protected native runner (HeimdallRunner): a youki container per job or service with Landlock, seccomp and limits
nordisk-heimdall-confine (not published yet) heimdall_confine Landlock for one process: a plan of path lists with fixed rights that the calling process applies to itself; the part of the runner's Landlock a program can link alone
nordisk-heimdall-wasm heimdall_wasm The wasm host: wasmtime components, no WASI, limits, signed guests
nordisk-heimdall-plain heimdall_plain The interim youki runner (an ordinary container, no Heimdall protections)
nordisk-heimdall-run heimdall_run One wasm job end to end: input dir, guest, output dir, signed result
nordisk-heimdall-trace heimdall_trace The dynamic-trace job: a signed trace of what a package's install or import does, and its diff against a baseline
nordisk-heimdall-scan heimdall_scan The contract of the static-scanner guests
nordisk-heimdall-cli binary heimdall The command line
nordisk-heimdall-k8s (not published yet) binary heimdall-k8s The node-local signer for a Kubernetes RuntimeClass heimdall: per-boot key, scans a finished container's /out, signs a truthful result (crates/heimdall-k8s/README.md)

The job API (the JobRunner trait, and the interim heimdall-plain runner, an ordinary youki container stated as such) is in docs/API.md. The specification is docs/SPEC.md.

Standards and specifications

Standard Used for Status
RFC 8032 (Ed25519) Signed results, strict verification Implemented
FIPS 180-4 (SHA-256) Output hashes, key ids Implemented
BLAKE3 Guest module pins Implemented
WebAssembly Component Model, WIT The guest interface; WASI is not linked Implemented
DSSE (in-toto envelope) Bundle verification before payload parsing In progress
RFC 5280 (X.509) Bundle signatures In progress
OCI Runtime Specification The youki container (heimdall-plain) Implemented
Linux seccomp-bpf A fixed default profile, plus a GENERATED per-program allowlist (measured with heimdall-probe, enforced at runtime) for Holger's three job kinds: the verify-bundle job's wasm worker (heimdall-wasm-host, checked in here), Holger's scan worker and clamd (checked in at Holger); see docs/SECCOMP.md Implemented
seccomp USER_NOTIF + SECCOMP_IOCTL_NOTIF_ADDFD The syscall broker (heimdall-broker): open, socket, connect, bind and exec of every heimdall-container job checked, files opened by Heimdall and injected; check-only and deny-only fallbacks Implemented
Landlock LSM (ABI 1–6) heimdall-container: /in read-only, /out write-only, /tmp no exec, no TCP bind/connect (ABI 4), signal and abstract-socket scopes (ABI 6) Implemented
Linux cgroup v2, user namespaces, no_new_privs Resource limits and privilege drop Implemented
NIST SP 800-190 (Application Container Security Guide) Container hardening guidance Followed in design
SLSA v1.0 Build Level 3 Release provenance through the same pipeline as Holger and Gunnar (dwarves release-build, hardware-key signed); see attestations/ (0.1.0 to 0.6.0) Implemented

"Implemented" means it is on main with tests; nothing in this table is a certification.

Fuzzing results

Measured 2026-10-30 on main after v0.1.0: every cargo-fuzz target ran 30 minutes (the first six twice), about 1.9 billion inputs in total, with no crash. Run it yourself with scripts/fuzz.sh.

Target What it feeds Inputs tried Crashes
output_name Output file names 466 million 0
pinned_key_text The pinned key line 287 million 0
result_encoding The canonical result encoding 209 million 0
policy_file The TOML policy file 14.4 million 0
verify_result_file A result file given to verify-result 10.7 million 0
signed_result_wire The signed-result wire format 10.6 million 0
wasm_emit_file Guest file names, sizes, traps partway through 4.6 million 0
wasm_guest_load Random bytes through pin, signature and compile 186,000 0

wasm_guest_load is slow by design: it signs and compiles every input.

More documents

Graph filter details

The earlier graph filter (the eBPF follower). Its parts are released in 0.5.0.

Released in 0.5.0 (except the youki backend, now on crates.io as nordisk-heimdall-youki 0.1.0):

Part Where
Static mode behind the filter trait (CallFilter), with filters byte-identical to 0.4.3 heimdall_seccomp::filter
The graph import: Mímir's call graph, pinned by SHA-256; an unknown format or call name is refused by name heimdall-graph
The check of the graph against the profiler's calls and call pairs heimdall-graph
decide in plain Rust, the reference, with property tests; the follower's tables, built deterministically heimdall-graph
The floor's three answers (never, always, brokered), tested through the BPF interpreter heimdall_seccomp
The profiler records pairs of calls in each thread heimdall_probe
The supervisor resolves a job's pinned graph and builds the floor; the signed record Protection::Graph, while old records verify unchanged heimdall-core, the supervisor
A youki backend for the static filter, through the SeccompBackend trait of youki PR #3873 heimdall-youki

On main, not released yet: the in-kernel follower (eBPF), which enforces the graph. It is proven only in disposable VMs on a profiled example program: Enforce with 0 kills, a forbidden call order killed, fork and thread entry, exec, orphans, timeouts, cgroup selection, the clone3 boundary, insert-only diagnostics and attaching before exec. Production jobs and services still run under the static filter, and the record says "static".

Measured cost per call (2026-11-08, on a busy 32-core host; bench/floor-cost): the floor adds about 20 ns to a call it allows bare (the kernel answers from its cache) and 50 to 60 ns to a call with argument rules; a brokered call costs about 4.5 µs for the round trip to the supervisor, and 8 to 11 µs when the broker opens the file itself. The follower adds a median +131.5 ns per call over the identical static floor on the example program (2026-11-09, 9 paired runs on t14s; a later object with more lifecycle checks measured +193.9 ns and is not directly comparable). Its production cost is not measured yet.

Known limits today: Mímir's graphs of real programs still contain C code without a graph, so graph mode stays off for them. Rebuilt on 2026-11-08 with Mímir's tools from crates.io, no system call whose number is chosen at run time is left (the wasm host worker: 6 before, 0 now; Holger's scan worker: 9 before, 0 now), but the C code remains: blake3's assembly, zstd and wasmtime's unwinder in the wasm host worker (23 functions), ring, zstd and lzma in the scan worker (46), libseccomp in the two shims (10). Heimdall's smaller programs (the trace and k8s commands, the broker's test worker) have none. The graph does not yet include the C start-up code before main or the start of each thread. The numbers per program are in docs/v2/graph-filter.md, section 10.

On main, not released yet: heimdall graph bin and graph show (the binary graph, experimental), heimdall graph src --features, the cost measurement above, and the release gate script (scripts/release-gate.sh).

The design has one filter model, decide(position, call) → (allow, next position) | deny, and one place where it is checked: the system-call entry. Static mode has one position. Graph mode has a stack of positions for each thread: where the thread is in the graph, with one more position on top for each signal handler that is running. Graph mode has three parts. The static filter stays on in seccomp as the floor. A small eBPF program in the kernel follows each thread through the graph and checks every call the floor let through; an invalid step kills the program, or is only logged in audit mode. A supervisor outside the program only brokers the calls that Heimdall opens itself, and signs the record. Graph mode needs a host where Heimdall may load eBPF. Elsewhere the program runs under the static filter.

The design also says what the graph filter cannot do (an attacker can still follow any path of the graph, and memory arguments are not checked), compares it with Firecracker's seccompiler, and ends with questions for the reviewer.

Read it here: docs/v2/graph-filter.md.