# roldtech/centralsoc architecture

> Architecture diagram of the GitHub repository roldtech/centralsoc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/roldtech/centralsoc
- Repository: https://github.com/roldtech/centralsoc

## Overview

CentralSOC is a Flask-based defensive security log analyzer and SOC workflow application. Analysts upload or inspect logs; the analyzer parses them into normalized events, applies rules and correlation, extracts IOCs, scores risk, and produces alerts. Analysts then triage alerts, track incidents, search saved decisions, and generate investigations or reports. The graph preserves the documented email-security, response, and export capabilities; unsampled implementations are shown only where the README or source index supports them.

Main entry points: [`CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py) (SOC dashboard), [`CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py) (Analysis coordinator), [`CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/models.py`](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/models.py) (SOC records), [`CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py`](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py) (Ingest and alert workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web and access"]
  node_webapp["Flask application<br/>[__init__.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_dashboard["SOC dashboard<br/>[dashboard.py]"]
  node_upload["Log upload<br/>[upload.py]"]
  node_rbac["Role permissions<br/>[rbac.py]"]
end

subgraph group_analysis["Log analysis"]
  node_analyzer["Analysis coordinator<br/>[analyzer.py]"]
  node_parsers["Log parsers"]
  node_eventmodel["Normalized events<br/>[models.py]"]
  node_rules["Detection rules<br/>[definitions.py]"]
  node_detectors["Detection and correlation"]
  node_alertbuild["Alert construction<br/>[alerts.py]"]
  node_risk["Risk scoring<br/>[risk.py]"]
  node_ioc["IOC extraction<br/>[ioc.py]"]
end

subgraph group_operations["SOC operations"]
  node_incidents["Incident tracking<br/>[incidents.py]"]
  node_investigation["Investigation briefs<br/>[investigation.py]"]
  node_response["Evidence snapshots<br/>[response.py]"]
  node_reporting["Reports and export<br/>[export.py]"]
end

subgraph group_storage["Persistence and integrity"]
  node_dbservice["Ingest and alert workflow<br/>[service.py]"]
  node_database[("SOC records<br/>[models.py]")]
  node_audit["Audit logging<br/>[audit.py]"]
end

subgraph group_email["Email security"]
  node_email["Email analysis<br/>[parser.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_webapp
node_webapp -->|"registers routes"| node_auth
node_webapp -->|"registers routes"| node_dashboard
node_auth -->|"authenticates against"| node_database
node_auth -->|"checks permissions"| node_rbac
node_dashboard -->|"checks permissions"| node_rbac
node_dashboard -->|"uses upload handling"| node_upload
node_dashboard -->|"updates SOC records"| node_dbservice
node_dashboard -->|"requests exports"| node_reporting
node_dashboard -.->|"supports case workflow"| node_incidents
node_dashboard -.->|"supports investigations"| node_investigation
node_dashboard -.->|"offers email analysis"| node_email
node_upload -.->|"submits logs"| node_dbservice
node_dbservice -->|"analyzes input"| node_analyzer
node_analyzer -->|"parses lines"| node_parsers
node_parsers -->|"produces events"| node_eventmodel
node_analyzer -->|"loads rules"| node_rules
node_analyzer -->|"detects and correlates"| node_detectors
node_detectors -->|"uses rule definitions"| node_rules
node_analyzer -->|"extracts indicators"| node_ioc
node_analyzer -->|"builds alerts"| node_alertbuild
node_analyzer -->|"scores entities"| node_risk
node_dbservice -->|"persists records"| node_database
node_dbservice -->|"records actions"| node_audit
node_investigation -->|"reads evidence"| node_database
node_response -.->|"records response"| node_database
node_email -.->|"stores analysis"| node_database
node_dashboard -->|"reads dashboard data"| node_database

click node_webapp "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/__init__.py"
click node_auth "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/auth.py"
click node_dashboard "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py"
click node_upload "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/upload.py"
click node_rbac "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/security/rbac.py"
click node_analyzer "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py"
click node_parsers "https://github.com/roldtech/centralsoc/tree/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/parsers"
click node_eventmodel "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/models.py"
click node_rules "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/rules/definitions.py"
click node_detectors "https://github.com/roldtech/centralsoc/tree/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors"
click node_alertbuild "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/alerts.py"
click node_risk "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/risk.py"
click node_ioc "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors/ioc.py"
click node_dbservice "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py"
click node_database "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/models.py"
click node_incidents "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/incidents.py"
click node_investigation "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/investigation.py"
click node_response "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/response.py"
click node_reporting "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/export.py"
click node_email "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/email_security/parser.py"
click node_audit "https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/security/audit.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_auth,node_dashboard,node_upload,node_rbac toneBlue
class node_analyzer,node_parsers,node_eventmodel,node_rules,node_detectors,node_alertbuild,node_risk,node_ioc toneAmber
class node_incidents,node_investigation,node_response,node_reporting toneMint
class node_dbservice,node_database,node_audit toneRose
class node_email,node_analyst toneIndigo
```

## Components

### Web and access

- [Flask application](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/__init__.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/__init__.py`
- [Authentication](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/auth.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/auth.py`
- [SOC dashboard](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`
- [Log upload](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/upload.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/upload.py`
- [Role permissions](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/security/rbac.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/security/rbac.py`

### Log analysis

- [Analysis coordinator](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`
- [Log parsers](https://github.com/roldtech/centralsoc/tree/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/parsers): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/parsers`
- [Normalized events](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/models.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/models.py`
- [Detection rules](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/rules/definitions.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/rules/definitions.py`
- [Detection and correlation](https://github.com/roldtech/centralsoc/tree/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors`
- [Alert construction](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/alerts.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/alerts.py`
- [Risk scoring](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/risk.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/risk.py`
- [IOC extraction](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors/ioc.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors/ioc.py`

### SOC operations

- [Incident tracking](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/incidents.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/incidents.py`
- [Investigation briefs](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/investigation.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/investigation.py`
- [Evidence snapshots](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/response.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/response.py`
- [Reports and export](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/export.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/export.py`

### Persistence and integrity

- [Ingest and alert workflow](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py`
- [SOC records](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/models.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/models.py`
- [Audit logging](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/security/audit.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/security/audit.py`

### Email security

- [Email analysis](https://github.com/roldtech/centralsoc/blob/main/CentralSOC_v1_Visible_UI_Refresh/regexsoc/email_security/parser.py): `CentralSOC_v1_Visible_UI_Refresh/regexsoc/email_security/parser.py`

### Other components

- **Analyst**

## Connections

- Analyst → Flask application: uses (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/__init__.py`)
- Flask application → Authentication: registers routes (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/__init__.py`)
- Flask application → SOC dashboard: registers routes (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/__init__.py`)
- Authentication → SOC records: authenticates against (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/auth.py`)
- Authentication → Role permissions: checks permissions (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/auth.py`)
- SOC dashboard → Role permissions: checks permissions (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`)
- SOC dashboard → Log upload: uses upload handling (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`)
- SOC dashboard → Ingest and alert workflow: updates SOC records (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`)
- SOC dashboard → Reports and export: requests exports (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`)
- SOC dashboard → Incident tracking: supports case workflow (evidence: `README.md`)
- SOC dashboard → Investigation briefs: supports investigations (evidence: `README.md`)
- SOC dashboard → Email analysis: offers email analysis
- Log upload → Ingest and alert workflow: submits logs
- Ingest and alert workflow → Analysis coordinator: analyzes input (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py`)
- Analysis coordinator → Log parsers: parses lines (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`)
- Log parsers → Normalized events: produces events (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/parsers/structured.py`)
- Analysis coordinator → Detection rules: loads rules (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`)
- Analysis coordinator → Detection and correlation: detects and correlates (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`)
- Detection and correlation → Detection rules: uses rule definitions (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/detectors/correlation.py`)
- Analysis coordinator → IOC extraction: extracts indicators (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`)
- Analysis coordinator → Alert construction: builds alerts (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`)
- Analysis coordinator → Risk scoring: scores entities (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/analyzer.py`)
- Ingest and alert workflow → SOC records: persists records (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py`)
- Ingest and alert workflow → Audit logging: records actions (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/db/service.py`)
- Investigation briefs → SOC records: reads evidence (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/services/investigation.py`)
- Evidence snapshots → SOC records: records response (evidence: `README.md`)
- Email analysis → SOC records: stores analysis (evidence: `README.md`)
- SOC dashboard → SOC records: reads dashboard data (evidence: `CentralSOC_v1_Visible_UI_Refresh/regexsoc/web/routes/dashboard.py`)
