ebpf-threat-detection
eBPF Threat Detection, Tetragon, Falco, and Kernel Syscall Interception
от j4flmao★ 47 звёзд на GitHub
Установить ebpf-threat-detection в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
eBPF-Based Threat Detection and Kernel Instrumentation
Purpose
Explain how eBPF enables low-overhead, high-fidelity runtime threat detection on Linux: the load/verify/JIT lifecycle, syscall interception via kprobes/tracepoints/LSM-BPF, and tools (Falco, Tetragon). Guides defenders building kernel-level detection and enforcement.
Agent Protocol
Trigger
User phrases: "eBPF threat detection", "Falco rules", "Tetragon", "syscall interception", "LSM BPF enforcement", "kprobe vs tracepoint".
Input Context
- Kernel version and distro (affects BTF/CO-RE and available hooks).
- Detection vs active blocking requirement.
Output Artifact
Detection design, hook selection rationale, and Falco/Tetragon rule concepts.
Response Format
Hook: {kprobe|tracepoint|LSM-BPF}
Event: {syscall/behavior}
Action: {audit | alert | block}
Tool: {Falco | Tetragon | libbpf}
Extended Berkeley Packet Filter (eBPF) revolutionized Linux observability and security by allowing sandboxed programs to run within the kernel space without requiring kernel module compilation or system reboots. This is critical for low-overhead, high-fidelity threat detection.
eBPF Architecture
eBPF programs are event-driven. They attach to specific kernel hooks (kprobes, tracepoints, network events). When the hook is triggered, the eBPF program executes.
- Compilation: eBPF programs (typically written in restricted C) are compiled into eBPF bytecode using LLVM/Clang.
- Loading: A user-space application (via the
bpf()syscall) loads the bytecode into the kernel. - Verification: The kernel's eBPF verifier analyzes the bytecode to ensure it's safe (no infinite loops, memory bounds checking, restricted helper functions).
- JIT Compilation: The bytecode is Just-In-Time (JIT) compiled into native machine code for performance.
- Execution & Data Export: The program runs contextually. It shares data with user-space via eBPF Maps (hash tables, arrays, ring buffers).
Intercepting Malicious Syscalls
Syscalls are the interface between user-space and kernel-space. Monitoring them is fundamental to detecting malicious behavior (e.g., execve for process execution, ptrace for memory injection, bpf for illicit eBPF loading).
- kprobes/kretprobes: Allow dynamic instrumentation of kernel function entry (
kprobe) and exit (kretprobe). Useful for inspecting arguments passed to syscall handlers (e.g.,sys_execve). - Tracepoints: Static, defined hooks placed by kernel developers in the source code. They are more stable across kernel versions than kprobes.
- LSM (Linux Security Modules) BPF: Allows eBPF programs to attach to LSM hooks (like those used by SELinux/AppArmor), enabling not just auditing, but active blocking (returning an error code to the syscall) without writing a traditional LSM.
Falco: Behavioral Threat Detection
Falco acts as an intrusion detection system for cloud-native environments.
- Mechanism: Originally relied on a kernel module or eBPF probe to capture system calls. It streams these events (contextualized with container/Kubernetes metadata) to a user-space rules engine.
- Rules: Uses a domain-specific language (YAML) to define anomalous behavior (e.g., "A shell was spawned inside a container").
- Limitation: Historically focused on detection (alerting) rather than enforcement (blocking), though integrations exist for response. It captures events asynchronously, meaning a malicious action might complete before the alert is processed.
Tetragon: Transparent Kernel Enforcement
Tetragon (by Isovalent/Cilium) leverages advanced eBPF capabilities for both deep observability and inline enforcement.
- Mechanism: Uses eBPF programs deeply integrated into kernel subsystems. It correlates network, process, and file access events.
- Synchronous Enforcement: Tetragon can use eBPF to synchronously block actions. If a policy dictates that a binary should not execute, the eBPF program attached to the relevant kernel hook can return a failure before the execution proceeds.
- In-Kernel Filtering: Unlike older tools that send massive amounts of raw syscall data to user-space for filtering, Tetragon performs complex filtering directly in the kernel via eBPF, drastically reducing overhead.
Architecture Mapping
%%{init: {"theme": "default", "flowchart": {"useMaxWidth": true}}}%%
flowchart TD
UserSpace[User Space Application] -->|"1. Executes Syscall (e.g., execve)"| KernelSyscall[Kernel Syscall Interface]
KernelSyscall -->|2. Triggers Hook| eBPFHook{eBPF Hook: kprobe / tracepoint / LSM}
subgraph KernelSpaceKernelSpace ["Kernel Space<br><br><br>"]
eBPFHook -->|3. Executes| eBPFProg[eBPF Program]
eBPFProg -->|4. Evaluates Policy| PolicyEval{Policy Match?}
PolicyEval -->|5a. Block: Return Error| LSMEnforce[Syscall Denied - ENOPERM]
PolicyEval -->|5b. Allow & Audit| eBPFMap
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл ebpf-threat-detection?
eBPF Threat Detection, Tetragon, Falco, and Kernel Syscall Interception
Как установить скилл ebpf-threat-detection?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ebpf-threat-detection запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…