# biswajit-masanta/sentryx-edr architecture

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

- Interactive diagram: https://gitdiagram.com/biswajit-masanta/sentryx-edr
- Repository: https://github.com/biswajit-masanta/sentryx-edr

## Overview

SENTRYX collects endpoint identity, resource, and process telemetry; sends reports to a FastAPI service; stores telemetry, evaluates resource rules, derives features, and records a Random Forest risk prediction for dashboard visibility. The graph preserves the documented multi-host, alert, process-risk, and monitoring views. Agent transport details and dashboard request wiring are not shown in the excerpts, so those links are dashed and unverified; other edges cite the caller or README.

Main entry points: [`server/server.py`](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/server.py) (Report and REST API), [`agent/agent.py`](https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/agent.py) (Agent loop), [`server/database/operations.py`](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/operations.py) (Telemetry operations), [`server/models/report.py`](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/report.py) (Report schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_endpoint["Endpoint agent"]
  node_identity["System identity<br/>[sys_info.py]"]
  node_resources["Resource sampler<br/>[resources.py]"]
  node_collector["Process collector"]
  node_agentloop["Agent loop<br/>[agent.py]"]
  node_sender["Report sender<br/>[sender.py]"]
end

subgraph group_service["Telemetry service"]
  node_reportapi["Report and REST API<br/>[server.py]"]
  node_reportmodel["Report schema<br/>[report.py]"]
  node_systemmodel["System schema<br/>[sys_info.py]"]
  node_processmodel["Process schema<br/>[processes.py]"]
  node_resourcemodel["Resource schema<br/>[resource.py]"]
end

subgraph group_detection["Detection and ML"]
  node_rules["Resource rules<br/>[rules.py]"]
  node_features["Feature extraction"]
  node_inference["Risk inference<br/>[predict.py]"]
  node_modelstatus["Prediction status<br/>[model_status.py]"]
  node_training["Model training<br/>[train_model.py]"]
end

subgraph group_storage["Persistence"]
  node_operations["Telemetry operations<br/>[operations.py]"]
  node_schema["Table definitions<br/>[scheme.py]"]
  node_connection["SQLite connection<br/>[connection.py]"]
  node_sqlite[("SQLite telemetry store")]
end

subgraph group_ui["Dashboard"]
  node_dashboard["Dashboard views"]
end

node_operator(("Security operator"))
node_host(("Monitored endpoint"))
node_browser(("Dashboard user"))

node_host -->|"runs on"| node_agentloop
node_agentloop -->|"collects identity"| node_identity
node_agentloop -->|"samples resources"| node_resources
node_agentloop -->|"collects processes"| node_collector
node_agentloop -->|"sends report"| node_sender
node_sender -.->|"posts telemetry"| node_reportapi
node_reportapi -->|"accepts report"| node_reportmodel
node_reportmodel -->|"includes"| node_systemmodel
node_reportmodel -->|"includes"| node_resourcemodel
node_reportmodel -->|"includes"| node_processmodel
node_reportapi -->|"stores and queries"| node_operations
node_reportapi -->|"evaluates resources"| node_rules
node_reportapi -->|"extracts features"| node_features
node_reportapi -->|"predicts risk"| node_inference
node_reportapi -->|"updates status"| node_modelstatus
node_reportapi -->|"initializes tables"| node_schema
node_features -->|"counts active alerts"| node_operations
node_rules -->|"manages alerts"| node_operations
node_operations -->|"opens connections"| node_connection
node_schema -->|"opens connections"| node_connection
node_operations -->|"reads and writes"| node_sqlite
node_schema -->|"creates tables"| node_sqlite
node_reportapi -.->|"serves telemetry"| node_dashboard
node_browser -->|"views monitoring"| node_dashboard
node_training -.->|"supplies model"| node_inference

click node_identity "https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/sys_info.py"
click node_resources "https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/resources.py"
click node_collector "https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/process_collector.py"
click node_agentloop "https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/agent.py"
click node_sender "https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/sender.py"
click node_reportapi "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/server.py"
click node_reportmodel "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/report.py"
click node_systemmodel "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/sys_info.py"
click node_processmodel "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/processes.py"
click node_resourcemodel "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/resource.py"
click node_rules "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/rules.py"
click node_features "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/feature_extractor.py"
click node_inference "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/predict.py"
click node_modelstatus "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/model_status.py"
click node_training "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/train_model.py"
click node_operations "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/operations.py"
click node_schema "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/scheme.py"
click node_connection "https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/connection.py"
click node_dashboard "https://github.com/biswajit-masanta/sentryx-edr/tree/main/server/dashboard"

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_identity,node_resources,node_collector,node_agentloop,node_sender,node_browser toneBlue
class node_reportapi,node_reportmodel,node_systemmodel,node_processmodel,node_resourcemodel toneAmber
class node_rules,node_features,node_inference,node_modelstatus,node_training toneMint
class node_operations,node_schema,node_connection,node_sqlite toneRose
class node_dashboard,node_operator,node_host toneIndigo
```

## Components

### Endpoint agent

- [System identity](https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/sys_info.py): `agent/modules_for_agents/sys_info.py`
- [Resource sampler](https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/resources.py): `agent/modules_for_agents/resources.py`
- [Process collector](https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/process_collector.py): `agent/modules_for_agents/process_collector.py`
- [Agent loop](https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/agent.py): `agent/agent.py`
- [Report sender](https://github.com/biswajit-masanta/sentryx-edr/blob/main/agent/modules_for_agents/sender.py): `agent/modules_for_agents/sender.py`

### Telemetry service

- [Report and REST API](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/server.py): `server/server.py`
- [Report schema](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/report.py): `server/models/report.py`
- [System schema](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/sys_info.py): `server/models/sys_info.py`
- [Process schema](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/processes.py): `server/models/processes.py`
- [Resource schema](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/models/resource.py): `server/models/resource.py`

### Detection and ML

- [Resource rules](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/rules.py): `server/database/rules.py`
- [Feature extraction](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/feature_extractor.py): `server/ml/feature_extractor.py`
- [Risk inference](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/predict.py): `server/ml/predict.py`
- [Prediction status](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/model_status.py): `server/ml/model_status.py`
- [Model training](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/ml/train_model.py): `server/ml/train_model.py`

### Persistence

- [Telemetry operations](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/operations.py): `server/database/operations.py`
- [Table definitions](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/scheme.py): `server/database/scheme.py`
- [SQLite connection](https://github.com/biswajit-masanta/sentryx-edr/blob/main/server/database/connection.py): `server/database/connection.py`
- **SQLite telemetry store**

### Dashboard

- [Dashboard views](https://github.com/biswajit-masanta/sentryx-edr/tree/main/server/dashboard): `server/dashboard`

### Other components

- **Security operator**
- **Monitored endpoint**
- **Dashboard user**

## Connections

- Monitored endpoint → Agent loop: runs on (evidence: `README.md`)
- Agent loop → System identity: collects identity (evidence: `agent/agent.py`)
- Agent loop → Resource sampler: samples resources (evidence: `agent/agent.py`)
- Agent loop → Process collector: collects processes (evidence: `agent/agent.py`)
- Agent loop → Report sender: sends report (evidence: `agent/agent.py`)
- Report sender → Report and REST API: posts telemetry
- Report and REST API → Report schema: accepts report (evidence: `server/server.py`)
- Report schema → System schema: includes (evidence: `server/models/report.py`)
- Report schema → Resource schema: includes (evidence: `server/models/report.py`)
- Report schema → Process schema: includes (evidence: `server/models/report.py`)
- Report and REST API → Telemetry operations: stores and queries (evidence: `server/server.py`)
- Report and REST API → Resource rules: evaluates resources (evidence: `server/server.py`)
- Report and REST API → Feature extraction: extracts features (evidence: `server/server.py`)
- Report and REST API → Risk inference: predicts risk (evidence: `server/server.py`)
- Report and REST API → Prediction status: updates status (evidence: `server/server.py`)
- Report and REST API → Table definitions: initializes tables (evidence: `server/server.py`)
- Feature extraction → Telemetry operations: counts active alerts (evidence: `server/ml/feature_extractor.py`)
- Resource rules → Telemetry operations: manages alerts (evidence: `server/database/rules.py`)
- Telemetry operations → SQLite connection: opens connections (evidence: `server/database/operations.py`)
- Table definitions → SQLite connection: opens connections (evidence: `server/database/scheme.py`)
- Telemetry operations → SQLite telemetry store: reads and writes (evidence: `server/database/operations.py`)
- Table definitions → SQLite telemetry store: creates tables (evidence: `server/database/scheme.py`)
- Report and REST API → Dashboard views: serves telemetry
- Dashboard user → Dashboard views: views monitoring (evidence: `README.md`)
- Model training → Risk inference: supplies model
