@@ -115,6 +115,85 @@ Analytic Rules are YAML files that define scheduled queries to detect threats, s
115115- ** Pattern** : ` /^\d+\.\d+\.\d+$/ `
116116- ** Example** : ` 1.2.3 ` ✅
117117
118+ #### ** metadata** (Metadata Information - Required for Standalone Files)
119+ - ** Required** : Yes (for standalone detections in ` Detections/ ` folder); No (for rules in ` Solutions/**/Analytic Rules/ ` )
120+ - ** Purpose** : Provides source, author, support tier, and category information for standalone detection rules
121+ - ** Type** : Object with nested properties
122+ - ** Structure** :
123+ ``` yaml
124+ metadata :
125+ source :
126+ kind : Community # or "Microsoft" for official rules
127+ author :
128+ name : Author Name
129+ support :
130+ tier : Community # or "Microsoft" for official support
131+ categories :
132+ domains : [ "Category Name" ]
133+ ` ` `
134+ - **Rules**:
135+ - **Required for standalone files** in root ` Detections/` folder (matches pattern `Detections/**/*.yaml`)
136+ - **Not required** for rules in Solutions folder (`Solutions/**/Analytic Rules/*.yaml`)
137+ - `source.kind` : Typically `Community` or `Microsoft`
138+ - `author.name` : Name of the rule author or organization
139+ - `support.tier` : Support level - `Community` or `Microsoft`
140+ - `categories.domains` : Array of domain/category classifications from the valid domains list
141+
142+ # ### **Valid Domain Categories** (for `categories.domains`)
143+ - Application
144+ - Cloud Provider
145+ - Cloud Security
146+ - Compliance
147+ - DevOps
148+ - Identity
149+ - Internet of Things (IoT)
150+ - IT Operations
151+ - Migration
152+ - Networking
153+ - Platform
154+ - Security
155+ - Security - 0-day Vulnerability
156+ - Security - Automation (SOAR)
157+ - Security - Cloud Security
158+ - Security - Information Protection
159+ - Security - Insider Threat
160+ - Security - Network
161+ - Security - Others
162+ - Security - Threat Intelligence
163+ - Security - Threat Protection
164+ - Security - Vulnerability Management
165+ - Storage
166+ - Training and Tutorials
167+ - User Behavior (UEBA)
168+
169+
170+ - **Valid Examples**:
171+ ` ` ` yaml
172+ metadata:
173+ source:
174+ kind: Community
175+ author:
176+ name: Alex
177+ support:
178+ tier: Community
179+ categories:
180+ domains: [ "Security - Others" ]
181+ ` ` `
182+ ` ` ` yaml
183+ metadata:
184+ source:
185+ kind: Microsoft
186+ author:
187+ name: Microsoft Sentinel Team
188+ support:
189+ tier: Microsoft
190+ categories:
191+ domains: [ "Security - Threat Intelligence", "Security - Threat Protection" ]
192+ ` ` `
193+ - **Invalid Examples** (for standalone files):
194+ - Missing `metadata` section ❌
195+ - Incomplete metadata (missing `author` or `support`) ❌
196+
118197# ### **tactics** (MITRE ATT&CK Tactics)
119198- **Required**: Yes (all rule types)
120199- **Framework Version**: ATT&CK Framework v16 Supported
@@ -238,6 +317,26 @@ Analytic Rules are YAML files that define scheduled queries to detect threats, s
238317 - Must include all connectors required for query execution
239318 - Specify exact data types needed
240319 - Use official connector IDs
320+
321+ # ### **connectorId Validation**
322+ - **Source of Truth**: All `connectorId` values must be validated against the official list:
323+ ```
324+ https://github.com/Azure/Azure-Sentinel/blob/master/.script/tests/detectionTemplateSchemaValidation/ValidConnectorIds.json
325+ ```
326+ - **Validation Process**:
327+ - Check if the `connectorId` value exists in ValidConnectorIds.json
328+ - If NOT found: Flag as invalid and request update to ValidConnectorIds.json
329+ - Case-sensitive matching required
330+ - **Valid Examples**:
331+ - `CiscoDuoSecurity` ✅ (exists in valid list)
332+ - `AzureActiveDirectory` ✅ (exists in valid list)
333+ - `CiscoASA` ✅ (exists in valid list)
334+ - **Invalid Examples**:
335+ - `CiscoDuo` ❌ (correct ID is `CiscoDuoSecurity`)
336+ - `AzureAD` ❌ (correct ID is `AzureActiveDirectory`)
337+ - `CustomConnectorXYZ` ❌ (not in official list - needs to be added to ValidConnectorIds.json)
338+ - **Action if Invalid**:
339+ - Comment: "connectorId `[value]` is not found in the ValidConnectorIds.json file. Please update ValidConnectorIds.json to include this connector or use a valid connector ID from the official list."
241340
242341#### **entityMappings** (Entity Extraction)
243342- **Required**: Yes for Detections
@@ -756,6 +855,20 @@ query: |
756855# Missing: queryFrequency, queryPeriod, triggerOperator, triggerThreshold
757856```
758857
858+ ``` yaml
859+ # Standalone detection file missing metadata (should not appear in Detections/ folder without metadata)
860+ id : 12345678-1234-1234-1234-123456789012
861+ name : Multiple Failed Login Attempts
862+ description : Detects multiple failed login attempts from a single IP
863+ severity : High
864+ status : Available
865+ kind : Scheduled
866+ # ❌ Missing: metadata section (required for standalone Detections/ files)
867+ # Should include: source.kind, author.name, support.tier, categories.domains
868+ query : |
869+ SecurityEvent | where EventID == 4625
870+ ` ` `
871+
759872## Best Practices for Analytic Rules
760873
761874### 1. **Detection Logic Philosophy**
0 commit comments