# suchandanreddy/ms-sentinel-customgraph-securitycopilot architecture

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

- Interactive diagram: https://gitdiagram.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot
- Repository: https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot

## Overview

1. This repository is not an application runtime; it is an implementation package for a security investigation workflow. The core artifact is a Microsoft Sentinel Custom Graph solution that lets analysts trace compromised identities to infrastructure access and related security alerts.

2. The architecture has four clear layers. At the bottom is the Sentinel Data Lake, which holds the source telemetry tables. Above that is a PySpark notebook/job that transforms telemetry into a graph. The graph is stored as a Custom Graph instance. At the top is a Security Copilot agent that queries the graph during investigations.

3. The data boundary starts with four Sentinel-backed tables: `SigninLogs_ID_KQL_CL`, `CommonSecurity_ID_KQL_CL`, `DeviceProcessEvents_KQL_CL`, and `SecurityAlerts_KQL_CL`. These represent identity sign-ins, infrastructure access telemetry, endpoint process activity, and detections/alerts. They are the only documented data inputs for the graph build.

4. The graph-building boundary is the notebook `samples/graph-notebooks/IdentityDrift_AccessGraph.ipynb`. It uses PySpark and a GraphSpecBuilder-style API to transform the Sentinel tables into a custom graph schema. A companion job YAML schedules this notebook as a daily graph refresh, making the graph a periodically rebuilt derived dataset rather than a live streaming system.

5. The Custom Graph layer is named `IdentityDrift_AccessGraph` and is the main queryable security model. The README documents 4 node types and 6 edge types, including identities, workloads, devices, and alerts, with relationships such as access, device usage, process execution, and alert triggering/detection. This graph is the central analytical boundary for investigations.

6. The Security Copilot layer is driven by `samples/agent-manifests/IdentityDrift-SecurityCopilot-Agent.yaml`. That manifest defines the agent behavior and the predefined graph queries it can execute. It acts as the interactive interface for analysts and does not build data itself; it consumes the graph via REST/GQL queries.

7. Authentication is delegated to the analyst’s Azure AD identity. The agent uses AAD delegated access with the `https://purview.azure.net/.default` scope, and data access inherits the analyst’s Sentinel workspace RBAC. This means the security boundary is user-contextual, not service-account driven.

8. A key architectural rule is fail-closed query execution. The agent is configured to extract the target identity from the current user message, run a fresh query on every turn, and avoid reusing prior results. The request pattern includes unique request IDs to reduce caching and enforce fresh retrieval each time.

9. The investigation data flow is: analyst prompt → agent extracts identity → agent substitutes parameters into a predefined graph query → graph query runs against the Custom Graph REST API → results are parsed into identity-to-workload-to-alert chains → agent returns structured findings and recommendations. This makes the graph the only analytical source of truth during the conversation.

10. The repository’s main value is in its documentation and deployable samples. The `docs/` directory explains setup, architecture, graph design, and agent deployment; `samples/` contains the runnable notebook, the scheduled job definition, and the Copilot agent manifest. There is no separate backend service, database schema, or UI code in this repo beyond these operational artifacts.

Main entry points: [`samples/graph-notebooks/IdentityDrift_AccessGraph.ipynb`](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/samples/graph-notebooks/IdentityDrift_AccessGraph.ipynb) (Access graph), [`docs/02-architecture.md`](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/02-architecture.md) (Architecture), [`samples/agent-manifests/IdentityDrift-SecurityCopilot-Agent.yaml`](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/samples/agent-manifests/IdentityDrift-SecurityCopilot-Agent.yaml) (Copilot agent), [`README.md`](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/README.md) (README)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Documentation"]
  node_readme["README<br/>overview docs<br/>[README.md]"]
  node_getting_started["Start Here<br/>setup guide"]
  node_architecture_docs["Architecture<br/>design guide<br/>[02-architecture.md]"]
  node_graph_docs["Build Graph<br/>implementation guide"]
  node_copilot_docs["Build Agent<br/>implementation guide"]
end

subgraph group_data["Sentinel Data Lake"]
  node_signin_logs[("Sign-ins<br/>sentinel table")]
  node_security_common[("Access telemetry<br/>sentinel table")]
  node_device_process[("Process events<br/>sentinel table")]
  node_security_alerts[("Alerts<br/>sentinel table")]
end

subgraph group_build["Graph Build"]
  node_notebook["Access graph<br/>pyspark notebook"]
  node_scheduler["Daily refresh<br/>job schedule"]
  node_sample_area["Samples"]
end

subgraph group_graph["Custom Graph"]
  node_graph_instance{{"IdentityDrift_AccessGraph<br/>custom graph"}}
  node_graph_schema["Graph model<br/>nodes and edges"]
end

subgraph group_copilot["Security Copilot"]
  node_agent_manifest["Copilot agent<br/>yaml manifest"]
  node_aad_auth(("AAD delegated<br/>auth boundary"))
  node_graph_api["Graph API<br/>query endpoint"]
  node_investigation_flow{{"Investigation flow<br/>agent workflow"}}
end

node_readme -->|"documents"| node_architecture_docs
node_readme -->|"references"| node_sample_area
node_getting_started -.->|"prepares"| node_notebook
node_architecture_docs -->|"explains"| node_graph_docs
node_architecture_docs -->|"explains"| node_copilot_docs
node_signin_logs -->|"input"| node_notebook
node_security_common -->|"input"| node_notebook
node_device_process -->|"input"| node_notebook
node_security_alerts -->|"input"| node_notebook
node_notebook -->|"builds"| node_graph_schema
node_scheduler -->|"runs"| node_notebook
node_notebook -->|"materializes"| node_graph_instance
node_graph_schema -->|"defines"| node_graph_instance
node_agent_manifest -->|"uses"| node_aad_auth
node_aad_auth -->|"authorizes"| node_graph_api
node_agent_manifest -->|"drives"| node_investigation_flow
node_investigation_flow -->|"queries"| node_graph_api
node_graph_api -->|"reads"| node_graph_instance
node_investigation_flow -->|"analyzes"| node_graph_instance
node_copilot_docs -->|"deploys"| node_agent_manifest
node_graph_docs -->|"implements"| node_notebook

