How nitish419/ai-cybersecurity-threat-detection works
This repository is a synthetic network-threat detection demo with a Streamlit SOC dashboard and a separate looping traffic simulator. The main workflow generates flow data, preprocesses and splits it, trains supervised and anomaly-detection models, evaluates them, and writes SOC alerts and a confusion-matrix image for the dashboard. The README describes the two detection approaches and automated response playbooks. The sampled sniffer simulates traffic rather than capturing packets; no connection from its output to the dashboard or detection pipeline is shown.
Main entry points: app.py SOC Dashboard · main.py SOC Alert Generation · live_sniffer.py Live Traffic Simulator
Components 15
SOC Interface
- SOC Dashboard
app.py - Train-Test Split
app.py
Detection Pipeline
- Pipeline Setup
main.py - Synthetic Flow Generator
main.py - Preprocessing
main.py - Model Training
main.py - Random Forest
main.py - Isolation Forest
main.py - Model Evaluation
main.py - SOC Alert Generation
main.py - Alert CSV
main.py - Confusion Matrix Image
main.py
Traffic Simulation
- Live Traffic Simulator
live_sniffer.py - Live Traffic CSV
live_sniffer.py
Other components
- Operator
Connections 18
- Operator → SOC Dashboard: starts scan
app.py - SOC Dashboard → Pipeline Setup: initializes
app.py - SOC Dashboard → Synthetic Flow Generator: requests flows
app.py - Synthetic Flow Generator → Preprocessing: returns flows
app.py - SOC Dashboard → Preprocessing: preprocesses flows
app.py - SOC Dashboard → Train-Test Split: splits data
app.py - SOC Dashboard → Model Training: trains models
app.py - Model Training → Random Forest: fits classifier
main.py - Model Training → Isolation Forest: fits detector
main.py - SOC Dashboard → Model Evaluation: evaluates models
app.py - Model Evaluation → Confusion Matrix Image: saves image
main.py - SOC Dashboard → SOC Alert Generation: generates alerts
app.py - SOC Alert Generation → Random Forest: predicts threats
main.py - SOC Alert Generation → Isolation Forest: detects anomalies
main.py - SOC Alert Generation → Alert CSV: writes alerts
main.py - SOC Dashboard → Alert CSV: reads alerts
app.py - SOC Dashboard → Confusion Matrix Image: loads image
app.py - Live Traffic Simulator → Live Traffic CSV: writes batches
live_sniffer.py