Documentation

July 28, 2026 ยท View on GitHub

Sentinel-As-Code

Documentation

The Docs/ tree mirrors the repository layout: each folder documents the same-named folder in the repo, so the docs for a piece of code live under the matching path (Deploy/ maps to Docs/Deploy/, Pipelines/ to Docs/Pipelines/, .github/ to Docs/GitHub/, and so on). Three folders have no code counterpart and are grouped by concern instead: Guides/, Releases/ and Toolkit/ (the companion VS Code extension, which lives in a separate repository).

Content - Content/

Schemas and conventions for every content type the repo deploys. The Toolkit schemas and templates are the authoring source of truth for these; each doc cross-links the matching Toolkit pages.

DocWhat it covers
Analytical RulesYAML schema for custom analytics rules: required fields, canonical order, deploy behaviour, Scheduled vs NRT examples
Automation RulesJSON schema for automation rules: trigger conditions, action types (ModifyProperties, RunPlaybook, AddIncidentTask)
Community RulesOpt-in third-party rule contributions: deployment defaults, current sources, adding new contributors
Defender Custom DetectionsDefender XDR YAML schema, Graph API, response actions, impacted-asset identifiers
Hunting QueriesYAML schema for hunting queries: required fields, tactics/techniques tags, export guide
ParsersYAML schema for KQL parsers/functions deployed as workspace saved functions (stage 1 of the content deploy order) via the savedSearches API
PlaybooksARM template requirements, MSI vs standard connections, auto-injected parameters
Summary RulesSummary-rule JSON schema, allowed bin sizes, KQL restrictions, system columns
WatchlistsWatchlist metadata schema, CSV format, KQL usage examples
WorkbooksGallery-template JSON format, stable GUIDs, export from the Sentinel portal

Auto-generated community summaries live under Content/Community/ (one file per contributor, written by Tools/Import-CommunityRules.ps1 with per-category rule listings and last-sync metadata). Do not hand-edit them. Current: Dalonso (David Alonso, see Community Rules).

Deploy - Deploy/

The PowerShell scripts that reach Sentinel and their one-off setup.

DocWhat it covers
ScriptsPowerShell deploy and tooling scripts: parameters, examples, known limitations
PR Validation SetupOne-off GitHub Actions OIDC federated-credential setup for the arm-validate PR job
ADO OIDC SetupOne-off Azure DevOps workload-identity-federation setup for sc-sentinel-as-code
PowerShell Module RequirementsEvery PowerShell module, external binary, and Azure/Entra/Graph permission the scripts need, split by validate vs use

GitHub - .github/

DocWhat it covers
GitHub CopilotCopilot customisations shipped with the repo: instructions, agents, prompts (cross-platform: github.com and every supported IDE)

Infra - Infra/

Azure resources that host Sentinel content.

DocWhat it covers
BicepSubscription-scoped templates, parameters, dual onboarding mechanism, diagnostic settings, optional playbook RG

Modules - Modules/

DocWhat it covers
Sentinel Common ModuleThe shared Modules/Sentinel.Common module (SemVer 1.1.1): Write-PipelineMessage, Invoke-SentinelApi, Connect-AzureEnvironment and the KQL-discovery helpers reused across the deployer scripts

Pipelines - Pipelines/ (and .github/workflows/)

Seven Azure DevOps pipelines mirrored by seven GitHub Actions workflows. Start at the index for the GitHub/ADO parity map, then the per-pipeline pages.

DocWhat it covers
Pipelines indexGitHub/ADO parity map, shared concepts (OIDC, variable group, composite actions), and links to every per-pipeline page
PR ValidationThe five-job PR-merge gate on both CI systems: Pester, Bicep build, ARM validate, KQL validate, dependency-manifest drift
PR Template ValidationGitHub-only check that fails a PR whose description leaves the required template sections empty
DeployThe main end-to-end deploy: infra, Content Hub, custom content, Defender XDR (stages, variable group, parameters, service connection, usage)
Deploy NightlyGitHub-only nightly E2E smoke test against the throwaway Infra/test-workspace/
Drift DetectPortal-drift detection and the auto-PR that absorbs it back into the repo, on both CI systems
DocumenterCI/CD wiring for the Sentinel Documenter (daily on GitHub, manual-trigger-only on ADO)
Dependency UpdateDaily dependencies.json drift check and auto-PR
DCR InventoryCI/CD wiring for the DCR-watchlist sync automation account and runbook
Word ReportADO-only pipeline that renders the Documenter Markdown pack into a page-numbered Word .docx

Tests - Tests/

DocWhat it covers
Pester TestsRunning and extending the Pester suite, the AST-extraction pattern this repo uses, and the CI gate

