# cagrisaltik/sentinel-system architecture

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

- Interactive diagram: https://gitdiagram.com/cagrisaltik/sentinel-system
- Repository: https://github.com/cagrisaltik/sentinel-system

## Overview

Sentinel System manages authenticated Scout agents: the Commander accepts agent connections, schedules short-lived monitoring tasks, and validates and stores returned telemetry; the Analyst provides authenticated views of stored results. Scout validates and executes authorized ping tasks, then reports results. The README documents MySQL-backed users, agents, targets, logs, and monitoring results. The excerpts show the main runtime entry points and key operations, but the Commander is a single large file and other subsystems are only partly sampled; unsupported internal links are omitted.

Main entry points: [`cmd/commander/main.go`](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go) (Commander Service), [`cmd/scout/main.go`](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go) (Secure Connection), [`cmd/analyst/main.go`](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go) (Analyst Service), [`web/analyst/index.html`](https://github.com/cagrisaltik/sentinel-system/blob/main/web/analyst/index.html) (Analyst Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commander["Commander"]
  node_commander_service["Commander Service<br/>[main.go]"]
  node_commander_auth["Login and Sessions<br/>[main.go]"]
  node_agent_gateway["Agent Gateway<br/>[main.go]"]
  node_task_scheduler["Task Scheduler<br/>[main.go]"]
  node_telemetry_handler["Telemetry Validation<br/>[main.go]"]
  node_commander_db["Commander Database Access<br/>[main.go]"]
end

subgraph group_scout["Scout Agent"]
  node_scout_process["Scout Agent<br/>[main.go]"]
  node_scout_connection["Secure Connection<br/>[main.go]"]
  node_task_validation["Task Validation<br/>[main.go]"]
  node_ping_execution["Ping Execution<br/>[main.go]"]
  node_result_reporting["Telemetry Reporting<br/>[main.go]"]
end

subgraph group_analyst["Analyst"]
  node_analyst_ui["Analyst Dashboard<br/>[index.html]"]
  node_analyst_service["Analyst Service<br/>[main.go]"]
  node_analyst_auth["Authentication and Sessions<br/>[main.go]"]
  node_result_queries["Result Queries<br/>[main.go]"]
end

subgraph group_protocol["Shared Protocol"]
  node_message_model["Agent Messages<br/>[message.go]"]
end

node_operator(("Operator"))
node_web_client["Commander Panel<br/>[index.html]"]
node_mysql[("MySQL Database")]

node_operator -->|"uses"| node_web_client
node_web_client -->|"HTTPS requests"| node_commander_service
node_commander_service -.->|"handles login"| node_commander_auth
node_commander_service -.->|"routes agent traffic"| node_agent_gateway
node_task_scheduler -->|"reads targets"| node_commander_db
node_task_scheduler -->|"writes tasks"| node_agent_gateway
node_agent_gateway -->|"receives reports"| node_telemetry_handler
node_telemetry_handler -->|"stores results"| node_commander_db
node_commander_db -->|"reads and writes"| node_mysql
node_scout_process -->|"connects and registers"| node_scout_connection
node_scout_connection -->|"WSS with mTLS"| node_agent_gateway
node_scout_connection -->|"reads tasks"| node_task_validation
node_task_validation -->|"authorizes ping"| node_ping_execution
node_ping_execution -->|"collects result"| node_result_reporting
node_result_reporting -->|"writes report"| node_scout_connection
node_analyst_ui -.->|"dashboard requests"| node_analyst_service
node_operator -.->|"views results"| node_analyst_ui
node_analyst_service -->|"authenticates requests"| node_analyst_auth
node_analyst_service -.->|"routes queries"| node_result_queries
node_result_queries -->|"queries results"| node_mysql
node_commander_service -->|"uses message type"| node_message_model
node_scout_process -->|"uses message type"| node_message_model

click node_web_client "https://github.com/cagrisaltik/sentinel-system/blob/main/web/commander/index.html"
click node_commander_service "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go"
click node_commander_auth "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go"
click node_agent_gateway "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go"
click node_task_scheduler "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go"
click node_telemetry_handler "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go"
click node_commander_db "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go"
click node_scout_process "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go"
click node_scout_connection "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go"
click node_task_validation "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go"
click node_ping_execution "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go"
click node_result_reporting "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go"
click node_analyst_ui "https://github.com/cagrisaltik/sentinel-system/blob/main/web/analyst/index.html"
click node_analyst_service "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go"
click node_analyst_auth "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go"
click node_result_queries "https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go"
click node_message_model "https://github.com/cagrisaltik/sentinel-system/blob/main/internal/models/message.go"

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_commander_service,node_commander_auth,node_agent_gateway,node_task_scheduler,node_telemetry_handler,node_commander_db toneBlue
class node_scout_process,node_scout_connection,node_task_validation,node_ping_execution,node_result_reporting,node_mysql toneAmber
class node_analyst_ui,node_analyst_service,node_analyst_auth,node_result_queries toneMint
class node_message_model toneRose
class node_operator toneIndigo
class node_web_client toneTeal
```

## Components

### Commander

- [Commander Service](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go): `cmd/commander/main.go`
- [Login and Sessions](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go): `cmd/commander/main.go`
- [Agent Gateway](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go): `cmd/commander/main.go`
- [Task Scheduler](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go): `cmd/commander/main.go`
- [Telemetry Validation](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go): `cmd/commander/main.go`
- [Commander Database Access](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/commander/main.go): `cmd/commander/main.go`

### Scout Agent

- [Scout Agent](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go): `cmd/scout/main.go`
- [Secure Connection](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go): `cmd/scout/main.go`
- [Task Validation](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go): `cmd/scout/main.go`
- [Ping Execution](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go): `cmd/scout/main.go`
- [Telemetry Reporting](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/scout/main.go): `cmd/scout/main.go`

### Analyst

- [Analyst Dashboard](https://github.com/cagrisaltik/sentinel-system/blob/main/web/analyst/index.html): `web/analyst/index.html`
- [Analyst Service](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go): `cmd/analyst/main.go`
- [Authentication and Sessions](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go): `cmd/analyst/main.go`
- [Result Queries](https://github.com/cagrisaltik/sentinel-system/blob/main/cmd/analyst/main.go): `cmd/analyst/main.go`

### Shared Protocol

- [Agent Messages](https://github.com/cagrisaltik/sentinel-system/blob/main/internal/models/message.go): `internal/models/message.go`

### Other components

- **Operator**
- [Commander Panel](https://github.com/cagrisaltik/sentinel-system/blob/main/web/commander/index.html): `web/commander/index.html`
- **MySQL Database**

## Connections

- Operator → Commander Panel: uses (evidence: `README.md`)
- Commander Panel → Commander Service: HTTPS requests (evidence: `README.md`)
- Commander Service → Login and Sessions: handles login (evidence: `cmd/commander/main.go`)
- Commander Service → Agent Gateway: routes agent traffic (evidence: `cmd/commander/main.go`)
- Task Scheduler → Commander Database Access: reads targets (evidence: `cmd/commander/main.go`)
- Task Scheduler → Agent Gateway: writes tasks (evidence: `cmd/commander/main.go`)
- Agent Gateway → Telemetry Validation: receives reports (evidence: `README.md`)
- Telemetry Validation → Commander Database Access: stores results (evidence: `cmd/commander/main.go`)
- Commander Database Access → MySQL Database: reads and writes (evidence: `README.md`)
- Scout Agent → Secure Connection: connects and registers (evidence: `cmd/scout/main.go`)
- Secure Connection → Agent Gateway: WSS with mTLS (evidence: `README.md`)
- Secure Connection → Task Validation: reads tasks (evidence: `cmd/scout/main.go`)
- Task Validation → Ping Execution: authorizes ping (evidence: `cmd/scout/main.go`)
- Ping Execution → Telemetry Reporting: collects result (evidence: `cmd/scout/main.go`)
- Telemetry Reporting → Secure Connection: writes report (evidence: `cmd/scout/main.go`)
- Analyst Dashboard → Analyst Service: dashboard requests
- Operator → Analyst Dashboard: views results
- Analyst Service → Authentication and Sessions: authenticates requests (evidence: `cmd/analyst/main.go`)
- Analyst Service → Result Queries: routes queries (evidence: `cmd/analyst/main.go`)
- Result Queries → MySQL Database: queries results (evidence: `cmd/analyst/main.go`)
- Commander Service → Agent Messages: uses message type (evidence: `cmd/commander/main.go`)
- Scout Agent → Agent Messages: uses message type (evidence: `cmd/scout/main.go`)
