Implement eBPF-based runtime security observability and enforcement in Kubernetes clusters using Cilium Tetragon for kernel-level threat detection and policy enforcement.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Implement eBPF-based runtime security observability and enforcement in Kubernetes clusters using Cilium Tetragon for kernel-level threat detection and policy enforcement.
Tetragon is a CNCF project under Cilium that provides flexible Kubernetes-aware security observability and runtime enforcement using eBPF. By operating at the Linux kernel level, Tetragon can monitor and enforce policies on process execution, file access, network connections, and system calls with less than 1% performance overhead -- far more efficient than traditional user-space security agents.
When to Use
When deploying or configuring implementing runtime security with tetragon capabilities in your environment
When establishing security controls aligned to compliance requirements
When building or improving security architecture for this domain
When conducting security assessments that require this implementation
Common Misconfigurations & Verification
A TracingPolicy that loads cleanly can still be observe-only or never fire. Validate enforcement, not just installation:
Observe-only when you meant to block: a selector with only matchActions: [{action: Post}] emits an event but lets the syscall through. Enforcement requires Sigkill, Signal, or Override - and Override needs a kernel that supports bpf_override_return (CONFIG_BPF_KPROBE_OVERRIDE / fexit/fmod_ret).
Selectors too narrow:matchBinaries keyed on absolute paths (/usr/bin/xmrig) is trivially bypassed by copying the binary; prefer matching on the operation (security_bprm_check, setns, security_file_open) plus namespace context.
Namespace scoping inverted:matchNamespaces with In/NotIn host_ns is the usual escape-detection logic - get the operator backwards and you alert on the host instead of containers.
Silent drops:tetragon_missed_events_total > 0 means the ring buffer overflowed and events were lost - your detection has gaps.
Verify: trigger the exact behavior in a throwaway pod (e.g. cat /etc/shadow, nsenter, run a renamed miner) and confirm the event in tetra getevents -o compact and that a Sigkill policy actually killed the process (echo $? / pod restart). Check kubectl get tracingpolicy shows the policy loaded on every node, not just the one you tested.
Prerequisites
Kubernetes cluster v1.24+ with Helm 3.x installed
Linux kernel 5.4+ (5.10+ recommended for full eBPF feature support)
kubectl access with cluster-admin privileges
Familiarity with eBPF concepts and Kubernetes security primitives
Core Concepts
eBPF-Based Security
Tetragon attaches eBPF programs directly to kernel functions, enabling:
Process lifecycle tracking: Monitor every process creation, execution, and termination across all pods
File integrity monitoring: Detect unauthorized reads/writes to sensitive files
Network observability: Track all TCP/UDP connections with full pod context
System call filtering: Enforce policies on dangerous syscalls like ptrace, mount, or unshare
TracingPolicy Custom Resources
Tetragon uses TracingPolicy CRDs to define what kernel events to observe and what actions to take: