let threshold = 25;
union corelight_dns, corelight_dns_red
// rcodes: SERVFAIL=2, NXDOMAIN=3
| where rcode in (2, 3)
| summarize count() by query, id_orig_h, bin(TimeGenerated, 5m)
| where count_ > threshold
relevantTechniques:
- T1568
name: Corelight - C2 DGA Detected Via Repetitive Failures
requiredDataConnectors:
- dataTypes:
- Corelight_v2_dns
- Corelight_v2_dns_red
- corelight_dns
- corelight_dns_red
connectorId: Corelight
entityMappings:
- fieldMappings:
- identifier: Address
columnName: id_orig_h
entityType: IP
triggerThreshold: 0
id: 8eaa2268-74ee-492c-b869-450eff707fef
tactics:
- CommandAndControl
version: 2.1.1
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Corelight/Analytic Rules/CorelightC2RepetitiveFailures.yaml
queryPeriod: 1h
kind: Scheduled
queryFrequency: 1h
severity: Medium
status: Available
description: |
'Detects large amounts of DNS resolution failures.'
query: |
let threshold = 25;
union corelight_dns, corelight_dns_red
// rcodes: SERVFAIL=2, NXDOMAIN=3
| where rcode in (2, 3)
| summarize count() by query, id_orig_h, bin(TimeGenerated, 5m)
| where count_ > threshold
triggerOperator: gt
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"apiVersion": "2024-01-01-preview",
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/8eaa2268-74ee-492c-b869-450eff707fef')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/8eaa2268-74ee-492c-b869-450eff707fef')]",
"properties": {
"alertRuleTemplateName": "8eaa2268-74ee-492c-b869-450eff707fef",
"customDetails": null,
"description": "'Detects large amounts of DNS resolution failures.'\n",
"displayName": "Corelight - C2 DGA Detected Via Repetitive Failures",
"enabled": true,
"entityMappings": [
{
"entityType": "IP",
"fieldMappings": [
{
"columnName": "id_orig_h",
"identifier": "Address"
}
]
}
],
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Corelight/Analytic Rules/CorelightC2RepetitiveFailures.yaml",
"query": "let threshold = 25;\nunion corelight_dns, corelight_dns_red\n// rcodes: SERVFAIL=2, NXDOMAIN=3\n| where rcode in (2, 3)\n| summarize count() by query, id_orig_h, bin(TimeGenerated, 5m)\n| where count_ > threshold\n",
"queryFrequency": "PT1H",
"queryPeriod": "PT1H",
"severity": "Medium",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"CommandAndControl"
],
"techniques": [
"T1568"
],
"templateVersion": "2.1.1",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}