| title | Get detectionRule |
|---|---|
| description | Read the properties and relationships of a custom detection rule. |
| author | mmekler |
| ms.localizationpriority | medium |
| ms.subservice | security |
| doc_type | apiPageType |
| ms.date | 06/21/2024 |
Namespace: microsoft.graph.security
[!INCLUDE beta-disclaimer]
Read the properties and relatonships of a custom detection rule.
With custom detections, you can proactively monitor for and respond to various events and system states, including suspected breach activity and misconfigured assets in their organization network. Custom detection rules, which are written in Kusto query language (KQL), automatically trigger alerts and response actions when events occur that match a KQL query.
[!INCLUDE national-cloud-support]
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. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
[!INCLUDE permissions-table]
GET /security/rules/detectionRules/{ruleId}This method supports some of the OData query parameters to help customize the response. For general information, see OData query parameters.
| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
Don't supply a request body for this method.
If successful, this method returns a 200 OK response code and a microsoft.graph.security.detectionRule object in the response body.
The following example shows a request.
GET https://graph.microsoft.com/beta/security/rules/detectionRules/7506
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
[!INCLUDE sample-code] [!INCLUDE sdk-documentation]
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.security.detectionRule",
"id": "7506",
"displayName": "ban file",
"isEnabled": true,
"createdBy": "NaderK@winatptestlic06.ccsctp.net",
"createdDateTime": "2021-02-28T16:28:15.3863467Z",
"lastModifiedDateTime": "2023-05-24T09:26:11.8630516Z",
"lastModifiedBy": "GlobalAdmin@unifiedrbactest3.ccsctp.net",
"detectorId": "67895317-b2a8-4ac3-8f8b-fa6b7765f2fe",
"queryCondition": {
"queryText": "DeviceFileEvents\r\n| where Timestamp > ago(1h)\r\n| where FileName == \"ifz30zlx.dll\"",
"lastModifiedDateTime": null
},
"schedule": {
"period": "24H",
"nextRunDateTime": "2023-06-26T08:52:06.1766667Z"
},
"lastRunDetails": {
"lastRunDateTime": "2023-06-25T08:52:06.1766667Z",
"status": null,
"failureReason": null,
"errorCode": null
},
"detectionAction": {
"alertTemplate": {
"title": "unwanted dll",
"description": "test",
"severity": "low",
"category": "Malware",
"recommendedActions": null,
"mitreTechniques": [],
"impactedAssets": []
},
"organizationalScope": null,
"responseActions": [
{
"@odata.type": "#microsoft.graph.security.restrictAppExecutionResponseAction",
"identifier": "deviceId"
},
{
"@odata.type": "#microsoft.graph.security.initiateInvestigationResponseAction",
"identifier": "deviceId"
},
{
"@odata.type": "#microsoft.graph.security.collectInvestigationPackageResponseAction",
"identifier": "deviceId"
},
{
"@odata.type": "#microsoft.graph.security.runAntivirusScanResponseAction",
"identifier": "deviceId"
},
{
"@odata.type": "#microsoft.graph.security.isolateDeviceResponseAction",
"isolationType": "full",
"identifier": "deviceId"
},
{
"@odata.type": "#microsoft.graph.security.blockFileResponseAction",
"identifier": "sha1",
"deviceGroupNames": []
}
]
}
}