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:Expected output:
Terminal 1
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:Expected output:
Terminal 2
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:1000: Total number of events to generate50: Events per second rate
Monitor Blocking Activity
Expected Results
After injecting synthetic events: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
etcd server fails to start
etcd server fails to start
Symptoms: Port 2379 already in useSolution:
Crypto errors in logs
Crypto errors in logs
Symptoms:
crypto_errors > 0 in metricsSolution:- Verify etcd is running and accessible
- Check crypto token path in configs:
- Restart both ml-detector and firewall-agent to re-sync keys
IPSet capacity errors
IPSet capacity errors
Symptoms: Then destroy and recreate:
ipset_failures increasing rapidlySolution:
Increase IPSet capacity in firewall.json:No events being processed
No events being processed
Symptoms: Zero events in logsChecklist:
- ✅ etcd_server running?
- ✅ firewall-acl-agent connected to ZMQ?
- ✅ synthetic_ml_output_injector running?
- ✅ Check ZMQ endpoint matches:
Success! You now have ML Defender running with encrypted transport and autonomous blocking.