Join our Newsletter — 33% off our NHI Course
Home› Guides› Tetragon Guide: eBPF Runtime Observability and In-Kernel Enforcement…
Guide Cloud Security

Tetragon Guide: eBPF Runtime Observability and In-Kernel Enforcement for Kubernetes

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

Kubernetes admission controls and image scanning say nothing about what a container actually does once it is running, and Tetragon is one way to see and stop that behaviour inside the Linux kernel. Tetragon is a Cilium sub-project that uses eBPF to observe process execution, system calls, file and network activity, and can enforce policy in the kernel by overriding a function's return value or killing the process. This guide covers how it is deployed, how TracingPolicy resources and selectors work, which detections to start with, how to move from monitoring to enforcement without breaking workloads, and how to get events into a SIEM. It is written for Kubernetes platform and security engineers who already know the basics of eBPF and container runtime security.

This is an independent guide from NHI Mgmt Group, based on Tetragon's public documentation as of November 2026. It is not sponsored or reviewed by the Tetragon project. Product features change, so confirm settings against Tetragon's current documentation.

Key takeaways

  • Filtering happens in the kernel. Tetragon evaluates selectors in eBPF and only passes matching events to the user space agent, which keeps overhead down and lets enforcement act before a system call completes.
  • Policies are code with kernel side effects. A TracingPolicy hooks kprobes, tracepoints, uprobes or LSM hooks; the documentation warns that it is low level and needs kernel and container knowledge to avoid issues such as TOCTOU bugs.
  • Observe before you enforce. Every policy with enforcement actions can run in monitor mode, set in the policy, at load time or at runtime, so the same YAML can be tested and then switched on.
  • Check the kernel first. Tetragon needs Linux 4.19 or later and BTF; enforcement needs CONFIG_BPF_KPROBE_OVERRIDE, and tetra probe reports what the node actually supports.
  • The agent is a high value target. It runs privileged on every node, so lock down who can create TracingPolicy objects, keep gRPC on a Unix socket or behind mutual TLS, and protect exported event files.

What Tetragon does

Tetragon detects security significant events such as process execution, system call activity and I/O including network and file access. In Kubernetes it is workload aware: events carry namespace, pod and container identity, and policies can be scoped to them. The project documentation describes three properties that matter in practice:

  • In-kernel filtering: filters on file names, sockets, binary names, namespaces and capabilities run in eBPF, so high frequency events such as read and write do not wake the agent unless they match.
  • Arbitrary hook points: no traced function is hard coded in the engine. Policies choose the kernel function, tracepoint or user space symbol, and the project ships example policies as starting points.
  • Kernel state awareness: hooking deep in the kernel, for example at LSM security hooks, avoids the classic syscall tracing problems of data read before it is final or altered by the caller.

Tetragon complements, rather than replaces, admission control and image scanning. See the Admission Control vs Runtime Security and the Container Runtime Security Guide for where runtime controls sit in the wider stack.

Architecture and deployment

On Kubernetes the recommended install is the Helm chart from helm.cilium.io, which deploys the agent as a DaemonSet in kube-system plus an operator. The operator registers the TracingPolicy, TracingPolicyNamespaced and PodInfo custom resources; PodInfo maps pod IP addresses to workloads so network events can be attributed. Tetragon can also run as a standalone container or a systemd service, where policies are loaded from files or through the tetra gRPC CLI.

Component or settingDefault in the Helm chartWhat to decide
Agent DaemonSetOne pod per node, privilegedNode pools in scope; resource requests and limits
tetragon.grpc.addressunix:///var/run/tetragon/tetragon.sockKeep the Unix socket; the chart warns against TCP without TLS client verification
tetragon.grpc.tlsDisabled, client certificate not requiredTurn on with requireClientCert if anything connects over the network
tetragon.exportFilename / exportDirectorytetragon.log in /var/log/tetragon, permissions 600Who may read the file; rotation via exportFileMaxSizeMB (10) and exportFileMaxBackups (5)
tetragon.exportDenyListHealth checks and the "", cilium and kube-system namespaces excludedWhether to see system namespaces; by default kube-system pods are filtered out
tetragon.prometheus.portMetrics enabled on 2112 (operator 2113)Restrict scraping with network policy; metrics reveal configuration
tetragon.enablePolicyFiltertrueRequired for namespace and pod label filtering; leave on
rthooks.enabledfalseEnable OCI runtime hooks so namespaced policies apply before a container starts

Kernel version requirements

