Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement eBPF-based runtime security observability and enforcement in Kubernetes clusters using Cilium Tetragon for kernel-level threat detection and policy enforcement.
.claude/skills/implementing-runtime-security-with-tetragon/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | — | — |
| case-15 | ✗→✓ | ▲ Improved | — | — |
| case-04 | ✗→✓ | ▲ Improved | — | — |
| case-03 | ✗→✓ | ▲ Improved | — | — |
| case-02 | ✗→✓ | ▲ Improved | — | — |
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.
Tetragon attaches eBPF programs directly to kernel functions, enabling:
Tetragon uses TracingPolicy CRDs to define what kernel events to observe and what actions to take:
yamlapiVersion: cilium.io/v1alpha1 kind: TracingPolicy metadata: name: detect-privilege-escalation spec: kprobes: - call: "security_bprm_check" syscall: false args: - index: 0 type: "linux_binprm" selectors: - matchBinaries: - operator: "In" values: - "/bin/su" - "/usr/bin/sudo" - "/usr/bin/passwd" matchNamespaces: - namespace: Pid operator: NotIn values: - "host_ns" matchActions: - action: Post
Tetragon can take three types of actions directly in the kernel:
bashhelm repo add cilium https://helm.cilium.io helm repo update helm install tetragon cilium/tetragon \ --namespace kube-system \ --set tetragon.enableProcessCred=true \ --set tetragon.enableProcessNs=true \ --set tetragon.grpc.address="localhost:54321"
bashGOOS=$(go env GOOS) GOARCH=$(go env GOARCH) curl -L --remote-name-all \ https://github.com/cilium/tetragon/releases/latest/download/tetra-${GOOS}-${GOARCH}.tar.gz tar -xzvf tetra-${GOOS}-${GOARCH}.tar.gz sudo install tetra /usr/local/bin/
bashkubectl get pods -n kube-system -l app.kubernetes.io/name=tetragon tetra status
Create a TracingPolicy to detect processes attempting to escape container namespaces:
yamlapiVersion: cilium.io/v1alpha1 kind: TracingPolicy metadata: name: detect-container-escape spec: kprobes: - call: "__x64_sys_setns" syscall: true args: - index: 0 type: "int" - index: 1 type: "int" selectors: - matchNamespaces: - namespace: Pid operator: NotIn values: - "host_ns" matchActions: - action: Sigkill
Detect reads of sensitive credentials:
yamlapiVersion: cilium.io/v1alpha1 kind: TracingPolicy metadata: name: monitor-sensitive-files spec: kprobes: - call: "security_file_open" syscall: false args: - index: 0 type: "file" selectors: - matchArgs: - index: 0 operator: "Prefix" values: - "/etc/shadow" - "/etc/kubernetes/pki" - "/var/run/secrets/kubernetes.io" matchActions: - action: Post
Prevent known crypto-mining binaries from executing:
yamlapiVersion: cilium.io/v1alpha1 kind: TracingPolicy metadata: name: block-cryptominers spec: kprobes: - call: "security_bprm_check" syscall: false args: - index: 0 type: "linux_binprm" selectors: - matchBinaries: - operator: "In" values: - "/usr/bin/xmrig" - "/tmp/xmrig" - "/usr/bin/minerd" matchActions: - action: Sigkill
Stream runtime events in real-time:
bash# Watch all process execution events kubectl exec -n kube-system ds/tetragon -c tetragon -- \ tetra getevents -o compact --process-only # Filter events for a specific namespace kubectl exec -n kube-system ds/tetragon -c tetragon -- \ tetra getevents -o compact --namespace production # Export events in JSON for SIEM integration kubectl exec -n kube-system ds/tetragon -c tetragon -- \ tetra getevents -o json | tee /var/log/tetragon-events.json
yaml# tetragon-helm-values.yaml export: stdout: enabledCommand: true enabledArgs: true filenames: - /var/log/tetragon/tetragon.log elasticsearch: enabled: true url: "https://elasticsearch.monitoring:9200" index: "tetragon-events"
Tetragon exposes metrics at :2112/metrics:
yamlapiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: tetragon-metrics namespace: kube-system spec: selector: matchLabels: app.kubernetes.io/name: tetragon endpoints: - port: metrics interval: 15s
| Metric | Description | Alert Threshold | |--------|-------------|-----------------| | tetragon_events_total | Total security events observed | Spike > 3x baseline | | tetragon_policy_events_total | Events matching TracingPolicies | Any Sigkill action | | tetragon_process_exec_total | Process executions tracked | Anomalous new binaries | | tetragon_missed_events_total | Dropped events due to buffer overflow | > 0 sustained |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-09 | pass→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-01 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-13 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-14 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-22 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-11 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-21 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-15 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-06 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-05 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-08 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-20 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-16 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-04 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-18 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-10 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-03 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-07 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-12 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-02 | fail→pass | — | — | — | — | — | — | — | — | — | — | — | — |
case-17 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
case-19 | fail→fail | — | — | — | — | — | — | — | — | — | — | — | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
The per-case answers from this run were removed by the retention sweep, so the case table below shows the verdicts without the text either arm produced. The counts above were recorded at the time and are unaffected. Answers are now kept for 180 days.
Other measured skills in the registry, with their headline benchmark lift.