Opt-In Plugin • Ring-0 TCX + Tracepoints + Uprobes • SFT/RLVR + Parquet

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:

Wire Plane (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 JA4T options/MSS/scale fingerprints, TLS ClientHello SNI, and DNS label Shannon entropy.
  • Captures triggered Tier-1 scrubbed L7 payload slices up to maxPayloadBytes (4096 B default).
Host / Container Execution & Guarded TLS Plane
  • 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 ModeTier-0 Sketches & Benign SamplingTier-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.
firehoseCaptures full flow sketches across specified firehoseInterfaces / firehoseNamespaces.Continuous L7 slice harvesting subject to ring-buffer backpressure circuit breaking.
honeypot_onlyMinimal overhead metadata mode ignoring standard production flows.Harvests strictly dark-port probes and MCP dnat_honeypot targets.
Kernel Prerequisites Audited by Custom Kernel Studio
The 25-check kernel audit includes rule 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

Strictly Opt-In with Hardcoded Control-Plane Safeguards
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, Authorization headers, 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

Gold Malicious Oracles

Canary dark-port hits, active MCP dnat_honeypot tactical leases, and lsm_guard -EPERM Ring-0 blocks. Protected from FIFO eviction when pinGoldEpisodes: true.

Silver Malicious Oracles

Suricata eve.json alerts, XDP/Vigilante SOAR blocks, fileless sys_enter_memfd_create execution, and high-entropy DNS tunneling checks.

Teacher-LLM & Operator Curation

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:

train.jsonl & val.jsonl (ChatML SFT / RLVR)

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.

features.parquet (Apache Parquet 1.0)

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

/etc/axonwall/security.yaml (compiled to 0600 /etc/axonwall/managed/threat_harvester_config.json)
yaml
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, simulate, curate, export, and ship threat corpora from the CLI
bash
# 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
HTTP & Unix Socket Endpoints
Next.js Console API routes under /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).