Skip to content

Commit d00b6e2

Browse files
yossibruss-msjobrus-msCopilotMicrosoft Graph DevX ToolingJarbasHorst
authored
Promote detectionRules API documentation to v1.0 (#29493)
* docs: promote detectionRules API to v1.0 Reuse the merged beta documentation baseline and align the GA content with the final Prod v1.0 CSDL. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7cb4985d-129f-4c73-b77a-4215d05cd57c * Fix detection rules API example formatting Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fb95bf3-033c-4ef3-a362-ab01738ad6ed * Address detection rules documentation review comments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9fb95bf3-033c-4ef3-a362-ab01738ad6ed * docs: add detection rule method changelog entries Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f8721817-8c09-4641-8e24-84493f0212dc * Update reference TOC * docs: address custom detection review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: f8721817-8c09-4641-8e24-84493f0212dc * Update reference TOC * Update whats-new-overview.md * Update whats-new-overview.md --------- Co-authored-by: Yossi Bruss <jobrus@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Microsoft Graph DevX Tooling <GraphTooling@service.microsoft.com> Co-authored-by: Jarbas Horst <26866873+JarbasHorst@users.noreply.github.com> Copilot-Session: 7cb4985d-129f-4c73-b77a-4215d05cd57c Copilot-Session: 9fb95bf3-033c-4ef3-a362-ab01738ad6ed Copilot-Session: f8721817-8c09-4641-8e24-84493f0212dc Copilot-Session: 22dfbbeb-defb-49d7-a990-58cc080a6d2f
1 parent 6b14794 commit d00b6e2

57 files changed

Lines changed: 3308 additions & 2 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
---
2+
title: "Get detectionRule"
3+
description: "Read the properties and relationships of a detectionRule object."
4+
author: "mmekler"
5+
ms.localizationpriority: medium
6+
ms.subservice: "security"
7+
doc_type: apiPageType
8+
ms.date: 08/25/2026
9+
---
10+
11+
# Get detectionRule
12+
13+
Namespace: microsoft.graph.security
14+
15+
Read the properties and relationships of a [detectionRule](../resources/security-detectionrule.md) object.
16+
17+
With custom detections, you can proactively monitor for and respond to various events and system states, including suspected breach activity and misconfigured assets in your organization's network. Custom detection rules, which are written in [Kusto query language (KQL)](/azure/data-explorer/kusto/query/), automatically trigger [alerts](../resources/security-alert.md) and automated actions when events occur that match a KQL query.
18+
19+
## Permissions
20+
21+
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
22+
23+
<!-- { "blockType": "permissions", "name": "security_detectionrule_get" } -->
24+
[!INCLUDE [permissions-table](../includes/permissions/security-detectionrule-get-permissions.md)]
25+
26+
[!INCLUDE [rbac-security-detection-rules-apis-read](../includes/rbac-for-apis/rbac-security-detection-rules-apis-read.md)]
27+
28+
## HTTP request
29+
30+
<!-- {
31+
"blockType": "ignored"
32+
}
33+
-->
34+
``` http
35+
GET /security/rules/detectionRules/{detectionRuleId}
36+
```
37+
38+
## Optional query parameters
39+
40+
This method supports some of the OData query parameters to help customize the response. For general information, see [OData query parameters](/graph/query-parameters).
41+
42+
## Request headers
43+
44+
|Name|Description|
45+
|:---|:---|
46+
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
47+
48+
## Request body
49+
50+
Don't supply a request body for this method.
51+
52+
## Response
53+
54+
If successful, this method returns a `200 OK` response code and a [microsoft.graph.security.detectionRule](../resources/security-detectionrule.md) object in the response body.
55+
56+
## Examples
57+
58+
### Request
59+
60+
The following example shows a request.
61+
62+
<!-- {
63+
"blockType": "request",
64+
"name": "get_detectionrule"
65+
}
66+
-->
67+
``` http
68+
GET https://graph.microsoft.com/v1.0/security/rules/detectionRules/office-encoded-powershell
69+
```
70+
71+
### Response
72+
73+
The following example shows the response.
74+
75+
>**Note:** The response object shown here might be shortened for readability.
76+
77+
<!-- {
78+
"blockType": "response",
79+
"truncated": true,
80+
"@odata.type": "microsoft.graph.security.detectionRule"
81+
}
82+
-->
83+
``` http
84+
HTTP/1.1 200 OK
85+
Content-Type: application/json
86+
87+
{
88+
"@odata.type": "#microsoft.graph.security.detectionRule",
89+
"id": "office-encoded-powershell",
90+
"displayName": "Suspicious encoded PowerShell from Office",
91+
"description": "Detects encoded PowerShell processes launched by Office applications, a common phishing payload pattern.",
92+
"status": "enabled",
93+
"createdBy": "alice@contoso.com",
94+
"createdDateTime": "2026-05-25T10:15:00Z",
95+
"lastModifiedBy": "alice@contoso.com",
96+
"lastModifiedDateTime": "2026-05-25T10:15:00Z",
97+
"queryCondition": {
98+
"queryText": "DeviceProcessEvents | where InitiatingProcessFileName in~ ('winword.exe','excel.exe','outlook.exe') | where FileName == 'powershell.exe' | where ProcessCommandLine has '-enc'"
99+
},
100+
"schedule": {
101+
"frequency": "PT1H"
102+
},
103+
"detectionAction": {
104+
"alertTemplate": {
105+
"title": "Suspicious encoded PowerShell from Office",
106+
"description": "An Office app launched an encoded PowerShell command, which may indicate phishing-driven code execution.",
107+
"severity": "high",
108+
"recommendedActions": "Investigate the parent Office document, isolate the device, and review the user's recent email activity.",
109+
"entityMappings": {
110+
"accounts": [
111+
{
112+
"nameColumn": "AccountName",
113+
"sidColumn": "AccountSid"
114+
}
115+
]
116+
},
117+
"tactics": [
118+
{
119+
"tactic": "Execution",
120+
"techniques": [
121+
{
122+
"technique": "T1059.001"
123+
}
124+
]
125+
}
126+
]
127+
},
128+
"automatedActions": {
129+
"isolateDevices": [
130+
{
131+
"deviceIdColumn": "DeviceId",
132+
"isolationType": "full"
133+
}
134+
],
135+
"initiateInvestigations": [
136+
{
137+
"deviceIdColumn": "DeviceId"
138+
}
139+
]
140+
}
141+
}
142+
}
143+
```
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
---
2+
title: "Update detectionRule"
3+
description: "Update the properties of a detectionRule object."
4+
author: "mmekler"
5+
ms.localizationpriority: medium
6+
ms.subservice: "security"
7+
doc_type: apiPageType
8+
ms.date: 08/25/2026
9+
---
10+
11+
# Update detectionRule
12+
13+
Namespace: microsoft.graph.security
14+
15+
Update the properties of a [detectionRule](../resources/security-detectionrule.md) object.
16+
17+
## Permissions
18+
19+
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
20+
21+
<!-- { "blockType": "permissions", "name": "security_detectionrule_update" } -->
22+
[!INCLUDE [permissions-table](../includes/permissions/security-detectionrule-update-permissions.md)]
23+
24+
[!INCLUDE [rbac-security-detection-rules-apis-write](../includes/rbac-for-apis/rbac-security-detection-rules-apis-write.md)]
25+
26+
## HTTP request
27+
28+
<!-- {
29+
"blockType": "ignored"
30+
}
31+
-->
32+
``` http
33+
PATCH /security/rules/detectionRules/{detectionRuleId}
34+
```
35+
36+
## Request headers
37+
38+
|Name|Description|
39+
|:---|:---|
40+
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
41+
|Content-Type|application/json. Required.|
42+
43+
## Request body
44+
45+
[!INCLUDE [table-intro](../../includes/update-property-table-intro.md)]
46+
47+
|Property|Type|Description|
48+
|:---|:---|:---|
49+
|description|String|A user-supplied description of the detection rule.|
50+
|detectionAction|[microsoft.graph.security.detectionAction](../resources/security-detectionaction.md)|The actions taken when a detection is made by this rule, including the alert that is created and any automated response actions.|
51+
|displayName|String|The display name of the rule.|
52+
|queryCondition|[microsoft.graph.security.queryCondition](../resources/security-querycondition.md)|The advanced hunting query that defines the detection logic of this rule.|
53+
|schedule|[microsoft.graph.security.ruleSchedule](../resources/security-ruleschedule.md)|The triggering schedule of this rule.|
54+
|status|[microsoft.graph.security.detectionRuleStatus](../resources/enums-security.md#detectionrulestatus-values)|The current run status of the rule. The possible values are: `enabled`, `disabled`, `autoDisabled`, `unknownFutureValue`.|
55+
56+
## Response
57+
58+
If successful, this method returns a `200 OK` response code and a [microsoft.graph.security.detectionRule](../resources/security-detectionrule.md) object in the response body.
59+
60+
## Examples
61+
62+
### Request
63+
64+
The following example shows a request.
65+
66+
<!-- {
67+
"blockType": "request",
68+
"name": "update_detectionrule"
69+
}
70+
-->
71+
``` http
72+
PATCH https://graph.microsoft.com/v1.0/security/rules/detectionRules/office-encoded-powershell
73+
Content-Type: application/json
74+
75+
{
76+
"status": "disabled",
77+
"queryCondition": {
78+
"queryText": "DeviceProcessEvents | where InitiatingProcessFileName in~ ('winword.exe','excel.exe','outlook.exe') | where FileName == 'powershell.exe' | where ProcessCommandLine has '-enc'"
79+
}
80+
}
81+
```
82+
83+
### Response
84+
85+
The following example shows the response.
86+
87+
>**Note:** The response object shown here might be shortened for readability.
88+
89+
<!-- {
90+
"blockType": "response",
91+
"truncated": true,
92+
"@odata.type": "microsoft.graph.security.detectionRule"
93+
}
94+
-->
95+
``` http
96+
HTTP/1.1 200 OK
97+
Content-Type: application/json
98+
99+
{
100+
"@odata.type": "#microsoft.graph.security.detectionRule",
101+
"id": "office-encoded-powershell",
102+
"displayName": "Suspicious encoded PowerShell from Office",
103+
"description": "Detects encoded PowerShell processes launched by Office applications, a common phishing payload pattern.",
104+
"status": "disabled",
105+
"createdBy": "alice@contoso.com",
106+
"createdDateTime": "2026-05-25T10:15:00Z",
107+
"lastModifiedBy": "alice@contoso.com",
108+
"lastModifiedDateTime": "2026-05-28T14:30:00Z",
109+
"queryCondition": {
110+
"queryText": "DeviceProcessEvents | where InitiatingProcessFileName in~ ('winword.exe','excel.exe','outlook.exe') | where FileName == 'powershell.exe' | where ProcessCommandLine has '-enc'"
111+
},
112+
"schedule": {
113+
"frequency": "PT1H"
114+
},
115+
"detectionAction": {
116+
"alertTemplate": {
117+
"title": "Suspicious encoded PowerShell from Office",
118+
"description": "An Office app launched an encoded PowerShell command, which may indicate phishing-driven code execution.",
119+
"severity": "high",
120+
"recommendedActions": "Investigate the parent Office document, isolate the device, and review the user's recent email activity.",
121+
"entityMappings": {
122+
"accounts": [
123+
{
124+
"nameColumn": "AccountName",
125+
"sidColumn": "AccountSid"
126+
}
127+
]
128+
},
129+
"tactics": [
130+
{
131+
"tactic": "Execution",
132+
"techniques": [
133+
{
134+
"technique": "T1059.001"
135+
}
136+
]
137+
}
138+
]
139+
},
140+
"automatedActions": {
141+
"isolateDevices": [
142+
{
143+
"deviceIdColumn": "DeviceId",
144+
"isolationType": "full"
145+
}
146+
],
147+
"initiateInvestigations": [
148+
{
149+
"deviceIdColumn": "DeviceId"
150+
}
151+
]
152+
}
153+
}
154+
}
155+
```
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: "Delete detectionRule"
3+
description: "Delete a detectionRule object."
4+
author: "mmekler"
5+
ms.localizationpriority: medium
6+
ms.subservice: "security"
7+
doc_type: apiPageType
8+
ms.date: 08/25/2026
9+
---
10+
11+
# Delete detectionRule
12+
13+
Namespace: microsoft.graph.security
14+
15+
Delete a [detectionRule](../resources/security-detectionrule.md) object.
16+
17+
## Permissions
18+
19+
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions [only if your app requires it](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference).
20+
21+
<!-- { "blockType": "permissions", "name": "security_rulesroot_delete_detectionrules" } -->
22+
[!INCLUDE [permissions-table](../includes/permissions/security-rulesroot-delete-detectionrules-permissions.md)]
23+
24+
[!INCLUDE [rbac-security-detection-rules-apis-write](../includes/rbac-for-apis/rbac-security-detection-rules-apis-write.md)]
25+
26+
## HTTP request
27+
28+
<!-- {
29+
"blockType": "ignored"
30+
}
31+
-->
32+
``` http
33+
DELETE /security/rules/detectionRules/{detectionRuleId}
34+
```
35+
36+
## Request headers
37+
38+
|Name|Description|
39+
|:---|:---|
40+
|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).|
41+
42+
## Request body
43+
44+
Don't supply a request body for this method.
45+
46+
## Response
47+
48+
If successful, this method returns a `204 No Content` response code.
49+
50+
## Examples
51+
52+
### Request
53+
54+
The following example shows a request.
55+
56+
<!-- {
57+
"blockType": "request",
58+
"name": "delete_detectionrule"
59+
}
60+
-->
61+
``` http
62+
DELETE https://graph.microsoft.com/v1.0/security/rules/detectionRules/4790e8ec-9488-3dde-c3a6-be0c4ba14cf9
63+
```
64+
65+
### Response
66+
67+
The following example shows the response.
68+
69+
<!-- {
70+
"blockType": "response"
71+
}
72+
-->
73+
``` http
74+
HTTP/1.1 204 No Content
75+
```

0 commit comments

Comments
 (0)