Overview
The Firewall ACL Agent is the enforcement endpoint of ML Defenderâs pipeline, translating ML detections into kernel-level blocking rules using IPSet and IPTables. Validated with 36,000 events across 4 stress tests, it achieves 364 events/sec throughput with 0 crypto errors.Stress Test Results
- 36K events processed (Day 52)
- 364 events/sec peak rate
- 0 crypto errors (ChaCha20-Poly1305)
- 0 decompression errors (LZ4)
Performance
- <10ms blocking latency (detection â block)
- 54% CPU max under extreme load
- 127MB RAM at peak
- Graceful degradation at capacity
Architecture
The Firewall Agent implements a config-driven architecture with no hardcoded values, ensuring production reliability:IPSet vs IPTables
- IPSet
- IPTables
- Relationship
Role: Hash table data structure for storing IP lists
- O(1) lookup complexity
- Kernel-space storage
- Automatic expiration (configurable TTL)
- Atomic updates (thread-safe)
ChaCha20-Poly1305 Decryption Pipeline
The Firewall Agent is the pipeline endpoint and only decrypts + decompresses incoming data (no downstream encryption).- Crypto Flow
- Key Exchange
- Stress Test Validation
Configuration
Single Source of Truth (Day 52 Cleanup)
All configuration is loaded fromconfig/firewall.json with no hardcoded values:
Validation Rules
Stress Test Results (Day 52)
Test Progression
- Test 1: 1K Events
- Test 2: 5K Events
- Test 3: 10K Events
- Test 4: 20K Events (Extreme)
Configuration:Results:
- Events: 1,000
- Rate: 42.6 events/sec
- CPU: N/A (too fast to measure)
- Status: â PASS
- IPSet Successes: 118
- IPSet Failures: 882 (capacity limit)
Cumulative Metrics (36K Events Total)
Capacity Planning
IPSet Capacity Limits
Realistic Capacity Planning:
Hash Size Calculation:
Multi-Tier Storage (Roadmap)
Priority 1.1 (planned):Deployment
Prerequisites
Build
1
Navigate
2
Configure
3
Compile
Run
Verify Blocking
Testing
Synthetic Data Injection
Monitor Blocking
Troubleshooting
IPSet Creation Fails
IPSet Creation Fails
Crypto Decryption Errors
Crypto Decryption Errors
IPSet Capacity Exceeded
IPSet Capacity Exceeded
Symptom: Recreate IPSet:
ipset_failures increasing in metricsSolution: Increase max_elements in config:ZMQ Connection Refused
ZMQ Connection Refused
Roadmap
Priority 1: Production Scale (2 weeks)
1
P1.1: Multi-tier Storage
Goal: Handle 500K+ IPs without performance degradation
- IPSet (hot: 1K IPs, <1Ξs lookup)
- SQLite (warm: 100K IPs, ~1ms query)
- Parquet (cold: unlimited, forensics)
2
P1.2: Async Queue + Worker Pool
Goal: 1K+ events/sec sustained throughput
- Lock-free ring buffer
- 4-8 worker threads
- Batch IPSet updates (100 IPs/operation)
3
P1.3: Capacity Monitoring + Auto-eviction
Goal: Zero operator intervention for capacity management
- LRU eviction policy
- Automatic tier migration
- Prometheus metrics export
Priority 2: Observability (1 week)
- Prometheus metrics exporter
- Grafana dashboards
- Health check endpoints (Kubernetes readiness/liveness)
- Runtime config updates via etcd
Next Steps
RAG System
Query blocked IPs using natural language
etcd Server
Manage distributed configuration and crypto keys
Monitoring
Set up Prometheus + Grafana dashboards
Performance Tuning
Optimize for 10Gbps+ environments