π‘οΈ ML-Powered Network Security Monitoring & Threat Detection
This project transforms a basic API monitoring system into a sophisticated Machine Learning-powered Intrusion Detection System capable of real-time network traffic analysis, behavioral anomaly detection, and automated threat response.
- Isolation Forest anomaly detection for network behavior analysis
- Real-time ML inference on network traffic patterns
- Behavioral analysis to detect unusual user/system activities
- Groq API integration for advanced threat intelligence analysis
- Automated model training with synthetic and real network data
- Real-time packet capture and analysis
- Connection monitoring with protocol detection
- Network statistics and traffic pattern analysis
- Port scan detection and suspicious activity identification
- System resource monitoring (CPU, Memory, Disk usage)
- IP reputation analysis with threat scoring
- Port activity analysis for suspicious behavior detection
- Multi-layered security alerts with confidence scoring
- Threat correlation and pattern recognition
- Risk assessment with severity classification (LOW, MEDIUM, HIGH, CRITICAL)
- Real-time threat visualization with Chart.js
- Interactive security metrics and KPI monitoring
- Alert management with filtering and search capabilities
- Network topology and connection analysis
- Threat timeline and incident tracking
backend/
βββ app/
β βββ main.py # IDS API endpoints & FastAPI application
β βββ ml_models.py # ML models for anomaly detection
β βββ network_monitor.py # Network traffic monitoring & analysis
β βββ log_analyzer.py # Log analysis with Groq API
βββ requirements.txt # Python dependencies with ML libraries
βββ models/ # Trained ML model storage
Key Components:
- AnomalyDetector: Isolation Forest model for network anomaly detection
- ThreatIntelligence: IP reputation and threat scoring system
- NetworkTrafficMonitor: Real-time network connection monitoring
- SystemResourceMonitor: System performance and resource analysis
frontend/
βββ src/
β βββ components/
β β βββ SetupView.jsx # Network monitoring configuration
β β βββ VisualizerView.jsx # Threat analysis & visualization
β β βββ AlertsView.jsx # Security alerts & incident management
β βββ App.jsx # Main security dashboard application
β βββ App.css # Security-themed UI styling
βββ package.json # Frontend dependencies with Chart.js
- Python 3.11+
- Node.js 16+
- Git
git clone https://github.com/JayGadre/Barclays_Hackthon.git
cd Barclays_Hackthoncd backend
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Linux/Mac
# Install ML dependencies
pip install -r requirements.txt
# Start IDS backend
python -m uvicorn app.main:app --reload --port 8000cd frontend
# Install dependencies
npm install
# Start security dashboard
npm run dev- Security Dashboard: http://localhost:5173
- API Documentation: http://localhost:8000/docs
- Backend Health: http://localhost:8000
- Navigate to "Network Setup"
- Configure network range (e.g.,
192.168.1.0/24) - Set monitoring type: Full, Packets Only, Connections Only, or Behavioral
- Customize ML alert thresholds
- View "Threat Analysis" for real-time security visualization
- Monitor threat severity timeline with interactive charts
- Analyze network events and suspicious activities
- Review ML confidence scores and threat intelligence
- Access "Security Alerts" for incident management
- Filter alerts by severity: CRITICAL, HIGH, MEDIUM, LOW
- Search through security events and threat indicators
- Review detailed threat analysis and ML predictions
- Purpose: Detect unusual network traffic patterns
- Features: Packet size, connection duration, protocol types, port activity
- Training: Synthetic network data + real traffic patterns
- Output: Anomaly score, confidence level, threat classification
- IP Reputation: Known malicious IP database
- Port Analysis: Suspicious port activity detection
- Behavioral Patterns: User and system behavior analysis
- Risk Assessment: Multi-factor threat scoring (0-10 scale)
- Network Events: Total network connections and packet analysis
- Suspicious Activities: ML-flagged anomalous behavior
- Threat Scores: Risk assessment based on multiple factors
- Alert Severity: Categorized threat levels with automated response
- Real-time Processing: Sub-second threat detection
- ML Model Accuracy: Continuous model performance tracking
- System Resources: CPU, memory, and network utilization
- Threat Response Time: Average incident detection and alerting speed
- Real-time Network Monitoring: Continuous traffic analysis
- ML-powered Anomaly Detection: Behavioral pattern recognition
- Threat Intelligence Integration: IP reputation and threat databases
- Automated Alert System: Instant notifications for security incidents
- Multi-layered Analysis: Network, system, and behavioral monitoring
- Scalable Architecture: Designed for enterprise deployment
POST /api/network/setup- Configure network monitoringGET /api/dashboard/stats- Security dashboard statistics
GET /api/threats/analyze- Comprehensive threat analysisPOST /api/ml/analyze- ML-powered network data analysis
GET /- IDS system status and health check
- Data Preprocessing: Network traffic feature extraction
- Model Training: Automated retraining with new threat patterns
- Inference Engine: Real-time ML predictions on network data
- Model Persistence: Trained model storage and versioning
- IP Geolocation: Geographic threat analysis
- Reputation Databases: Known malicious IP and domain lists
- Behavioral Analytics: User and entity behavior analysis (UEBA)
- Threat Hunting: Proactive security threat discovery
- Interactive Charts: Real-time threat timeline visualization
- Security Metrics: KPI dashboards with threat indicators
- Alert Management: Incident response and case management
- Threat Maps: Geographic and network topology visualization
- Compliance Reporting: Security audit and compliance metrics
- Adjust anomaly detection thresholds
- Configure threat scoring parameters
- Customize alert sensitivity levels
- Train models with organization-specific data
- Define network segments and monitoring zones
- Configure protocol analysis and deep packet inspection
- Set up custom alerting rules and response actions
- Integrate with existing SIEM and security tools
π‘οΈ Transform your network security with intelligent, ML-powered threat detection!
For questions or support, please open an issue in the GitHub repository.