# harshitaawantstocode/cpi_sentinelrs architecture

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

- Interactive diagram: https://gitdiagram.com/harshitaawantstocode/cpi_sentinelrs
- Repository: https://github.com/harshitaawantstocode/cpi_sentinelrs

## Overview

SentinelRS is a cloud-threat monitoring and response platform. Its intended user-to-result flow is AWS telemetry or replayed/simulated events, normalization, detection, correlation and risk assessment, followed by incident presentation and optionally gated containment. The README also describes ATT&CK mapping, posture/drift analysis, threat intelligence, attack-path queries, and a SOC interface. Some subsystem links below reflect documented capabilities; their runtime wiring could not be verified from the sampled source.

Main entry points: [`crates/sentinel-core/src/security.rs`](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-core/src/security.rs) (Security findings), [`crates/sentinel-correlation/src/engine.rs`](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/engine.rs) (Correlation engine), [`crates/sentinel-core/src/event.rs`](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-core/src/event.rs) (Cloud event model), [`crates/sentinel-detection/src/registry.rs`](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/registry.rs) (Detector registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Telemetry and enrichment"]
  node_aws["AWS telemetry<br/>[aws.rs]"]
  node_guardduty["GuardDuty collector<br/>[guardduty.rs]"]
  node_event_sources["Replay and generators<br/>[replay.rs]"]
  node_threat_intel["Threat intelligence<br/>[threat_intel.rs]"]
  node_normalizer["Event normalization<br/>[lib.rs]"]
end

subgraph group_analysis["Detection and investigation"]
  node_detection_context["Behavior context<br/>[context.rs]"]
  node_detection_rules["Detection rules<br/>[rules.rs]"]
  node_detection_registry["Detector registry<br/>[registry.rs]"]
  node_correlation_engine["Correlation engine<br/>[engine.rs]"]
  node_attack_chain["Attack chains<br/>[chain.rs]"]
  node_asset_inventory["Asset inventory<br/>[asset_inventory.rs]"]
  node_attack_graph["Attack graph<br/>[graph.rs]"]
  node_path_query["Attack path queries<br/>[path_query.rs]"]
  node_posture_drift["Posture and drift<br/>[posture.rs]"]
  node_mitre_mapper["ATT&amp;CK mapping<br/>[lib.rs]"]
end

subgraph group_response["Risk and response"]
  node_risk_engine["Explainable risk<br/>[lib.rs]"]
  node_response_orchestrator["Response orchestrator<br/>[lib.rs]"]
  node_storage[("State and persistence<br/>[lib.rs]")]
end

subgraph group_delivery["Service and console"]
  node_api["REST and WebSocket API<br/>[lib.rs]"]
  node_server["Server process<br/>[main.rs]"]
  node_frontend["SOC console<br/>[app.js]"]
end

subgraph group_domain["Shared domain"]
  node_cloud_event["Cloud event model<br/>[event.rs]"]
  node_security_models["Security findings<br/>[security.rs]"]
end

node_operator(("Security operator"))
node_aws_services["AWS services"]

node_aws_services -.->|"supplies telemetry"| node_aws
node_aws -.->|"normalizes events"| node_normalizer
node_guardduty -->|"creates findings"| node_security_models
node_event_sources -.->|"produces events"| node_cloud_event
node_threat_intel -->|"enriches indicators"| node_security_models
node_normalizer -.->|"creates events"| node_cloud_event
node_cloud_event -->|"updates profiles"| node_detection_context
node_cloud_event -->|"evaluates event"| node_detection_rules
node_detection_registry -->|"uses context"| node_detection_context
node_detection_registry -->|"registers rules"| node_detection_rules
node_detection_registry -.->|"uses detector interface"| node_correlation_engine
node_detection_rules -->|"emits findings"| node_security_models
node_correlation_engine -->|"updates chain"| node_attack_chain
node_correlation_engine -->|"calculates risk"| node_risk_engine
node_correlation_engine -->|"creates incidents"| node_security_models
node_security_models -.->|"provides findings"| node_correlation_engine
node_attack_graph -.->|"supports path queries"| node_path_query
node_asset_inventory -.->|"informs graph"| node_attack_graph
node_posture_drift -.->|"produces findings"| node_security_models
node_risk_engine -.->|"supports analysis"| node_mitre_mapper
node_security_models -.->|"prompts containment"| node_response_orchestrator
node_response_orchestrator -.->|"records state"| node_storage
node_operator -.->|"reviews incidents"| node_frontend
node_frontend -.->|"requests data"| node_api
node_server -.->|"serves endpoints"| node_api
node_api -.->|"streams events"| node_operator

click node_aws "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/aws.rs"
click node_guardduty "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/guardduty.rs"
click node_event_sources "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/replay.rs"
click node_threat_intel "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/threat_intel.rs"
click node_normalizer "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-normalizer/src/lib.rs"
click node_cloud_event "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-core/src/event.rs"
click node_security_models "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-core/src/security.rs"
click node_detection_context "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/context.rs"
click node_detection_rules "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/rules.rs"
click node_detection_registry "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/registry.rs"
click node_correlation_engine "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/engine.rs"
click node_attack_chain "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/chain.rs"
click node_asset_inventory "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/asset_inventory.rs"
click node_attack_graph "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/graph.rs"
click node_path_query "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/path_query.rs"
click node_posture_drift "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/posture.rs"
click node_risk_engine "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-risk/src/lib.rs"
click node_mitre_mapper "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-mitre/src/lib.rs"
click node_response_orchestrator "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-response/src/lib.rs"
click node_storage "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-storage/src/lib.rs"
click node_api "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-api/src/lib.rs"
click node_server "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/services/sentinel-server/src/main.rs"
click node_frontend "https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/frontend/app.js"

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_aws,node_guardduty,node_event_sources,node_threat_intel,node_normalizer toneBlue
class node_detection_context,node_detection_rules,node_detection_registry,node_correlation_engine,node_attack_chain,node_asset_inventory,node_attack_graph,node_path_query,node_posture_drift,node_mitre_mapper toneAmber
class node_risk_engine,node_response_orchestrator,node_storage toneMint
class node_api,node_server,node_frontend toneRose
class node_cloud_event,node_security_models,node_operator,node_aws_services toneIndigo
```

## Components

### Telemetry and enrichment

- [AWS telemetry](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/aws.rs): `crates/sentinel-ingest/src/aws.rs`
- [GuardDuty collector](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/guardduty.rs): `crates/sentinel-ingest/src/guardduty.rs`
- [Replay and generators](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/replay.rs): `crates/sentinel-ingest/src/replay.rs`
- [Threat intelligence](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-ingest/src/threat_intel.rs): `crates/sentinel-ingest/src/threat_intel.rs`
- [Event normalization](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-normalizer/src/lib.rs): `crates/sentinel-normalizer/src/lib.rs`

### Detection and investigation

- [Behavior context](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/context.rs): `crates/sentinel-detection/src/context.rs`
- [Detection rules](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/rules.rs): `crates/sentinel-detection/src/rules.rs`
- [Detector registry](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-detection/src/registry.rs): `crates/sentinel-detection/src/registry.rs`
- [Correlation engine](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/engine.rs): `crates/sentinel-correlation/src/engine.rs`
- [Attack chains](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/chain.rs): `crates/sentinel-correlation/src/chain.rs`
- [Asset inventory](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/asset_inventory.rs): `crates/sentinel-correlation/src/asset_inventory.rs`
- [Attack graph](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/graph.rs): `crates/sentinel-correlation/src/graph.rs`
- [Attack path queries](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/path_query.rs): `crates/sentinel-correlation/src/path_query.rs`
- [Posture and drift](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-correlation/src/posture.rs): `crates/sentinel-correlation/src/posture.rs`
- [ATT&CK mapping](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-mitre/src/lib.rs): `crates/sentinel-mitre/src/lib.rs`

### Risk and response

- [Explainable risk](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-risk/src/lib.rs): `crates/sentinel-risk/src/lib.rs`
- [Response orchestrator](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-response/src/lib.rs): `crates/sentinel-response/src/lib.rs`
- [State and persistence](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-storage/src/lib.rs): `crates/sentinel-storage/src/lib.rs`

### Service and console

- [REST and WebSocket API](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-api/src/lib.rs): `crates/sentinel-api/src/lib.rs`
- [Server process](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/services/sentinel-server/src/main.rs): `services/sentinel-server/src/main.rs`
- [SOC console](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/frontend/app.js): `frontend/app.js`

### Shared domain

- [Cloud event model](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-core/src/event.rs): `crates/sentinel-core/src/event.rs`
- [Security findings](https://github.com/harshitaawantstocode/cpi_sentinelrs/blob/main/crates/sentinel-core/src/security.rs): `crates/sentinel-core/src/security.rs`

### Other components

- **Security operator**
- **AWS services**

## Connections

- AWS services → AWS telemetry: supplies telemetry
- AWS telemetry → Event normalization: normalizes events
- GuardDuty collector → Security findings: creates findings (evidence: `crates/sentinel-ingest/src/guardduty.rs`)
- Replay and generators → Cloud event model: produces events
- Threat intelligence → Security findings: enriches indicators (evidence: `crates/sentinel-ingest/src/threat_intel.rs`)
- Event normalization → Cloud event model: creates events
- Cloud event model → Behavior context: updates profiles (evidence: `crates/sentinel-detection/src/context.rs`)
- Cloud event model → Detection rules: evaluates event (evidence: `crates/sentinel-detection/src/rules.rs`)
- Detector registry → Behavior context: uses context (evidence: `crates/sentinel-detection/src/registry.rs`)
- Detector registry → Detection rules: registers rules (evidence: `crates/sentinel-detection/src/registry.rs`)
- Detector registry → Correlation engine: uses detector interface
- Detection rules → Security findings: emits findings (evidence: `crates/sentinel-detection/src/rules.rs`)
- Correlation engine → Attack chains: updates chain (evidence: `crates/sentinel-correlation/src/engine.rs`)
- Correlation engine → Explainable risk: calculates risk (evidence: `crates/sentinel-correlation/src/engine.rs`)
- Correlation engine → Security findings: creates incidents (evidence: `crates/sentinel-correlation/src/engine.rs`)
- Security findings → Correlation engine: provides findings
- Attack graph → Attack path queries: supports path queries
- Asset inventory → Attack graph: informs graph
- Posture and drift → Security findings: produces findings
- Explainable risk → ATT&CK mapping: supports analysis
- Security findings → Response orchestrator: prompts containment
- Response orchestrator → State and persistence: records state
- Security operator → SOC console: reviews incidents
- SOC console → REST and WebSocket API: requests data
- Server process → REST and WebSocket API: serves endpoints
- REST and WebSocket API → Security operator: streams events
