Advanced Network Defense & Intrusion Prevention System
A sophisticated, multi-layer defensive security platform leveraging behavioral analysis, anomaly detection, and adaptive threat response mechanisms for real-time protection against sophisticated cyber threats.
TONACO Defensive Edition is a production-grade IPS/IDS system engineered for enterprise-scale deployment. The architecture integrates kernel-level packet inspection, machine learning-based threat classification, and dynamic firewall orchestration to establish comprehensive network perimeter defense.
- Packet-Level Inspection: Deep packet inspection (DPI) with stateful firewall rules
- Behavioral Analysis Engine: ML-based anomaly detection with adaptive thresholds
- Threat Intelligence Integration: Real-time threat feed correlation and enrichment
- Dynamic Rate Limiting: Adaptive traffic shaping and congestion mitigation
- Protocol Analysis: Application-layer protocol normalization and validation
- Automated Incident Response: Configurable automated countermeasures and isolation protocols
- SIEM Integration: Structured logging with CEF/Syslog export capabilities
┌─────────────────────────────────────────────────────────┐
│ Network Interface │
└────────────────┬────────────────────────────────────────┘
│
┌───────▼─────────┐
│ Packet Capture│ (libpcap/AF_PACKET)
└───────┬─────────┘
│
┌────────────┼────────────┐
│ │ │
┌───▼───┐ ┌────▼────┐ ┌───▼───┐
│Protocol│ │ Behavior│ │Threat │
│ Parser │ │ Analysis│ │Feed │
└───┬───┘ └────┬────┘ └───┬───┘
│ │ │
└───────────┼───────────┘
┌───▼──────────┐
│Classification│
│ Engine │
└───┬──────────┘
│
┌───────▼────────┐
│ Policy Manager │
│ & Orchestrator │
└───┬────────────┘
│
┌───────┴────────┐
│ │
┌───▼────┐ ┌───▼─────┐
│Firewall│ │ Event │
│ Rules │ │ Logging │
└────────┘ └─────────┘
- OS: Linux 4.4+ (kernel BPF support required)
- Architecture: x86_64, ARM64
- Memory: Minimum 4GB RAM, recommended 16GB+
- Storage: 50GB+ for logging (depends on traffic volume)
- Dependencies:
- libpcap >= 1.9.0
- libnfnetlink >= 1.0.1
- libnetfilter_queue >= 1.0.2
- Python 3.8+
- GCC 7.0+
| Metric | Specification |
|---|---|
| Throughput | Up to 100Gbps (with hardware acceleration) |
| Latency | < 50ms average packet processing |
| Rule Evaluation | 50,000+ rules per second |
| Memory Footprint | ~2GB base + per-connection state |
| CPU Scaling | Linear with core count (multi-threaded) |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libpcap-dev \
libnfnetlink-dev \
libnetfilter-queue-dev \
python3-dev \
python3-pipgit clone https://github.com/Tonaco97/tonaco-defensive.git
cd tonaco-defensive
# Build C/C++ components
make clean && make
# Install Python dependencies
pip3 install -r requirements.txt
# Install system-wide
sudo make installsudo cp config/tonaco.conf.example /etc/tonaco/tonaco.conf
sudo nano /etc/tonaco/tonaco.confsudo systemctl enable tonaco-defensive
sudo systemctl start tonaco-defensive
# Verify
sudo systemctl status tonaco-defensivefrom tonaco_defensive import TonacoCoreEngine, ThreatAnalyzer
# Initialize engine
engine = TonacoCoreEngine(
interface='eth0',
filter_rules='config/rules.bpf',
threat_threshold=0.75
)
# Start monitoring
engine.start()
# Access real-time statistics
stats = engine.get_statistics()
print(f"Packets processed: {stats['packets_processed']}")
print(f"Threats detected: {stats['threats_detected']}")# Custom threat intelligence
engine.load_threat_intel('feeds/custom-iocs.json')
# Dynamic rule injection
engine.add_firewall_rule(
source='10.0.0.0/8',
destination='any',
action='DROP',
reason='Unauthorized internal segment'
)
# Enable ML-based anomaly detection
engine.enable_ml_detection(
model='models/behavior-classifier.pkl',
sensitivity='high'
)# Real-time threat monitoring
sudo tonaco-cli monitor --interface eth0 --verbose
# Apply threat feed updates
sudo tonaco-cli threat-intel --update
# Generate security report
sudo tonaco-cli report --format json --output report.json
# Performance tuning
sudo tonaco-cli tune --optimize-memory --workers 8class TonacoCoreEngine:
def start(self) -> None
def stop(self) -> None
def add_firewall_rule(self, rule: FirewallRule) -> bool
def remove_firewall_rule(self, rule_id: str) -> bool
def get_statistics(self) -> Dict[str, Any]
def load_threat_intel(self, path: str) -> None
def enable_ml_detection(self, model: str, sensitivity: str) -> Noneclass ThreatAnalyzer:
def classify_packet(self, packet: Packet) -> ThreatClassification
def extract_indicators(self, packet: Packet) -> List[IOC]
def correlate_threats(self, indicators: List[IOC]) -> ThreatCorrelation
def generate_report(self) -> SecurityReportCEF:0|Tonaco|Defensive|1.0|threat:detected|High Risk Packet|8|src=192.168.1.100 dst=10.0.0.50 proto=TCP behavior_score=0.89 action=BLOCK
# Configure syslog export
sudo tonaco-cli config --syslog-server 192.168.1.10:514 --facility local0# Start web dashboard (port 8443)
sudo tonaco-dashboard &
# Access at https://localhost:8443/# Increase packet buffer
sudo sysctl -w net.core.rmem_max=134217728
sudo sysctl -w net.core.rmem_default=134217728
# Enable BPF JIT compilation
sudo sysctl -w net.core.bpf_jit_enable=1engine = TonacoCoreEngine(
workers=8, # Number of worker threads
buffer_size=100000, # Packet buffer size
batch_processing=True
)Supported feeds:
- STIX 2.0 / TAXII 2.0 format indicators
- Custom JSON IOC format
- MISP instance integration
- AlienVault OTX (native support)
- Commercial feeds (via integration layer)
from tonaco_defensive.ml import BehaviorClassifier
classifier = BehaviorClassifier()
classifier.train(dataset='training/benign.pcap', labels='labels.csv')
classifier.save('models/custom-behavior.pkl')
engine.enable_ml_detection(model='models/custom-behavior.pkl')from tonaco_defensive.protocols import ProtocolAnalyzer
class CustomProtoAnalyzer(ProtocolAnalyzer):
def analyze(self, packet):
# Custom analysis logic
return analysis_result
engine.register_protocol_analyzer('custom_proto', CustomProtoAnalyzer())# Run test suite
make test
# Benchmark performance
python3 tests/benchmark.py --duration 60 --traffic-type mixed
# Pcap replay testing
tonaco-test replay --pcap tests/samples/attack.pcap --expected-detections 42This is a proprietary security tool. Contributions are not accepted.
MIT License - See LICENSE file for details.
Attribution Required: If you use TONACO Defensive Edition in your security infrastructure, please attribute to:
TONACO Defensive Edition
Copyright (c) 2024 Guilherme Lucas Tonaco Carvalho
Licensed under MIT License
- Technical Documentation:
/docs/technical/ - Configuration Guide:
/docs/configuration/ - Threat Analysis Guide:
/docs/threat-analysis/ - API Reference:
/docs/api/
For security vulnerabilities, please contact: tonacoecarvalho.adv@gmail.com
TONACO Defensive Edition v1.0 Advanced Network Defense & Intrusion Prevention System