Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Tracee: runtime detection and forensics with eBPF

9 min read
Improve this page

Tracee does not stop at tracing what happens in the kernel: it applies behavioral signatures to say "this is suspicious". That is the difference between a tracer (like bpftrace) and a runtime detection tool: Tracee, built on eBPF by Aqua Security, watches system calls and raises an alert when a sequence matches an attack technique. This page shows it at work on a host, with real outputs captured on an Ubuntu 24.04 VM (kernel 6.8, Tracee v0.24.1): first a raw trace, then a real detection. For the eBPF foundations, see the eBPF hub.

What you will learn

  • Tell apart tracing an event and detecting a behavior
  • Run Tracee on a host with its container image
  • Trace a system call and read the output
  • Trigger and observe a detection signature
  • Place Tracee against Falco and Tetragon, and in Kubernetes

The problem: tracing is not enough to detect

eBPF tracing tools show what is happening: this process launched that program, opened that file. That is essential, but raw: it is up to you to spot what is abnormal. On a production server, nobody reads the stream of system calls continuously.

Tracee adds the missing layer: signatures, rules that recognize known security behaviors (a program that detects it is being analyzed, an executable written then launched, a shell tied to a network socket). Tracee turns a stream of events into actionable alerts. It is a runtime detection and forensic analysis tool, not a simple tracer.

Prerequisites

  • A Linux host with a recent kernel and BTF (/sys/kernel/btf/vmlinux present), see CO-RE and BTF.
  • A container runtime (Docker or containerd) to run the official image.
  • The required privileges: Tracee loads eBPF programs on the host.

Run Tracee

Tracee is distributed as an official container image, which bundles everything it needs. You run it in privileged mode with access to the host (it is a security tool that has to see the whole system):

Terminal window
sudo docker run --rm --name tracee --pid=host --cgroupns=host --privileged \
-v /etc/os-release:/etc/os-release-host:ro \
-v /sys/kernel/security:/sys/kernel/security:ro \
-v /boot:/boot:ro \
aquasec/tracee:0.24.1@sha256:cfbbfee972e64a644f6b1bac74ee26998e6e12442697be4c797ae563553a2a5b

With no option, Tracee loads its set of signatures and watches. To start more simply, you can ask it to trace a single type of event.

Trace an event

Let us trace program executions (execve), to see the shape of the data:

Terminal window
sudo docker run ... aquasec/tracee:0.24.1@sha256:cfbbfee972e64a644f6b1bac74ee26998e6e12442697be4c797ae563553a2a5b --events execve --output table

Real output:

TIME UID COMM PID TID RET EVENT ARGS
12:58:24:958968 1000 bash 26574 26574 0 execve pathname: /usr/bin/uname, argv: [/usr/bin/uname -r]
12:58:24:959590 1000 bash 26575 26575 0 execve pathname: /usr/bin/id, argv: [/usr/bin/id]
12:58:24:960289 1000 bash 26577 26577 0 execve pathname: /usr/bin/sleep, argv: [sleep 0.3]

Each line gives the time, the user (UID), the process (COMM), its PID, the return value (RET) and above all the detailed arguments: the exact path of the program and its command line. That is already richer than a classic trace, but it stays at the level of observation. Tracee's real strength lies elsewhere.

Detect a behavior: signatures

Now for detection. One interesting signature is anti_debugging: it spots a program trying to find out whether it is being analyzed, a technique common in malware to evade inspection tools. Concretely, it fires when a process calls ptrace with the PTRACE_TRACEME option.

You run Tracee on this signature, then execute a small program that triggers the behavior:

Terminal window
sudo docker run ... aquasec/tracee:0.24.1@sha256:cfbbfee972e64a644f6b1bac74ee26998e6e12442697be4c797ae563553a2a5b --events anti_debugging

Real output, the detection happens:

TIME UID COMM PID TID RET EVENT ARGS
13:20:36:614888 1000 antidebug 27215 27215 0 anti_debugging detectedFrom: ptrace
13:20:36:615310 1000 antidebug 27216 27216 0 anti_debugging detectedFrom: ptrace
13:20:36:615653 1000 antidebug 27217 27217 0 anti_debugging detectedFrom: ptrace

The event is no longer execve but anti_debugging: Tracee does not just say "this program made a system call", it says "this program behaves like software trying to hide", with the source of the detection (detectedFrom: ptrace). That is a security alert, not a simple observation. That is what sets Tracee apart from a tracer.

Which signatures are available

Tracee ships a catalog of signatures that cover documented attack techniques. A few telling examples:

SignatureBehavior detected
anti_debuggingA program tries to find out whether it is being analyzed
dropped_executableAn executable is written then launched (payload)
fileless_executionExecution with no file on disk
stdio_over_socketInput/output tied to a network socket (reverse shell)
illegitimate_shellA web server launches an interactive shell

Each detection is enriched with context (process, container, arguments), which makes it a starting point for forensic analysis: reconstructing what happened after an alert.

Tracee in Kubernetes

On a cluster, Tracee is deployed as a DaemonSet: one instance per node, which watches all containers. Detections come up with the Kubernetes context (pod, namespace), and can be sent to a collector (webhook, structured output) to feed a SIEM or trigger a response.

Terminal window
kubectl create namespace tracee
helm install tracee aqua/tracee -n tracee

The principle is the same as what you saw on the host: the same signatures, applied at cluster scale.

Tracee, Falco or Tetragon

Three eBPF-based runtime security tools coexist, with different angles. The choice deserves its own page, Falco vs Tetragon; here are the essentials.

  • Tracee focuses on signature-based detection and forensics, with a strong threat-research heritage.
  • Falco is the historical reference for rule-based detection, widely adopted and integrated (CNCF project).
  • Tetragon goes beyond detection: it can block an action directly in the kernel.

The three are not mutually exclusive; they reflect different priorities between observation, detection and enforcement.

Security and points of attention

  • High privileges. Tracee runs in privileged mode with access to the host: it is a sensitive component, to be deployed with the same precautions as a security agent (reduced surface, updates kept current).
  • Event volume. On a busy host, enabling too many events or signatures generates noise and overhead. Target the signatures that matter for your threat model.
  • Sensitive data. Detections contain paths, arguments, sometimes fragments of data. Treat these streams as security logs, with the matching access control.
  • Detection, not prevention. Tracee alerts; it does not block by itself. To stop an action, you need an enforcement tool such as Tetragon, or you wire the response downstream.

Troubleshooting

SymptomLikely causeSolution
Startup failure, BTF missingOld kernel without BTFCheck /sys/kernel/btf/vmlinux, update the kernel
No detectionSignature not enabled or not triggeredCheck --events, trigger the targeted behavior
permission deniedNon-privileged containerAdd --privileged and the required host mounts
Too many eventsEvent set too broadNarrow it with --events and filters

Key points

  • Tracee is an eBPF-based runtime detection and forensics tool, not a simple tracer.
  • It traces rich events (path, arguments) and applies signatures that recognize suspicious behaviors.
  • A real detection (anti_debugging, detectedFrom: ptrace) is a security alert, not a neutral observation.
  • Its signatures cover documented techniques: dropped executable, fileless execution, reverse shell.
  • In Kubernetes, it is deployed as a DaemonSet with the pod / namespace context.
  • Tracee detects; to block, you need an enforcement tool such as Tetragon.

Next steps