How alcodes808/can-bus-sentinel-ids works
CAN Sentinel simulates automotive CAN traffic, injects attacks, and analyzes received frames with rule-based and ML detectors. The principal workflow is orchestrated by the C simulation: ECUs transmit frames over a virtual bus, scheduled attacks add malicious traffic, IDS checks frames, and logging/export supports review and model training. The repository also includes browser dashboards for bus, threat, overview, and ML views. Some dashboard data wiring and unsampled subsystem details are documented only at a high level, so those relationships are left unverified.
Main entry points: main.c Simulation Orchestrator · json_logger.c JSON Logger · can_bus.c Virtual CAN Bus · ids_detector.c Rule-Based IDS
Components 17
CAN Simulation
- Simulation Orchestrator
src/main.c - CAN Frames
src/can_frame.c - Virtual CAN Bus
src/can_bus.c - ECU Nodes
src/ecu_node.c - Diagnostic Trouble Codes
src/dtc_manager.c
Threat Simulation
- Attack Injector
src/attack_injector.c
Intrusion Detection
- Rule-Based IDS
src/ids_detector.c
Machine Learning
- ML Anomaly Detector
src/ml_detector.c - Model Parameters
include/ml_model_params.h - Feature Exporter
src/ml_exporter.c - Model Trainer
ml_trainer.py
Monitoring & Diagnostics
- JSON Logger
src/json_logger.c - Security Overview
dashboard/js/overview.js - Bus Traffic Monitor
dashboard/js/bus-monitor.js - Threat Detection View
dashboard/js/ids-detection.js - ML Analysis View
dashboard/js/ml-analysis.js
Other components
- Operator
Connections 19
- Operator → Simulation Orchestrator: runs simulation
src/main.c - Simulation Orchestrator → Virtual CAN Bus: initializes and uses
src/main.c - Simulation Orchestrator → ECU Nodes: initializes and sends
src/main.c - Simulation Orchestrator → Attack Injector: schedules and executes
src/main.c - Simulation Orchestrator → Rule-Based IDS: learns and analyzes
src/main.c - Simulation Orchestrator → Diagnostic Trouble Codes: records faults
src/main.c - Simulation Orchestrator → JSON Logger: logs frames
src/main.c - Simulation Orchestrator → Feature Exporter: exports samples
src/main.c - ECU Nodes → Virtual CAN Bus: transmits frames
- Attack Injector → Virtual CAN Bus: injects frames
- Virtual CAN Bus → Rule-Based IDS: supplies received frames
- Rule-Based IDS → ML Anomaly Detector: checks anomalies
src/ids_detector.c - ML Anomaly Detector → Model Parameters: uses parameters
- Feature Exporter → Model Trainer: exports training data
README.md - Model Trainer → Model Parameters: exports model parameters
README.md - JSON Logger → Security Overview: provides monitoring data
- JSON Logger → Bus Traffic Monitor: provides traffic data
- JSON Logger → Threat Detection View: provides alert data
- JSON Logger → ML Analysis View: provides ML metrics