Tools - Tools/

CI, maintenance, and reporting that runs around deployment.

DocWhat it covers
Dependency ManifestAuto-derived dependencies.json from KQL discovery; PR-validation drift gate; daily auto-PR refresh
Sentinel Drift DetectionDaily detection of portal-edited rules with auto-PR back into the repo
DCR Watchlist SyncAuto-populated DCR inventory watchlist, billing reporting, runbook deployment
SDL Migration Workbook ExportRead-only Export-SdlMigrationWorkbook.ps1 that mirrors every Sentinel Data Lake Migration workbook dataset into one multi-sheet .xlsx

Classic to DCR - Tools/ClassicToDcr/

The standalone toolkit that assesses, migrates and rehearses the move from classic (MMA / HTTP Data Collector API) _CL tables to Data Collection Rule based tables.

DocWhat it covers
Classic to DCR Migration ToolkitOverview and entry point: the three stages, the retirement timeline, prerequisites and RBAC, what migration does not do, and how these pages relate to the kit's own READMEs
Table Migration ReviewFull reference for the read-only assess tool: impact scoring, indirect parser-chain resolution and every guard, the CSV/JSON/HTML outputs, the migration command the report generates, and the known limits
Rehearsal AidsThe three rehearsal scripts: dependency-chain scenarios, the safety design that lets one of them face a live workspace, and the Azure behaviours that catch people out

Documenter - Tools/Documenter/

The read-only documentation generator.

DocWhat it covers
Sentinel DocumenterRead-only daily inventory + gap-analysis that renders a Markdown documentation pack from a live workspace
Renderer DesignDesign spec for the Markdown renderer: what drives each chart and section
References & ConventionsDurable record of every API version, module, KQL query, and Learn page the Documenter relies on (rendered as 99-references.md)
Data Lake CoverageWhat the Documenter captures and renders for the Microsoft Sentinel data lake tier
Word ReportThe Report toolchain (pandoc for the document, LibreOffice/UNO for the real table of contents) behind the ADO Word-Report pipeline

Toolkit - companion VS Code extension

The Sentinel as Code Toolkit is a separate repository (a VS Code extension) for authoring the content types this repo deploys. It authors and validates; it does not deploy. Its schemas and templates are the authoring source of truth for the Content docs.

DocWhat it covers
Toolkit overviewWhat the extension is, the author/deploy boundary, installation, licence, and feedback channel
CommandsEvery command the extension contributes, grouped by task, with palette titles and keybindings
TemplatesThe bundled starter templates, canonical field order, and which content types are authored as YAML and converted to JSON with Convert Content YAML to JSON
Schemas and ValidationThe seven bundled schemas, how validation is triggered, and MITRE ATT&CK multi-framework checking
ConfigurationEvery sentinelAsCode.* setting, its default, and the custom-connectors file
ARM to YAML ConversionDecompiling Microsoft.SecurityInsights/alertRules ARM templates into clean analytics-rule YAML
Defender WorkflowsFormatting, validating, and converting Defender XDR custom detections for the repository
Graph API MigrationsUpcoming Microsoft Graph security API deprecations affecting Defender custom detections (migration tracking)

Guides

End-to-end walkthroughs. No code counterpart.

DocWhat it covers
Build and Test GuideRunning and validating Sentinel-As-Code without a local PowerShell install: requirements, build/test steps, and deployment

Releases

Versioning scheme and the customer-facing changelog. No code counterpart.

DocWhat it covers
VersioningCalVer (YY.0M) scheme, how releases are cut as GitHub Releases (no git tags), the wave to CalVer history, and how repo CalVer relates to the Sentinel.Common module's SemVer
ChangelogCustomer-facing summary of changes per release
Layout Restructure 26.06Old to new path map for the by-concern restructure and the fork-migration steps

Conventions

  • Structure mirrors the repo. A doc for code under X/ lives under Docs/X/. Only Releases/ and Toolkit/ (concern-based, no code folder) are exceptions.
  • Folder landing page: README.md (GitHub renders it when you open the folder). The master index is this file.
  • Filenames: Title-Case-With-Hyphens.md. Acronyms stay uppercase (ARM, DCR, KQL, NRT, OIDC, PR, SDL, YAML); joining words lowercase (to, and, of, for). No spaces, no leading numbers.
  • Cross-links: relative. From a doc at Docs/{Folder}/X.md the repo root is ../../. The link checker in Pester Tests enforces that every relative link resolves.
  • Adding a new doc: place it under the folder that mirrors the code it documents. If it documents no specific code folder, use (or propose) a concern-based folder rather than dropping it at the Docs/ root.