How ganesh4060/nids works
This Flask NIDS accepts a CSV, validates it, streams records through per-source-IP detection, and presents alerts, statistics, charts, and downloadable reports. The main analysis workflow is documented in the README and supported by the sampled controller, analysis, and processing code. Detection stages and key internal layers are shown separately; several page and chart relationships are documented but their full route/template implementation was not sampled.
Main entry points: stream_processor.py Record processing · controller.py Application facade · app.py Flask routes · analysis_service.py Job analysis
Components 23
Web application
- Flask routes
app.py - NIDS pages
templates - Application facade
backend/services/controller.py
Dataset intake
- Uploaded CSV
uploads - CSV validation
backend/services/csv_service.py - Row parsing
backend/utils/validators.py - CSV record source
backend/processing/traffic_source.py
Analysis engine
- Traffic record
backend/models/traffic_record.py - IP-sharded workers
backend/processing/parallel_processor.py - Record processing
backend/processing/stream_processor.py - Sliding window
backend/detection/sliding_window.py - Window and totals
backend/detection/statistics_engine.py - Attack rules
backend/detection/attack_detector.py - Anomaly detection
backend/detection/anomaly_detector.py - Alert management
backend/detection/alert_manager.py - Alert model
backend/models/alert.py - Detection settings
config.py
Results and reports
- Job analysis
backend/services/analysis_service.py - Job status and results
results - SVG charts
backend/utils/charts.py - CSV and PDF reports
backend/services/report_service.py - Generated reports
reports
Other components
- Analyst
Connections 25
- Analyst → Flask routes: uses
README.md - Flask routes → Application facade: delegates to
app.py - Flask routes → NIDS pages: renders
README.md - Application facade → CSV validation: validates upload
backend/services/controller.py - Application facade → Uploaded CSV: saves CSV
backend/services/controller.py - CSV validation → Row parsing: parses rows
backend/services/csv_service.py - Application facade → Job analysis: starts job
backend/services/controller.py - Job analysis → CSV record source: streams CSV
backend/services/analysis_service.py - CSV record source → Row parsing: parses records
backend/processing/traffic_source.py - CSV record source → Traffic record: yields
backend/processing/traffic_source.py - Job analysis → IP-sharded workers: runs processor
backend/services/analysis_service.py - IP-sharded workers → Record processing: dispatches batches
README.md - Record processing → Sliding window: updates window
backend/processing/stream_processor.py - Record processing → Window and totals: records metrics
backend/processing/stream_processor.py - Record processing → Attack rules: checks patterns
backend/processing/stream_processor.py - Record processing → Anomaly detection: checks anomalies
backend/processing/stream_processor.py - Record processing → Alert management: ingests findings
backend/processing/stream_processor.py - Sliding window → Traffic record: stores events
backend/detection/sliding_window.py - Window and totals → Sliding window: reads aggregates
backend/detection/statistics_engine.py - Alert management → Alert model: creates alerts
backend/detection/alert_manager.py - Job analysis → Job status and results: writes JSON
backend/services/analysis_service.py - Flask routes → SVG charts: renders charts
app.py - Application facade → CSV and PDF reports: generates exports
backend/services/controller.py - CSV and PDF reports → Generated reports: writes files
backend/services/report_service.py - Detection settings → IP-sharded workers: configures workers
backend/processing/parallel_processor.py