Axonwall Blackbox: Extreme eBPF Threat-LLM Harvester
ebpf-threat-harvester is Axonwall's strictly opt-in Ring-0 flight recorder and security corpus pipeline (/security/threat-harvester). It fuses wire-plane packet kinematics, kernel process/memory-execution lineage, and optional guarded TLS cleartext slices into privacy-scrubbed Causal Episode ChatML JSONL and Apache Parquet 1.0 datasets for training sovereign threat-detection LLMs.
1. Unified Multi-Plane Ring-0 eBPF Flight Recorder
Compiled from CO-RE C (apps/axonwalld/ebpf/threat_harvester.c) via bpf2go, the harvester attaches across network and host planes simultaneously and joins wire flows to process ancestry using kernel socket_cookie, cgroup_id, and pid:
tc_harvester_ingress / tc_harvester_egress)- Attached via Linux 6.6+ TCX (
link.AttachTCX). - Records the first 16 signed packet sizes and microsecond inter-arrival deltas (
iatUs). - Extracts passive TCP
JA4Toptions/MSS/scale fingerprints, TLS ClientHello SNI, and DNS label Shannon entropy. - Captures triggered Tier-1 scrubbed L7 payload slices up to
maxPayloadBytes(4096 Bdefault).
tp_harvester_exec(tracepoint/sched/sched_process_exec): tracks spawning binary & cgroup ownership.tp_harvester_memfd(tracepoint/syscalls/sys_enter_memfd_create): flags fileless RAM ELF execution in real time.uprobe_harvester_ssl_write(uprobe/SSL_write): disabled by default; attaches only to allowed non-control-plane binaries or honeypot pods.
| Capture Mode | Tier-0 Sketches & Benign Sampling | Tier-1 L7 Payload Escalation |
|---|---|---|
| adaptive (default) | Always records 16-packet flow kinematics + stratified benign negative sampling (benignSampleRate: 0.005). | Escalates on canary dark-ports (23, 2323, 3389, 4444, 5900, 6379, 9200, 27017), watchlist IPs, memfd_create, or high-entropy DNS. |
| firehose | Captures full flow sketches across specified firehoseInterfaces / firehoseNamespaces. | Continuous L7 slice harvesting subject to ring-buffer backpressure circuit breaking. |
| honeypot_only | Minimal overhead metadata mode ignoring standard production flows. | Harvests strictly dark-port probes and MCP dnat_honeypot targets. |
ebpf-tcx-uprobe-harvester, verifying CONFIG_NET_CLS_ACT, CONFIG_NET_SCH_INGRESS, CONFIG_UPROBE_EVENTS, CONFIG_TRACEPOINTS, and CONFIG_FTRACE_SYSCALLS alongside CONFIG_DEBUG_INFO_BTF=y.2. Opt-In Posture, Pre-Disk DLP & Control-Plane Exclusions
ebpf-threat-harvester ships disabled (defaultEnabled: false). Even when enabled, dangerous wildcards (*) in tlsUprobeAllowlist are rejected, and IsBinaryAllowedForTlsUprobe unconditionally blocks attachment to control-plane daemons: axonwalld, sshd, eluvix, slapd, vault, minio, k3s, containerd, systemd, and postgres.- Pre-Disk Structural DLP Redaction (
ScrubThreatPayload): Secrets—including Bearer/JWT tokens,Authorizationheaders, cookies, API keys (sk-*,AKIA*), PEM private key blocks, and passwords—are structurally masked before any episode hits disk. - Export/Ship Anonymization (
CryptoPanAnonymizer): Prefix-preserving AES-128 Crypto-PAn anonymizes IPv4 and IPv6 addresses (preserving subnet topology across packet flows and Causal DSL text) paired with HMAC-SHA256 hostname scrubbing. - Backpressure Circuit Breaker: Monitors ringbuf drops and memory bounds, shedding non-essential Tier-1 slices automatically before packet forwarding is impacted.
3. 45s Multi-Oracle Correlator & Teacher-LLM Distiller
Canary dark-port hits, active MCP dnat_honeypot tactical leases, and lsm_guard -EPERM Ring-0 blocks. Protected from FIFO eviction when pinGoldEpisodes: true.
Suricata eve.json alerts, XDP/Vigilante SOAR blocks, fileless sys_enter_memfd_create execution, and high-entropy DNS tunneling checks.
Optional OpenAI-compatible Teacher-LLM (maxCallsPerHour budget) distills MITRE ATT&CK chain-of-thought traces; operators curate episodes via /security/threat-harvester (Pin Gold, Approve Malicious, Mark Benign, Delete).
4. Dual-Track Corpus Format, ZFS Spool & Vault S3 Shipper
Spool storage under /var/lib/axonwall/threat-corpus automatically provisions a dedicated OpenZFS child dataset with compression=zstd and hard refquota when backed by OpenZFS (or byte-capped eviction that preserves pinned Gold/reviewed episodes on standard filesystems). Exporting produces a .tar.zst archive containing:
Chronological Causal Episode prompts with system, user (flow tuple, JA4T, pktSizes/IAT vector, cgroup/proc lineage, DLP-redacted payload), and assistant (MITRE ATT&CK analysis + recommended Axonwall MCP tool call) plus manifest.json checksums.
Pure-Go spec-compliant Parquet tabular matrix for classical GBDT / anomaly pre-filtering alongside LLM fine-tuning, shipped directly to MinIO / Axonwall Vault / S3 via the built-in stdlib AWS SigV4 PUT shipper.
5. Declarative /etc/axonwall/security.yaml Schema
threatHarvester:
enabled: true
captureMode: adaptive
watchedInterfaces: ["wan0", "lan0"]
canaryPorts: [23, 2323, 3389, 4444, 5900, 6379, 9200, 27017]
maxPayloadBytes: 4096
correlationWindowSec: 45
benignSampleRate: 0.005
spoolDir: /var/lib/axonwall/threat-corpus
maxSpoolGb: 10
pinGoldEpisodes: true
enableTlsUprobes: false
autoHoneypotTlsUprobes: true
anonymizeOnExport: true
teacherLlm:
enabled: false
endpoint: http://127.0.0.1:4100/v1/chat/completions
model: qwen2.5-14b-instruct
maxCallsPerHour: 30
fleetShipper:
enabled: false
endpoint: https://vault.internal:9000
region: us-east-1
bucket: axonwall-threat-corpus
prefix: nodes/
usePathStyle: true 6. CLI (axonwallctl harvester) & API Reference
# Enable the opt-in plugin in DesiredState and reconcile axonwalld sudo axonwallctl plugin enable ebpf-threat-harvester && sudo axonwallctl apply --no-confirm # Inspect live TCX/tracepoint/uprobe hook state, DLP redactions & ZFS spool quota axonwallctl harvester status # Synthesize safe test episodes (honeypot_rce_memfd | dns_c2_exfil | credential_stuffing_redacted | benign_k3s_egress) sudo axonwallctl harvester simulate honeypot_rce_memfd axonwallctl harvester episodes --limit=25 --tier=gold_malicious # Export Crypto-PAn anonymized Dual-Track .tar.zst (pass --raw for un-anonymized export) sudo axonwallctl harvester export ./axonwall-threat-corpus.tar.zst # Upload anonymized bundle to configured Vault / MinIO / S3 bucket via AWS SigV4 sudo axonwallctl harvester ship
/api/v1/security/threat-harvester/{status,episodes,export,ship} proxy authenticated RBAC sessions to axonwalld endpoints /v1/security/threat-harvester/* (including admin-gated raw application/zstd binary streaming).