The FAQ states a minimum of Linux 4.19, with tests on the 4.19, 5.4, 5.10 and 5.15 long term kernels and bpf-next, and recommends the newest stable kernel available because not all features work on older ones. On arm64, kernel 5.10 or later is recommended for full functionality. BTF is required for CO-RE loading: the agent looks for /sys/kernel/btf/vmlinux, then /var/lib/tetragon/btf, or a path passed with --btf. Key kernel options are CONFIG_BPF_SYSCALL, CONFIG_BPF_JIT, CONFIG_DEBUG_INFO_BTF, CONFIG_BPF_KPROBE_OVERRIDE for enforcement, the cgroup options for process tracking, and CONFIG_BPF_LSM if you want LSM hooks. Run tetra probe config and tetra probe on a representative node of each pool before rollout; managed node images differ.

Tetragon itself loads BPF programs and needs the matching privileges. The eBPF Security Guide explains why CAP_BPF and CAP_SYS_ADMIN should be treated as administrator rights, and why your inventory of expected BPF programs should include the Tetragon agent.

TracingPolicy basics

A TracingPolicy (API group cilium.io/v1alpha1) has a hook point and up to five selectors per hook. Each selector is a set of filters joined by AND, plus actions. If a hook has no selectors, the default action is Post (emit an event). Policies live in three domains that do not overwrite each other: k8s (kubectl), grpc (tetra) and static (startup flags such as --tracing-policy-dir).

ElementOptionsNotes from the documentation
Hook pointskprobes, tracepoints, uprobes, LSM BPF hooks, plus fentry/fexit, raw tracepoints and USDTLSM hooks need CONFIG_BPF_LSM=y
Argument filtersmatchArgs with Equal, Prefix, Postfix, FileType, InMap and others; matchReturnArgsMax 5 matchArgs per selector, 4 values each; use InMap for larger lists
Process filtersmatchBinaries, matchParentBinaries (with followChildren), matchPIDs, matchCmdArgsCommand line matching sees at most 256 bytes of arguments
Context filtersmatchNamespaces, matchCapabilities, matchNamespaceChanges, matchCapabilityChangesUseful for privilege change and container escape signals
Workload scopeTracingPolicyNamespaced, podSelector, containerSelector (name, repo), hostSelector, nodeSelectorA policy skipped by nodeSelector shows state skipped in tetra tracingpolicy list
ActionsPost, NoPost, Sigkill, Signal, Override, NotifyEnforcer, GetUrl, DnsLookup, TrackSockPost accepts rateLimit (for example 5m) and rateLimitScope of thread, process or global

Start from the project's policy library rather than a blank file, and keep each policy small and single purpose so its mode, owner and expected event rate are clear.

Observability use cases

Without any TracingPolicy, Tetragon already emits process_exec and process_exit events with binary, arguments, parent, and pod metadata. Policies add the rest. Good first detections, all from the project's use case documentation:

Use caseHook approachThreat it surfaces
Sensitive file access (/etc/shadow, /etc/passwd, service account token paths)LSM hooks security_file_permission, security_mmap_file and security_path_truncate (security_file_truncate from Linux 6.2) with Equal or Prefix path filtersCredential access, ATT&CK T1003.008
Unexpected execution in a containerBase exec events, filtered for shells or package managers in images that should not run themInteractive access, T1059.004
Privileged execution and credential changesCapability and credential change filters (matchCapabilityChanges, process credential monitoring)Setuid abuse T1548.001, exploitation T1068
Namespace changesmatchNamespaceChanges on a container processEscape to host, T1611
Kernel module loadsHost system change policies for module loadingPersistence and rootkit installation on nodes
Network connections by binarySocket tracking kprobes with destination filtersUnexpected egress from a workload

The documentation explains why it hooks security_file_permission rather than individual system calls: read, write, copy_file_range, sendfile, aio and io_uring all pass through it, so one hook covers paths a syscall list would miss. Service account tokens are machine credentials; reads of the projected token by an unexpected binary are worth an alert. See the Kubernetes Security Guide for the identity side of pod credentials.

Enforcement safely

Tetragon enforces in two ways. Override runs in place of the probed function and returns the value in argError, so the operation never executes; generally only system calls and security check functions allow this. Sigkill terminates the process synchronously, but the documentation notes that a SIGKILL during write() does not guarantee the data is not written, so combine Signal with Override when the operation must not complete.

Policy mode is the safety switch. A policy can be monitoring (enforcement actions elided), enforcement, or monitor_only when it has no enforcement actions. Mode is set, in increasing priority, in spec.options with the policy-mode key, at load time with tetra tracingpolicy add --mode monitor, or at runtime with tetra tp set-mode. The NENFORCE and NMONITOR columns of tetra tracingpolicy list show how often each path fired.

  1. Write and review: treat the policy as code, with a named owner, intent, and expected matches, reviewed through change control as the threat model advises.
  2. Deploy in monitor mode to a canary node pool using nodeSelector, or to one namespace with TracingPolicyNamespaced.
  3. Measure for at least one full release cycle: compare monitor counts with what you expected; every match is a process that would have failed or died.
  4. Tune selectors with matchBinaries or NotIn exceptions for legitimate tools, then re-run in monitor mode.
  5. Switch to enforce for the canary scope only, with application owners watching error rates.
  6. Widen scope pool by pool. Enable OCI runtime hooks (rthooks) so namespaced policies are in place before containers start, otherwise they apply best effort from API server data.
  7. Roll back by setting the policy back to monitor at runtime, or deleting the resource, rather than uninstalling the agent.

