Repository navigation
enclave-xdp v0.1.0: Zero-Copy eBPF/XDP Pod Egress & RoCEv2 Anomaly Monitor
Built by Fox Hackerz as the Layer 3 network fabric defense companion to stverify at Layer 4.
🛡️ Layer 3 Threat Model Fit
In multi-tenant sovereign AI factories (such as multi-thousand-GPU NVIDIA B300 clusters), tenants share bare-metal physical InfiniBand and RoCEv2 fabrics. Because RDMA uses kernel-bypass (zero-copy OS bypass) to achieve microsecond tensor-parallel latency, conventional Linux userspace intrusion detection agents, iptables, and socket monitors are completely blind to east-west RDMA traffic.
enclave-xdp bridges this telemetry blind spot as described in our architecture deep dive:
📖 Zero-Trust Silicon to VRAM: Securing Multi-Tenant Sovereign AI Factories
| Layer | Security Perimeter | Implementation / Tool |
|---|---|---|
| Layer 1 | Silicon Root of Trust & Boot | NVIDIA GPU Silicon RoT + SPDM Remote Attestation |
| Layer 2 | Memory & Interconnect | CPU-to-GPU TEE Boundary + 5th-Gen NVLink Line-Rate Encryption |
| Layer 3 | Fabric & Network Boundary | enclave-xdp (XDP Driver Hook + RoCEv2 BTH Opcode & Egress LPM Trie) |
| Layer 4 | Model Weight Integrity | stverify (Pre-Load Safetensors Ed25519 Verification) |
✨ Key Features in v0.1.0
- Driver-Level XDP Interception: Inspects packets at wire speed with sub-microsecond latency before socket allocation or Linux kernel TCP/IP stack overhead.
- RoCEv2 BTH Dissection (UDP/4791): Deep packet parsing of the 12-byte InfiniBand Base Transport Header (BTH), extracting opcodes (
0x06..0x14) and 16-bit Partition Keys (P_Key). - RDMA Attack Mitigation: Drops unauthorized raw RDMA Write (
0x06..0x0B), RDMA Read (0x0C..0x10), and Atomic (0x13..0x14) operations crossing tenant boundaries (XDP_DROP). - LPM Trie CIDR Allowlist (
BPF_MAP_TYPE_LPM_TRIE): In-kernel longest-prefix match allowlist supporting arbitrary VPC/KMS/cluster subnets (/8,/12,/16,/24) and/32IPs without linear array scan overhead. - Zero-Copy Ring Buffer (
BPF_MAP_TYPE_RINGBUF): Emits compact 16-byte alert structs to userspace only when policy violations occur. Authorized traffic passes at line rate (XDP_PASS). - Pure Go Userspace CLI: Built on
cilium/ebpfwith zero CGo runtime dependencies. - SIEM & Prometheus Telemetry:
- Structured, single-line JSON alerts streamed to
stdoutfor FluentBit, Vector, and Datadog log shippers. - Built-in Prometheus metrics server (
:9090/metrics) and Kubernetes readiness/liveness probe (:9090/healthz).
- Structured, single-line JSON alerts streamed to
- Kubernetes Production DaemonSet: Included in
deploy/k8s-enclave-xdp-daemonset.yamlwith host network access, GPU taint tolerations, and BPF filesystem mounts.
📦 Quickstart
1. Download Pre-compiled Binary
# Linux x86_64
curl -LO https://github.com/foxhackerzdevs/enclave-xdp/releases/download/v0.1.0/enclave-xdp-linux-amd64
chmod +x enclave-xdp-linux-amd64
# Download compiled eBPF bytecode
curl -LO https://github.com/foxhackerzdevs/enclave-xdp/releases/download/v0.1.0/enclave_xdp.o2. Run with Custom Allowlist
sudo ./enclave-xdp-linux-amd64 \
-iface eth0 \
-obj ./enclave_xdp.o \
-allow "127.0.0.1/32,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" \
-metrics-addr :90903. Deploy Kubernetes DaemonSet
kubectl apply -f https://raw.githubusercontent.com/foxhackerzdevs/enclave-xdp/main/deploy/k8s-enclave-xdp-daemonset.yaml🐳 Container Images
ghcr.io/foxhackerzdevs/enclave-xdp:v0.1.0ghcr.io/foxhackerzdevs/enclave-xdp:latest
🔑 Checksums (SHA-256)
Please see SHA256SUMS attached to this release.