click node_readme "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/README.md"
click node_getting_started "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/01-getting-started.md"
click node_architecture_docs "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/02-architecture.md"
click node_graph_docs "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/03-Build-Custom-Graph.md"
click node_copilot_docs "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/04-Build-Security-Copilot-Agent.md"
click node_notebook "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/samples/graph-notebooks/IdentityDrift_AccessGraph.ipynb"
click node_agent_manifest "https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/samples/agent-manifests/IdentityDrift-SecurityCopilot-Agent.yaml"

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_readme,node_getting_started,node_architecture_docs,node_graph_docs,node_copilot_docs toneBlue
class node_signin_logs,node_security_common,node_device_process,node_security_alerts toneAmber
class node_notebook,node_scheduler,node_sample_area toneMint
class node_graph_instance,node_graph_schema toneRose
class node_agent_manifest,node_aad_auth,node_graph_api,node_investigation_flow toneIndigo
```

## Components

### Documentation

Architecture and setup guidance

- [README](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/README.md): overview docs · Entry point describing the solution, architecture, and samples · `README.md`
- [Start Here](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/01-getting-started.md): setup guide · Environment and initial configuration guidance · `docs/01-getting-started.md`
- [Architecture](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/02-architecture.md): design guide · Explains the layered system and data flow · `docs/02-architecture.md`
- [Build Graph](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/03-Build-Custom-Graph.md): implementation guide · How the custom graph is constructed from Sentinel telemetry · `docs/03-Build-Custom-Graph.md`
- [Build Agent](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/docs/04-Build-Security-Copilot-Agent.md): implementation guide · How to deploy and configure the Security Copilot agent · `docs/04-Build-Security-Copilot-Agent.md`

### Sentinel Data Lake

Source telemetry tables used to build the graph

- **Sign-ins**: sentinel table · Identity sign-in telemetry source
- **Access telemetry**: sentinel table · Infrastructure access and common security events
- **Process events**: sentinel table · Endpoint process activity telemetry source
- **Alerts**: sentinel table · Detections and security alert telemetry source

### Graph Build

Notebook and scheduled refresh that materialize the custom graph

- [Access graph](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/samples/graph-notebooks/IdentityDrift_AccessGraph.ipynb): pyspark notebook · Transforms Sentinel telemetry into the custom graph schema · `samples/graph-notebooks/IdentityDrift_AccessGraph.ipynb`
- **Daily refresh**: job schedule · Runs the notebook on a recurring basis to rebuild the graph
- **Samples**: solution samples · Runnable artifacts for graph build and agent deployment

### Custom Graph

Queryable security model for investigations

- **IdentityDrift_AccessGraph**: custom graph · Queryable graph used as the source of truth during investigations
- **Graph model**: nodes and edges · Defines identities, workloads, devices, alerts, and their relationships

### Security Copilot

Agent-driven investigation layer

- [Copilot agent](https://github.com/suchandanreddy/ms-sentinel-customgraph-securitycopilot/blob/main/samples/agent-manifests/IdentityDrift-SecurityCopilot-Agent.yaml): yaml manifest · Defines the Security Copilot agent behavior and graph queries · `samples/agent-manifests/IdentityDrift-SecurityCopilot-Agent.yaml`
- **AAD delegated**: auth boundary · Analyst-context authentication and workspace RBAC enforcement
- **Graph API**: query endpoint · REST/GQL access path used by the agent to query the custom graph
- **Investigation flow**: agent workflow · Extracts identity, runs fresh queries, and returns findings

## Connections

- README → Architecture: documents · README points to the architecture and sample workflow
- README → Samples: references · README introduces the runnable samples
- Start Here → Access graph: prepares · Setup steps enable the graph-building notebook
- Architecture → Build Graph: explains · Architecture docs lead into graph construction details
- Architecture → Build Agent: explains · Architecture docs lead into agent deployment details
- Sign-ins → Access graph: input · Identity sign-in telemetry feeds the graph build
- Access telemetry → Access graph: input · Infrastructure access telemetry feeds the graph build
- Process events → Access graph: input · Process activity telemetry feeds the graph build
- Alerts → Access graph: input · Alert telemetry feeds the graph build
- Access graph → Graph model: builds · Notebook transforms telemetry into graph nodes and edges
- Daily refresh → Access graph: runs · Scheduled job executes the notebook daily
- Access graph → IdentityDrift_AccessGraph: materializes · Notebook refreshes the custom graph instance
- Graph model → IdentityDrift_AccessGraph: defines · Schema shapes the stored graph model
- Copilot agent → AAD delegated: uses · Agent operates with delegated analyst identity
- AAD delegated → Graph API: authorizes · Workspace RBAC and delegated token scope gate graph access
- Copilot agent → Investigation flow: drives · Manifest defines the investigation behavior
- Investigation flow → Graph API: queries · Agent submits predefined graph queries on each turn
- Graph API → IdentityDrift_AccessGraph: reads · Graph API retrieves investigative results from the custom graph
- Investigation flow → IdentityDrift_AccessGraph: analyzes · Findings are derived from the graph as the source of truth
- Build Agent → Copilot agent: deploys · Documentation points to the agent manifest sample
- Build Graph → Access graph: implements · Documentation points to the notebook sample
