# jeet6421/cybrot-soc-core architecture

> Architecture diagram of the GitHub repository jeet6421/cybrot-soc-core, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jeet6421/cybrot-soc-core
- Repository: https://github.com/jeet6421/cybrot-soc-core

## Overview

Cybrot SOC Core is a multi-tenant hospital security-operations service. Its central workflow accepts hospital telemetry, normalizes and evaluates events, creates alerts for analyst triage, and supports approved response actions and operational review. The graph also preserves documented MFA, Suricata monitoring, executive reporting, service tiers, and durable response jobs. Source excerpts establish selected calls; README statements support documented runtime capabilities. Other relationships are omitted where the excerpts do not show the caller or data transfer.

Main entry points: [`app.py`](https://github.com/jeet6421/cybrot-soc-core/blob/main/app.py) (SOC API and workflow), [`worker.py`](https://github.com/jeet6421/cybrot-soc-core/blob/main/worker.py) (Durable response jobs), [`db/schema.sql`](https://github.com/jeet6421/cybrot-soc-core/blob/main/db/schema.sql) (PostgreSQL data store), [`routes/telemetry.py`](https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/telemetry.py) (Suricata ingest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Telemetry and detection"]
  node_app["SOC API and workflow<br/>[app.py]"]
  node_telemetry["Suricata ingest<br/>[telemetry.py]"]
  node_hospital["Hospital telemetry rules<br/>[hospital.py]"]
  node_detection["Detection rules<br/>[detect.py]"]
  node_generator["Synthetic event generator<br/>[generate.py]"]
end

subgraph group_access["Identity and operations"]
  node_auth["Credentials and TOTP<br/>[auth.py]"]
  node_mfa["MFA enrollment routes<br/>[mfa.py]"]
  node_ops["Audit and job reads<br/>[ops_reads.py]"]
  node_ui["Analyst console<br/>[index.html]"]
end

subgraph group_response["Response execution"]
  node_response_jobs["Durable response jobs<br/>[worker.py]"]
  node_playbooks["Action allowlist<br/>[playbooks.py]"]
  node_ansible["Ansible executor<br/>[ansible_runner.py]"]
  node_playbook_files["Containment playbooks"]
end

subgraph group_platform["Reporting and storage"]
  node_executive["Executive reporting<br/>[executive.py]"]
  node_tiers["Service tier policy<br/>[tiers.py]"]
  node_partitions["Partition maintenance<br/>[partitions.py]"]
  node_database[("PostgreSQL data store<br/>[schema.sql]")]
end

node_sender(("Hospital log sender"))
node_analyst(("Hospital analyst"))

node_sender -->|"sends events"| node_telemetry
node_sender -->|"sends events"| node_app
node_telemetry -->|"normalizes records"| node_hospital
node_telemetry -->|"passes normalized events"| node_app
node_analyst -->|"signs in and triages"| node_app
node_app -->|"evaluates events"| node_detection
node_app -->|"uses telemetry rules"| node_hospital
node_app -->|"registers routes"| node_mfa
node_mfa -->|"uses app helpers"| node_app
node_mfa -->|"uses TOTP helpers"| node_auth
node_app -->|"stores events and alerts"| node_database
node_app -->|"registers routes"| node_executive
node_executive -->|"checks tier policy"| node_tiers
node_executive -->|"reads report data"| node_database
node_analyst -->|"reviews audit and jobs"| node_ops
node_ops -->|"queries audit and jobs"| node_database
node_app -->|"queues approved actions"| node_response_jobs
node_response_jobs -->|"claims and records jobs"| node_database
node_response_jobs -->|"dispatches executors"| node_ansible
node_ansible -->|"validates actions"| node_playbooks
node_ansible -->|"runs approved playbooks"| node_playbook_files
node_response_jobs -->|"checks storage readiness"| node_partitions
node_generator -->|"generates test data"| node_sender
node_ui -.->|"presents SOC console"| node_analyst

click node_app "https://github.com/jeet6421/cybrot-soc-core/blob/main/app.py"
click node_telemetry "https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/telemetry.py"
click node_hospital "https://github.com/jeet6421/cybrot-soc-core/blob/main/hospital.py"
click node_detection "https://github.com/jeet6421/cybrot-soc-core/blob/main/detect.py"
click node_generator "https://github.com/jeet6421/cybrot-soc-core/blob/main/generate.py"
click node_auth "https://github.com/jeet6421/cybrot-soc-core/blob/main/auth.py"
click node_mfa "https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/mfa.py"
click node_ops "https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/ops_reads.py"
click node_ui "https://github.com/jeet6421/cybrot-soc-core/blob/main/static/index.html"
click node_response_jobs "https://github.com/jeet6421/cybrot-soc-core/blob/main/worker.py"
click node_playbooks "https://github.com/jeet6421/cybrot-soc-core/blob/main/playbooks.py"
click node_ansible "https://github.com/jeet6421/cybrot-soc-core/blob/main/ansible_runner.py"
click node_playbook_files "https://github.com/jeet6421/cybrot-soc-core/tree/main/ansible/playbooks/contain"
click node_executive "https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/executive.py"
click node_tiers "https://github.com/jeet6421/cybrot-soc-core/blob/main/tiers.py"
click node_partitions "https://github.com/jeet6421/cybrot-soc-core/blob/main/partitions.py"
click node_database "https://github.com/jeet6421/cybrot-soc-core/blob/main/db/schema.sql"

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_app,node_telemetry,node_hospital,node_detection,node_generator toneBlue
class node_auth,node_mfa,node_ops,node_ui toneAmber
class node_response_jobs,node_playbooks,node_ansible,node_playbook_files toneMint
class node_executive,node_tiers,node_partitions,node_database toneRose
class node_sender,node_analyst toneIndigo
```

## Components

### Telemetry and detection

- [SOC API and workflow](https://github.com/jeet6421/cybrot-soc-core/blob/main/app.py): `app.py`
- [Suricata ingest](https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/telemetry.py): `routes/telemetry.py`
- [Hospital telemetry rules](https://github.com/jeet6421/cybrot-soc-core/blob/main/hospital.py): `hospital.py`
- [Detection rules](https://github.com/jeet6421/cybrot-soc-core/blob/main/detect.py): `detect.py`
- [Synthetic event generator](https://github.com/jeet6421/cybrot-soc-core/blob/main/generate.py): `generate.py`

### Identity and operations

- [Credentials and TOTP](https://github.com/jeet6421/cybrot-soc-core/blob/main/auth.py): `auth.py`
- [MFA enrollment routes](https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/mfa.py): `routes/mfa.py`
- [Audit and job reads](https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/ops_reads.py): `routes/ops_reads.py`
- [Analyst console](https://github.com/jeet6421/cybrot-soc-core/blob/main/static/index.html): `static/index.html`

### Response execution

- [Durable response jobs](https://github.com/jeet6421/cybrot-soc-core/blob/main/worker.py): `worker.py`
- [Action allowlist](https://github.com/jeet6421/cybrot-soc-core/blob/main/playbooks.py): `playbooks.py`
- [Ansible executor](https://github.com/jeet6421/cybrot-soc-core/blob/main/ansible_runner.py): `ansible_runner.py`
- [Containment playbooks](https://github.com/jeet6421/cybrot-soc-core/tree/main/ansible/playbooks/contain): `ansible/playbooks/contain`

### Reporting and storage

- [Executive reporting](https://github.com/jeet6421/cybrot-soc-core/blob/main/routes/executive.py): `routes/executive.py`
- [Service tier policy](https://github.com/jeet6421/cybrot-soc-core/blob/main/tiers.py): `tiers.py`
- [Partition maintenance](https://github.com/jeet6421/cybrot-soc-core/blob/main/partitions.py): `partitions.py`
- [PostgreSQL data store](https://github.com/jeet6421/cybrot-soc-core/blob/main/db/schema.sql): `db/schema.sql`

### Other components

- **Hospital log sender**
- **Hospital analyst**

## Connections

- Hospital log sender → Suricata ingest: sends events (evidence: `README.md`)
- Hospital log sender → SOC API and workflow: sends events (evidence: `README.md`)
- Suricata ingest → Hospital telemetry rules: normalizes records (evidence: `routes/telemetry.py`)
- Suricata ingest → SOC API and workflow: passes normalized events (evidence: `routes/telemetry.py`)
- Hospital analyst → SOC API and workflow: signs in and triages (evidence: `README.md`)
- SOC API and workflow → Detection rules: evaluates events (evidence: `app.py`)
- SOC API and workflow → Hospital telemetry rules: uses telemetry rules (evidence: `app.py`)
- SOC API and workflow → MFA enrollment routes: registers routes (evidence: `app.py`)
- MFA enrollment routes → SOC API and workflow: uses app helpers (evidence: `routes/mfa.py`)
- MFA enrollment routes → Credentials and TOTP: uses TOTP helpers (evidence: `routes/mfa.py`)
- SOC API and workflow → PostgreSQL data store: stores events and alerts (evidence: `README.md`)
- SOC API and workflow → Executive reporting: registers routes (evidence: `app.py`)
- Executive reporting → Service tier policy: checks tier policy (evidence: `routes/executive.py`)
- Executive reporting → PostgreSQL data store: reads report data (evidence: `routes/executive.py`)
- Hospital analyst → Audit and job reads: reviews audit and jobs (evidence: `routes/ops_reads.py`)
- Audit and job reads → PostgreSQL data store: queries audit and jobs (evidence: `routes/ops_reads.py`)
- SOC API and workflow → Durable response jobs: queues approved actions (evidence: `README.md`)
- Durable response jobs → PostgreSQL data store: claims and records jobs (evidence: `worker.py`)
- Durable response jobs → Ansible executor: dispatches executors (evidence: `worker.py`)
- Ansible executor → Action allowlist: validates actions (evidence: `ansible_runner.py`)
- Ansible executor → Containment playbooks: runs approved playbooks (evidence: `ansible_runner.py`)
- Durable response jobs → Partition maintenance: checks storage readiness (evidence: `worker.py`)
- Synthetic event generator → Hospital log sender: generates test data (evidence: `README.md`)
- Analyst console → Hospital analyst: presents SOC console
