Installation & Deployment
Docker Deployment
Section titled “Docker Deployment”Deploy SecBeat using Docker for quick testing and development environments.
Single Mitigation Node
Section titled “Single Mitigation Node”# Build the image (expected: successful build in 2-4 minutes)docker build -t secbeat/mitigation-node:latest .# Expected output:# Successfully built abc123def456# Successfully tagged secbeat/mitigation-node:latest
# Run with auto-generated certificates (development)docker run -d \ --name secbeat-mitigation \ -p 8443:8443 \ -p 9090:9090 \ -e SECBEAT_CONFIG=config.dev \ -e RUST_LOG=info \ -e SECBEAT_AUTO_GENERATE_CERTS=true \ secbeat/mitigation-node:latestProduction Mode
Section titled “Production Mode”# Run with custom certificatesdocker run -d \ --name secbeat-mitigation \ -p 8443:8443 \ -p 9090:9090 \ -v /path/to/certs:/app/certs:ro \ -v /path/to/config.prod.toml:/app/config.prod.toml:ro \ -e SECBEAT_CONFIG=config.prod \ -e RUST_LOG=info \ -e SYN_COOKIE_SECRET=$(openssl rand -hex 32) \ secbeat/mitigation-node:latestDocker Compose Deployment
Section titled “Docker Compose Deployment”Full-stack deployment with all services orchestrated together.
Quick Start
Section titled “Quick Start”# Start all services (expected: all containers start successfully)docker-compose up -d# Expected output:# Creating network "secbeat_secbeat-network" done# Creating secbeat-nats ... done# Creating secbeat-mitigation ... done
# View logsdocker-compose logs -f mitigation-node
# Check statusdocker-compose ps
# Stop servicesdocker-compose downServices Included
Section titled “Services Included”| Service | Description | Ports |
|---|---|---|
| Mitigation Node | Main proxy service with DDoS protection | 8443, 9090, 9191, 9999 |
| Orchestrator | Fleet management and control plane | 3030, 9091 |
| NATS | High-performance message broker | 4222, 8222 |
| Prometheus | Metrics collection and monitoring | 9092 |
Environment Configuration
Section titled “Environment Configuration”Create a .env file:
# ConfigurationSECBEAT_CONFIG=config.devRUST_LOG=info
# SecuritySYN_COOKIE_SECRET=your-secret-hereMANAGEMENT_API_KEY=your-api-key-hereORCHESTRATOR_API_KEY=your-orchestrator-key-here
# TLSSECBEAT_AUTO_GENERATE_CERTS=trueSECBEAT_HOSTNAME=localhostKubernetes Deployment
Section titled “Kubernetes Deployment”Production-grade deployment with high availability and auto-scaling.
Prerequisites
Section titled “Prerequisites”- Kubernetes cluster 1.20+
- kubectl configured
- Helm 3.x (optional)
- Ingress controller
Deploy Mitigation Nodes
Section titled “Deploy Mitigation Nodes”apiVersion: apps/v1kind: Deploymentmetadata: name: secbeat-mitigation namespace: secbeatspec: replicas: 3 selector: matchLabels: app: secbeat-mitigation template: metadata: labels: app: secbeat-mitigation spec: containers: - name: mitigation-node image: secbeat/mitigation-node:latest ports: - containerPort: 8443 - containerPort: 9090 env: - name: SECBEAT_CONFIG value: "config.prod" - name: RUST_LOG value: "info" resources: requests: memory: "256Mi" cpu: "500m" limits: memory: "1Gi" cpu: "2000m"Horizontal Pod Autoscaler
Section titled “Horizontal Pod Autoscaler”apiVersion: autoscaling/v2kind: HorizontalPodAutoscalermetadata: name: secbeat-mitigation-hpaspec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: secbeat-mitigation minReplicas: 3 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70Bare Metal / VM Deployment
Section titled “Bare Metal / VM Deployment”Direct installation on Linux servers for maximum performance.
System Requirements
Section titled “System Requirements”Hardware
Section titled “Hardware”- CPU: 4+ cores
- RAM: 4GB minimum, 8GB recommended
- Storage: 20GB SSD
- Network: 1Gbps+ NIC
Software
Section titled “Software”- OS: Ubuntu 22.04+ / RHEL 8+
- Rust: 1.78+
- OpenSSL: 1.1.1+
- systemd
Installation Steps
Section titled “Installation Steps”# 1. Build release binarycargo build --release --workspace
# 2. Install binarysudo cp target/release/mitigation-node /usr/local/bin/sudo chmod +x /usr/local/bin/mitigation-node
# 3. Set capabilities (for SYN proxy)sudo setcap cap_net_raw,cap_net_admin+ep /usr/local/bin/mitigation-node
# 4. Create configuration directorysudo mkdir -p /etc/secbeatsudo cp config.prod.toml /etc/secbeat/
# 5. Install systemd servicesudo cp systemd/secbeat-mitigation.service /etc/systemd/system/sudo systemctl daemon-reloadsudo systemctl enable secbeat-mitigationsudo systemctl start secbeat-mitigationProduction Considerations
Section titled “Production Considerations”:::danger Important Production Requirements Before deploying to production, ensure all security measures are in place. :::
Security Hardening
Section titled “Security Hardening”- ✓ Generate strong SYN cookie secrets
- ✓ Use valid TLS certificates (Let’s Encrypt or commercial)
- ✓ Change all default API keys
- ✓ Configure firewall rules
- ✓ Enable rate limiting
- ✓ Set up log aggregation
- ✓ Configure backup and disaster recovery
- ✓ Implement secret rotation policy
Performance Tuning
Section titled “Performance Tuning”# High traffic configuration[network]max_connections = 100000buffer_size = 65536tcp_nodelay = true
[ddos.rate_limiting]global_requests_per_second = 100000per_ip_requests_per_second = 1000
[performance]worker_threads = 8io_uring_enabled = trueSecurity Best Practices
Section titled “Security Best Practices”TLS Configuration
Section titled “TLS Configuration”[tls]enabled = truecert_path = "/etc/secbeat/certs/cert.pem"key_path = "/etc/secbeat/certs/key.pem"
# Strong cipher suites onlycipher_suites = [ "TLS_AES_256_GCM_SHA384", "TLS_AES_128_GCM_SHA256", "TLS_CHACHA20_POLY1305_SHA256"]
# TLS 1.3 onlymin_tls_version = "1.3"API Security
Section titled “API Security”[management_api]enabled = truebind_address = "127.0.0.1:9999"api_key_header = "X-SecBeat-API-Key"require_https = truerate_limit_per_minute = 100Monitoring Setup
Section titled “Monitoring Setup”Prometheus Configuration
Section titled “Prometheus Configuration”scrape_configs: - job_name: 'secbeat-mitigation' static_configs: - targets: ['localhost:9090'] scrape_interval: 15s
- job_name: 'secbeat-orchestrator' static_configs: - targets: ['localhost:9091'] scrape_interval: 30sKey Metrics to Monitor
Section titled “Key Metrics to Monitor”| Category | Metrics |
|---|---|
| Traffic | secbeat_packets_processed_totalsecbeat_requests_per_secondsecbeat_bandwidth_bytes |
| Security | secbeat_attacks_blocked_totalsecbeat_waf_rules_triggeredsecbeat_rate_limit_exceeded |
| Performance | secbeat_latency_secondssecbeat_cpu_usage_percentsecbeat_memory_usage_bytes |
Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Permission denied for raw sockets
Section titled “Permission denied for raw sockets”sudo setcap cap_net_raw,cap_net_admin+ep /usr/local/bin/mitigation-nodeTLS handshake failures
Section titled “TLS handshake failures”Check certificate validity and permissions:
openssl x509 -in cert.pem -text -nooutls -l /path/to/certs/High memory usage
Section titled “High memory usage”Adjust connection limits:
[network]max_connections = 10000 # Reduce if neededbuffer_size = 32768 # Smaller buffersDebug Mode
Section titled “Debug Mode”# Enable debug loggingRUST_LOG=debug SECBEAT_CONFIG=config.dev ./mitigation-node
# Trace specific modulesRUST_LOG=mitigation_node::syn_proxy=trace ./mitigation-nodeNext Steps
Section titled “Next Steps”- Quick Start - Get started quickly
- Configuration Reference - Configuration options
- API Reference - API documentation