Skip to main content

Prerequisites

ML Defender requires a Linux system with kernel 6.1.0+ for eBPF/XDP support.

System Requirements

  • OS: Debian 12 (Bookworm) or Ubuntu 22.04+
  • Kernel: 6.1.0 or higher (for eBPF)
  • RAM: 8GB minimum (16GB recommended)
  • CPU: 4+ cores
  • Network: Dual-NIC recommended for gateway mode

Install Dependencies

On Debian/Ubuntu, install all required packages:
For production deployments, see the Installation Guide for detailed dependency installation and optimization.

Quick Start

1

Clone Repository

Clone the ML Defender repository and navigate to the source directory:
Verify the repository structure:
2

Build Components

Build all ML Defender components using the build script:
Or build components individually:
Verify binaries were created:
3

Start etcd Server

Start the etcd server for distributed configuration and crypto key exchange:
Terminal 1
Expected output:
The etcd server manages crypto seed exchange between ml-detector and firewall-agent using ChaCha20-Poly1305 encryption.
4

Start Firewall Agent

In a new terminal, start the firewall ACL agent:
Terminal 2
Expected output:
5

Verify System Status

Check that all components are running and communicating:
Healthy system indicators:
  • ✅ etcd_server running on port 2379
  • ✅ firewall-acl-agent connected to ZMQ
  • ✅ IPSet created with 0 blocked IPs initially
  • ✅ No crypto/decompression errors in logs

Test with Synthetic Data

Generate synthetic attack events to test the complete pipeline:

Build Synthetic Injector

Inject Attack Events

Generate 1000 events at 50 events/second:
Parameters:
  • 1000: Total number of events to generate
  • 50: Events per second rate

Monitor Blocking Activity

Expected Results

After injecting synthetic events:
IPSet has a capacity limit (default: 1000 IPs). When full, new IPs are queued. See Configuration for tuning.

Verify Detection Pipeline

Confirm the complete pipeline is operational:
1

Check Crypto Pipeline

Verify encrypted communication is working:
2

Verify Blocking Actions

Check that IPs are being added to IPSet:
3

Test Actual Blocking

Verify IPTables DROP rules are active:
Expected output:

Stop Services

Gracefully shut down all components:

Next Steps

Installation Guide

Detailed installation for production environments, Docker, and Vagrant

Configuration

Configure components, tune performance, and customize detection thresholds

Architecture

Understand the ML pipeline, crypto transport, and eBPF packet capture

Gateway Mode

Deploy dual-NIC gateway mode to protect entire networks

Troubleshooting

Symptoms: Port 2379 already in useSolution:
Symptoms: crypto_errors > 0 in metricsSolution:
  1. Verify etcd is running and accessible
  2. Check crypto token path in configs:
  3. Restart both ml-detector and firewall-agent to re-sync keys
Symptoms: ipset_failures increasing rapidlySolution: Increase IPSet capacity in firewall.json:
Then destroy and recreate:
Symptoms: Zero events in logsChecklist:
  1. ✅ etcd_server running?
  2. ✅ firewall-acl-agent connected to ZMQ?
  3. ✅ synthetic_ml_output_injector running?
  4. ✅ Check ZMQ endpoint matches:
Success! You now have ML Defender running with encrypted transport and autonomous blocking.