🚀 Sauron-Pro Fleet Management System

📋 Overview

The Fleet Management System allows you to deploy and control multiple Sauron-Pro instances across different VPS servers from a centralized master controller. This creates a distributed MITM network that can be managed from a single admin interface.

Key Benefits:
  • Centralized control of multiple VPS instances
  • Automated registration and heartbeat monitoring
  • Remote command execution across the fleet
  • Real-time status monitoring and alerts
  • Scalable architecture (100+ VPS support)

🏗️ Architecture

Master Controller (master.example.com:8443) ├── Fleet Management API ├── VPS Registration & Heartbeat ├── Command Dispatch System └── Centralized Monitoring Connected VPS Instances ├── VPS-001 (vps1.example.com) ├── VPS-002 (vps2.example.com) ├── VPS-003 (vps3.example.com) └── ... (up to 100+ VPS instances)

🏛️ Master Controller

  • Location: Single server (e.g., master.example.com)
  • Purpose: Central command and control
  • Features:
    • VPS registration & heartbeat monitoring
    • Command dispatch to VPS instances
    • Fleet-wide statistics
    • Script execution management
    • Real-time status dashboard

🖥️ VPS Agents

  • Location: Each individual VPS server
  • Purpose: Local MITM operations + master communication
  • Features:
    • Automatic registration with master
    • Periodic heartbeat (every 5 minutes)
    • Command receiver for remote operations
    • Local credential capture
    • Script execution via master commands

⚙️ Installation

🎯 Deployment Workflow

Step 1: Deploy Master Controller
export DOMAIN=master.example.com sudo ./scripts/deploy-fleet-master.sh
Step 2: Deploy VPS Agents (on each VPS)
export MASTER_URL=https://master.example.com:8443 export VPS_ID=vps-001 export VPS_DOMAIN=vps1.example.com sudo ./scripts/deploy-vps-agent.sh
Step 3: Verify Fleet
/opt/sauron-pro/bin/fleet-status /opt/sauron-pro/bin/fleet-command vps-001 status

📋 Prerequisites

Master Controller Requirements:
  • Linux server with root access
  • Go 1.19+ installed
  • Domain pointing to server
  • SSL certificate configured
VPS Agent Requirements:
  • Linux VPS with root access
  • Go 1.19+ installed
  • Network connectivity to master controller

🎮 Usage

Fleet Management Commands

# View all VPS instances /opt/sauron-pro/bin/fleet-status # Send command to specific VPS /opt/sauron-pro/bin/fleet-command <vps-id> <command> [payload]

Available Commands

CommandDescriptionExample
statusGet VPS status and statisticsfleet-command vps-001 status
restartRestart VPS servicefleet-command vps-001 restart
scriptExecute script on VPSfleet-command vps-001 script '{"script": "update.sh"}'
configUpdate VPS configurationfleet-command vps-001 config
updateUpdate VPS softwarefleet-command vps-001 update

🔌 API Reference

Master Controller APIs

POST /fleet/register Content-Type: application/json X-VPS-ID: vps-001 { "ip": "192.168.1.100", "domain": "vps-001.example.com", "admin_domain": "admin.vps-001.example.com", "version": "v2.0.1", "location": "US-East" }
GET /fleet/instances Response: { "success": true, "instances": [ { "id": "vps-001", "ip": "192.168.1.100", "domain": "vps-001.example.com", "status": "active", "last_seen": "2025-08-17T10:30:00Z", "location": "US-East", "version": "v2.0.1" } ], "fleet_stats": { "total_vps": 5, "active_vps": 4 } }
POST /fleet/command Content-Type: application/json { "vps_id": "vps-001", "command": "status", "payload": {} }

⚙️ Configuration

Master Controller Configuration

Location: /etc/sauron-pro/fleet-config.json

{ "fleet_master": { "domain": "master.example.com", "port": 8443, "max_vps_instances": 100, "heartbeat_timeout": 600, "command_timeout": 30, "database": { "path": "/opt/sauron-pro/data/fleet.db", "backup_interval": 3600 }, "security": { "require_vps_auth": true, "max_command_rate": 10, "allowed_commands": ["status", "restart", "script", "config", "update"] } } }

VPS Agent Configuration

Location: /etc/sauron-pro/vps-config.json

{ "vps_agent": { "id": "vps-001", "domain": "vps-001.example.com", "location": "US-East", "master_url": "https://master.example.com:8443", "heartbeat_interval": 300, "command_port": 8444, "security": { "enable_auth": true, "max_command_rate": 5 } } }

📊 Monitoring & Maintenance

Log Locations

ComponentService LogsError LogsSystem Logs
Master Controller /var/log/sauron-pro/fleet-master.log /var/log/sauron-pro/fleet-master-error.log journalctl -u sauron-fleet-master
VPS Agent /var/log/sauron-pro/vps-agent.log /var/log/sauron-pro/vps-agent-error.log journalctl -u sauron-vps-agent

Health Monitoring

# View all VPS instances and their status curl -s https://master.example.com:8443/fleet/instances | jq '.' # Check specific VPS curl -s https://master.example.com:8443/fleet/instances | jq '.instances[] | select(.id=="vps-001")'
Heartbeat System:
  • VPS instances send heartbeat every 5 minutes
  • Master marks VPS as inactive after 10 minutes without heartbeat
  • Automatic alerts when VPS goes offline

💡 Examples

Execute Script on Specific VPS

/opt/sauron-pro/bin/fleet-command vps-001 script '{"script": "update-sauron-template.sh"}'

Execute Script on All Active VPS

# Get all active VPS IDs VPS_LIST=$(curl -s https://master.example.com:8443/fleet/instances | jq -r '.instances[] | select(.status=="active") | .id') # Execute script on each for vps in $VPS_LIST; do /opt/sauron-pro/bin/fleet-command $vps script '{"script": "cleanup-logs.sh"}' done

Best Practices

  1. VPS Naming Convention: Use descriptive IDs (us-east-001, eu-west-002)
  2. Regular Monitoring: Check fleet status daily
  3. Staged Deployments: Test commands on single VPS before fleet-wide
  4. Backup Strategy: Regular database backups on master controller
  5. Security Updates: Keep all instances updated
  6. Geographic Distribution: Spread VPS across different regions
  7. Capacity Planning: Monitor resource usage and scale appropriately

🔧 Troubleshooting

VPS Not Registering

  1. Check network connectivity to master controller
  2. Verify MASTER_URL configuration
  3. Check firewall rules (port 8443)
  4. Review VPS agent logs

Commands Not Executing

  1. Verify VPS is active and responsive
  2. Check command syntax and payload
  3. Review VPS agent command receiver logs
  4. Ensure command is in allowed commands list

Performance Issues

  1. Monitor heartbeat intervals
  2. Check database performance on master
  3. Review resource usage on VPS instances
  4. Consider scaling master controller