How muthukkumaranb/vitcsiorigins works
Purpose and Entry Points
SENTINEL detects privileged-access misuse and insider threats by combining deterministic behavioral analysis, temporal correlation, operational context, and ML classification. The Flask API starts at backend/app.py; initial model training runs through backend/ml/training.py. The SOC console is a Vite React/TypeScript client bootstrapped by sentinel-frontend/src/main.tsx and composed in sentinel-frontend/src/App.tsx.
Live Detection Plane
POST /api/events enters the live processing path exposed in backend/app.py. Runtime telemetry is loaded from CSV snapshots and retained in a bounded live buffer by backend/data_loader.py; it may originate from source data under data/events.csv or generated runtime output such as output/events.csv. The ingestion boundary validates event schema before scoring and makes recent events available to API consumers.
Deterministic Risk and Correlation
The core event processor in backend/processor.py computes baseline-aware behavior signals, ordered prior-event sequences using a 60-minute lookback, and context-adjusted deterministic risk. It is the central boundary between raw telemetry and enriched security assessments. Multi-stage sequences are subsequently grouped into incident records by backend/incident_correlation.py; enterprise-level posture and aggregations are served by backend/analyzer.py.
ML Inference and Hybrid Fusion
The ML subsystem derives a bounded 10-dimensional behavioral feature vector in backend/ml/features.py, performs real-time Random Forest inference through backend/ml/predictor.py, and merges the ML probability with behavior and sequence scores in backend/ml/fusion.py. Persisted production/candidate models are held under backend/ml/artifacts/sentinel_rf_model.pkl and version metadata is managed in backend/ml/registry/model_registry.py. Deterministic scoring remains the fallback when ML is unavailable.
Controlled Learning Plane
Analyst feedback accepted by the API is accumulated into a verified training dataset via backend/ml/dataset_builder.py. Candidate training is handled in backend/ml/trainer.py, evaluation in backend/ml/evaluator.py, and promotion/rollback decisions through the model registry in backend/ml/registry/model_registry.py. This plane is intentionally decoupled from live detection: retraining and model governance must not block event processing.
Telemetry Simulation
A controllable background simulator provides legitimate and staged attack telemetry independently of the live detection loop. Scenario definitions live in backend/telemetry/scenarios.py, schema-compliant events are created by backend/telemetry/event_generator.py, and lifecycle controls (start, pause, stop, reset, step) are implemented in backend/telemetry/simulator.py. Its emitted events re-enter the same ingestion/processing boundary as external events.
API Consumers and SOC Console
The Flask REST surface in backend/app.py exposes alerts, identities, risk detail, incidents, audit records, security analysis, simulator controls, and ML lifecycle endpoints. The frontend API boundary is sentinel-frontend/src/services/api.ts, with polling/data access in sentinel-frontend/src/hooks/useSecurityData.ts. Major operator workflows are represented by pages such as sentinel-frontend/src/pages/Dashboard.tsx, sentinel-frontend/src/pages/Investigation.tsx, and sentinel-frontend/src/pages/Analytics.tsx; authentication and authorization gates are client-side components under sentinel-frontend/src/components/auth/.
Runtime and External Dependencies
Backend runtime is Python with Flask and ML dependencies declared in backend/requirements.txt; model persistence is filesystem-based rather than a separate model-serving platform. Frontend runtime is Node/Vite with package definitions in sentinel-frontend/package.json. An optional local LLM copilot integration is isolated behind backend/llm/ollama_client.py and prompt definitions in backend/llm/prompts.py, preventing it from being a dependency of the primary detection pipeline.
Main entry points: app.py Flask REST API · processor.py Event processor · data_loader.py Telemetry buffer · predictor.py RF predictor
Components 21
Live Detection
Synchronous telemetry-to-assessment path.
- Flask REST API · Event ingestion and SOC control surface.
backend/app.py - Telemetry buffer · Validates snapshots and retains recent events.
backend/data_loader.py - Telemetry CSV
data/events.csv - Event processor · Computes behavioral, sequence, and contextual risk.
backend/processor.py - Incident correlation · Groups multi-stage sequences into incidents.
backend/incident_correlation.py - Security analyzer · Serves enterprise aggregations and posture.
backend/analyzer.py
ML & Governance
Inference and decoupled model lifecycle.
- Behavior features · Builds bounded 10-dimensional vectors.
backend/ml/features.py - RF predictor
backend/ml/predictor.py - Hybrid fusion · Falls back to deterministic scoring when ML is unavailable.
backend/ml/fusion.py - Model registry · Controls candidate promotion and rollback.
backend/ml/registry/model_registry.py - Production model
backend/ml/artifacts/sentinel_rf_model.pkl - Verified dataset · Converts analyst feedback into training data.
backend/ml/dataset_builder.py - Candidate trainer
backend/ml/trainer.py - Model evaluator
backend/ml/evaluator.py
Telemetry Simulation
- Simulator controls · Owns start, pause, stop, reset, and step lifecycle.
backend/telemetry/simulator.py - Event generator · Creates schema-compliant legitimate and attack events.
backend/telemetry/event_generator.py - Attack scenarios
backend/telemetry/scenarios.py
SOC Console
- Frontend API client
sentinel-frontend/src/services/api.ts - Security data polling
sentinel-frontend/src/hooks/useSecurityData.ts - SOC console · Dashboard, investigation, analytics, and client-side auth workflows.
sentinel-frontend/src/App.tsx
Other components
- Optional LLM copilot · Isolated from the primary detection pipeline.
backend/llm/ollama_client.py
Connections 24
- Telemetry CSV → Telemetry buffer: load snapshots
- Flask REST API → Telemetry buffer: ingest events
- Telemetry buffer → Event processor: validated telemetry
- Event processor → Behavior features: behavior signals
- Behavior features → RF predictor: feature vector
- Production model → RF predictor: load model
- Event processor → Hybrid fusion: deterministic scores
- RF predictor → Hybrid fusion: ML probability
- Hybrid fusion → Incident correlation: enriched assessments
- Incident correlation → Security analyzer: incidents
- Flask REST API → Security analyzer: alerts and analysis
- Flask REST API → Verified dataset: analyst feedback
- Verified dataset → Candidate trainer: training dataset
- Candidate trainer → Model evaluator: candidate model
- Model evaluator → Model registry: evaluation decision
- Model registry → Production model: promote or rollback
- Attack scenarios → Event generator: scenario stages
- Simulator controls → Event generator: lifecycle control
- Event generator → Flask REST API: simulated events
- Flask REST API → Simulator controls: simulator endpoints
- SOC console → Security data polling: operator views
- Security data polling → Frontend API client: poll and fetch
- Frontend API client → Flask REST API: REST requests
- Flask REST API → Optional LLM copilot: optional copilot request