How priyanshudahiya757/cyber-threat-detection-and-incident-response works
Cyber Threat Detection is a SOC application for ingesting security logs, detecting threats with rules and ML, correlating detections into incidents, and supporting analyst workflows through a web interface. The principal backend flow is upload/API ingestion → source parsing and normalization → deduplication and indexing → rule and ML detection → alerting and incident correlation. The graph also preserves authentication, analytics, rule management, and the frontend’s major feature areas. Some frontend-to-API wiring and unsampled API behavior are not shown, so those relationships are omitted.
Main entry points: engine.py Rule engine · pipeline.py Ingestion pipeline · mongo.py Application data store · prediction_service.py ML prediction
Components 30
Log ingestion
- Ingestion pipeline
backend/app/ingestion/pipeline.py - Source parsers
backend/app/ingestion/parsers - Log normalizer
backend/app/ingestion/normalizer.py - Normalized log schema
backend/app/models/log_schema.py
Threat detection
- Rule engine
backend/app/detection/engine.py - Detection rules
backend/app/detection/rules - ML prediction
backend/app/detection/ml/prediction_service.py - ML features
backend/app/detection/ml/feature_extraction.py - Model registry
backend/app/detection/ml/model_registry.py - Model training
backend/app/detection/ml/training_service.py - Detection event schema
backend/app/models/detection_schema.py
Incident response
- Alert generation
backend/app/detection/alerting.py - Incident correlator
backend/app/incidents/correlator.py - Incident workflow
backend/app/incidents/service.py
API and storage
- Log upload API
backend/app/api/v1/logs.py - Log search and index
backend/app/db/elastic.py - Application data store
backend/app/db/mongo.py - Detection API
backend/app/api/v1/detections.py - Incident API
backend/app/api/v1/incidents.py - Authentication API
backend/app/api/v1/auth.py - Authentication security
backend/app/core/security.py - Analytics API
backend/app/api/v1/analytics.py - Rule management API
backend/app/api/v1/rules.py
Analyst interface
- SOC web interface
frontend/src/App.tsx - Dashboard and analytics
frontend/src/features/dashboard/pages/DashboardPage.tsx - Log upload screen
frontend/src/features/logs/pages/UploadLogsPage.tsx - Threat and anomaly views
frontend/src/features/detections/pages/ThreatDetectionPage.tsx - Incident management view
frontend/src/features/incidents/pages/IncidentManagementPage.tsx - Login screen
frontend/src/features/auth/pages/LoginPage.tsx
Other components
- Analyst
Connections 27
- Analyst → Log upload API: uploads logs
- Log upload API → Ingestion pipeline: submits batch
- Ingestion pipeline → Source parsers: selects parser
backend/app/ingestion/pipeline.py - Ingestion pipeline → Log normalizer: normalizes events
backend/app/ingestion/pipeline.py - Log normalizer → Normalized log schema: builds records
backend/app/ingestion/normalizer.py - Ingestion pipeline → Log search and index: indexes logs
backend/app/ingestion/pipeline.py - Ingestion pipeline → Application data store: checks duplicates
backend/app/ingestion/pipeline.py - Ingestion pipeline → Rule engine: dispatches ingested logs
backend/app/main.py - Rule engine → Detection rules: runs rules
backend/app/detection/engine.py - Rule engine → ML prediction: scores anomalies
backend/app/detection/engine.py - ML prediction → ML features: extracts features
backend/app/detection/ml/prediction_service.py - ML prediction → Model registry: loads model
backend/app/detection/ml/prediction_service.py - Model training → ML features: extracts training features
backend/app/detection/ml/training_service.py - Model training → Model registry: registers model
backend/app/detection/ml/training_service.py - Rule engine → Detection event schema: emits detections
backend/app/detection/engine.py - Rule engine → Application data store: persists detections
backend/app/detection/engine.py - Rule engine → Alert generation: generates alerts
backend/app/detection/engine.py - Rule engine → Incident correlator: correlates detections
backend/app/detection/engine.py - Incident correlator → Application data store: reads and updates incidents
backend/app/incidents/correlator.py - Incident API → Incident workflow: delegates workflow
backend/app/api/v1/incidents.py - Incident workflow → Application data store: updates incidents
backend/app/incidents/service.py - Authentication API → Authentication security: uses security functions
backend/app/api/v1/auth.py - Authentication API → Application data store: reads and writes users
backend/app/api/v1/auth.py - Analytics API → Log search and index: queries log analytics
backend/app/api/v1/analytics.py - Analytics API → Application data store: queries incident analytics
backend/app/api/v1/analytics.py - Rule management API → Application data store: persists rule settings
- Analyst → SOC web interface: uses SOC interface