The threat model also warns that choosing the wrong hook point is a security and visibility risk in its own right, not a Tetragon flaw: validate that each hook actually covers the operation you mean to block.

Exporting events to SIEM

Events are JSON, written to stdout (picked up by the export-stdout sidecar and the cluster log pipeline), to rotated files, or streamed over gRPC to tetra getevents and other clients. The default export allowlist covers PROCESS_EXEC, PROCESS_EXIT, PROCESS_KPROBE, PROCESS_UPROBE, PROCESS_TRACEPOINT and PROCESS_LSM; the deny list applies to file sinks only and does not filter gRPC output.

  • Volume control: use fieldFilters to drop unused fields, exportRateLimit (events per minute, -1 is unlimited by default), and Post rateLimit in noisy policies.
  • Redaction: redactionFilters apply RE2 expressions to argument fields so secrets passed on command lines do not land in the SIEM.
  • Protection of the data: the threat model notes that events reveal system behaviour and user activity; apply access control, encryption in transit and at rest, and a retention period.
  • Correlation fields: keep process.pod.namespace, pod name, container image, binary, parent and node so analysts can pivot to Kubernetes audit logs.

See the SIEM Guide for parsing, retention and detection engineering on top of these events.

Operational pitfalls

  • Silent event loss: under load the ring buffer can drop events. Watch tetragon_bpf_missed_events_total, tetragon_observer_ringbuf_events_lost_total, tetragon_export_ratelimit_events_dropped_total and tetragon_enforcer_missed_notifications_total.
  • Performance surprises: a broad hook on a hot function with filters only in user space costs CPU on every node. tetragon_overhead_program_seconds_total shows per program cost, and --cgroup-rate (for example 1000,1s) throttles exec and exit floods per cgroup, emitting THROTTLE events.
  • Kernel drift: hook names change between kernels, as the truncate hook did in 6.2. Re-test policies on every node image upgrade.
  • Selector limits: five selectors per hook, four values per matchArgs, prefix strings up to 256 characters. Large allow lists belong in InMap.
  • Blind spots by default: kube-system is filtered from export by default; attackers who land in system namespaces will not appear unless you change it.
  • Weak RBAC over policies: anyone who can delete or edit a TracingPolicy can switch off detection. Restrict the CRDs to the platform security team and alert on changes in the Kubernetes audit log. See the Kubernetes RBAC Guide.

Framework mapping

FrameworkReferenceHow Tetragon contributes
NIST CSF 2.0DE.CM-09Monitoring runtime environments for adverse events
NIST SP 800-53 Rev 5SI-4 System Monitoring; AU-12 Audit Record GenerationKernel level process, file and network events
NIST SP 800-53 Rev 5CM-7 Least Functionality; SI-7 Software, Firmware, and Information IntegrityEnforcement policies that block unexpected binaries, file changes and module loads
MITRE ATT&CK v20T1611, T1003.008, T1059.004, T1548.001, T1068Detections listed in the use case table
NIST SP 800-190Container runtime risks and countermeasuresObserving and constraining container behaviour at run time

Practitioner checklist

  • Run tetra probe on each node image and record kernel version, BTF and CONFIG_BPF_KPROBE_OVERRIDE status.
  • Install with Helm, keep gRPC on the Unix socket, and turn on TLS with client certificates for any network listener.
  • Restrict create, update and delete on TracingPolicy and TracingPolicyNamespaced to the platform security team and alert on changes.
  • Decide whether kube-system stays in the export deny list, and document the choice.
  • Start with sensitive file access, unexpected shells and namespace change policies in monitor mode on a canary pool.
  • Enable OCI runtime hooks before relying on namespaced enforcement.
  • Switch individual policies to enforce only after a full release cycle of clean monitor counts, with a runtime rollback path tested.
  • Ship events to the SIEM with field filters and redaction, and set retention and access controls.
  • Alert on missed event and ring buffer loss metrics, and track per program overhead after each policy change.
  • Re-test every policy when node kernels or images change.

Standards and references

Related NHI Mgmt Group resources: eBPF Security Guide · Container Runtime Security Guide · Kubernetes Security Guide · SIEM Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.