Dataverse - Mass record updates
Id | df577f0f-1d8a-4420-9057-a07f0edb15c8 |
Rulename | Dataverse - Mass record updates |
Description | This query detects mass record update changes in Dataverse and Dynamics 365, exceeding a pre-defined threshold. |
Severity | Medium |
Tactics | Impact |
Techniques | T1641 T1485 T1565 |
Required data connectors | Dataverse |
Kind | Scheduled |
Query frequency | 1h |
Query period | 14d |
Trigger threshold | 0 |
Trigger operator | gt |
Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Business Applications/Analytic Rules/Dataverse - Mass record updates.yaml |
Version | 3.2.0 |
Arm template | df577f0f-1d8a-4420-9057-a07f0edb15c8.json |
// Set threshold for number of updated records
let detection_threshold = 10000;
let query_frequency = 1h;
DataverseActivity
| where TimeGenerated >= ago(query_frequency)
| where Message == "Update"
| summarize EventCount = count() by InstanceUrl, UserId, ClientIp, Message
| where EventCount > detection_threshold
| join kind=inner(
DataverseActivity
| where TimeGenerated >= ago(query_frequency))
on InstanceUrl, UserId, ClientIp, Message
| mv-expand Fields
| summarize
UpdatedFields = make_set(Fields.Name, 100),
FirstEvent = min(TimeGenerated)
by UserId, ClientIp, InstanceUrl, EventCount, EntityName
| extend Details = bag_pack("Entity", EntityName, "Count", EventCount, "FieldsUpdated", UpdatedFields)
| summarize
TotalEvents = sum(EventCount),
FirstEvent = min(FirstEvent),
Details = make_list(Details, 100)
by UserId, ClientIp, InstanceUrl
| extend
CloudAppId = int(32780),
AccountName = tostring(split(UserId, '@')[0]),
UPNSuffix = tostring(split(UserId, '@')[1])
| project
FirstEvent,
UserId,
ClientIp,
TotalEvents,
Details,
InstanceUrl,
CloudAppId,
AccountName,
UPNSuffix
relevantTechniques:
- T1641
- T1485
- T1565
name: Dataverse - Mass record updates
queryPeriod: 14d
triggerThreshold: 0
customDetails:
Details: Details
alertDetailsOverride:
alertDescriptionFormat: A total of {{TotalEvents}} records were updated by {{UserId}} , breaching the mass update threshold in {{InstanceUrl}} .
alertDisplayNameFormat: 'Dataverse - Mass record changes detected in {{{InstanceUrl}} '
id: df577f0f-1d8a-4420-9057-a07f0edb15c8
eventGroupingSettings:
aggregationKind: AlertPerResult
severity: Medium
requiredDataConnectors:
- dataTypes:
- DataverseActivity
connectorId: Dataverse
description: This query detects mass record update changes in Dataverse and Dynamics 365, exceeding a pre-defined threshold.
version: 3.2.0
status: Available
entityMappings:
- entityType: Account
fieldMappings:
- columnName: AccountName
identifier: Name
- columnName: UPNSuffix
identifier: UPNSuffix
- entityType: IP
fieldMappings:
- columnName: ClientIp
identifier: Address
- entityType: CloudApplication
fieldMappings:
- columnName: CloudAppId
identifier: AppId
- columnName: InstanceUrl
identifier: InstanceName
tactics:
- Impact
query: |
// Set threshold for number of updated records
let detection_threshold = 10000;
let query_frequency = 1h;
DataverseActivity
| where TimeGenerated >= ago(query_frequency)
| where Message == "Update"
| summarize EventCount = count() by InstanceUrl, UserId, ClientIp, Message
| where EventCount > detection_threshold
| join kind=inner(
DataverseActivity
| where TimeGenerated >= ago(query_frequency))
on InstanceUrl, UserId, ClientIp, Message
| mv-expand Fields
| summarize
UpdatedFields = make_set(Fields.Name, 100),
FirstEvent = min(TimeGenerated)
by UserId, ClientIp, InstanceUrl, EventCount, EntityName
| extend Details = bag_pack("Entity", EntityName, "Count", EventCount, "FieldsUpdated", UpdatedFields)
| summarize
TotalEvents = sum(EventCount),
FirstEvent = min(FirstEvent),
Details = make_list(Details, 100)
by UserId, ClientIp, InstanceUrl
| extend
CloudAppId = int(32780),
AccountName = tostring(split(UserId, '@')[0]),
UPNSuffix = tostring(split(UserId, '@')[1])
| project
FirstEvent,
UserId,
ClientIp,
TotalEvents,
Details,
InstanceUrl,
CloudAppId,
AccountName,
UPNSuffix
kind: Scheduled
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Business Applications/Analytic Rules/Dataverse - Mass record updates.yaml
queryFrequency: 1h
{
"$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/df577f0f-1d8a-4420-9057-a07f0edb15c8')]",
"kind": "Scheduled",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/df577f0f-1d8a-4420-9057-a07f0edb15c8')]",
"properties": {
"alertDetailsOverride": {
"alertDescriptionFormat": "A total of {{TotalEvents}} records were updated by {{UserId}} , breaching the mass update threshold in {{InstanceUrl}} .",
"alertDisplayNameFormat": "Dataverse - Mass record changes detected in {{{InstanceUrl}} "
},
"alertRuleTemplateName": "df577f0f-1d8a-4420-9057-a07f0edb15c8",
"customDetails": {
"Details": "Details"
},
"description": "This query detects mass record update changes in Dataverse and Dynamics 365, exceeding a pre-defined threshold.",
"displayName": "Dataverse - Mass record updates",
"enabled": true,
"entityMappings": [
{
"entityType": "Account",
"fieldMappings": [
{
"columnName": "AccountName",
"identifier": "Name"
},
{
"columnName": "UPNSuffix",
"identifier": "UPNSuffix"
}
]
},
{
"entityType": "IP",
"fieldMappings": [
{
"columnName": "ClientIp",
"identifier": "Address"
}
]
},
{
"entityType": "CloudApplication",
"fieldMappings": [
{
"columnName": "CloudAppId",
"identifier": "AppId"
},
{
"columnName": "InstanceUrl",
"identifier": "InstanceName"
}
]
}
],
"eventGroupingSettings": {
"aggregationKind": "AlertPerResult"
},
"OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Business Applications/Analytic Rules/Dataverse - Mass record updates.yaml",
"query": "// Set threshold for number of updated records\nlet detection_threshold = 10000;\nlet query_frequency = 1h;\nDataverseActivity\n| where TimeGenerated >= ago(query_frequency)\n| where Message == \"Update\"\n| summarize EventCount = count() by InstanceUrl, UserId, ClientIp, Message\n| where EventCount > detection_threshold\n| join kind=inner(\n DataverseActivity\n | where TimeGenerated >= ago(query_frequency))\n on InstanceUrl, UserId, ClientIp, Message\n| mv-expand Fields\n| summarize\n UpdatedFields = make_set(Fields.Name, 100),\n FirstEvent = min(TimeGenerated)\n by UserId, ClientIp, InstanceUrl, EventCount, EntityName\n| extend Details = bag_pack(\"Entity\", EntityName, \"Count\", EventCount, \"FieldsUpdated\", UpdatedFields)\n| summarize\n TotalEvents = sum(EventCount),\n FirstEvent = min(FirstEvent),\n Details = make_list(Details, 100)\n by UserId, ClientIp, InstanceUrl\n| extend\n CloudAppId = int(32780),\n AccountName = tostring(split(UserId, '@')[0]),\n UPNSuffix = tostring(split(UserId, '@')[1])\n| project\n FirstEvent,\n UserId,\n ClientIp,\n TotalEvents,\n Details,\n InstanceUrl,\n CloudAppId,\n AccountName,\n UPNSuffix\n",
"queryFrequency": "PT1H",
"queryPeriod": "P14D",
"severity": "Medium",
"status": "Available",
"subTechniques": [],
"suppressionDuration": "PT1H",
"suppressionEnabled": false,
"tactics": [
"Impact"
],
"techniques": [
"T1485",
"T1565"
],
"templateVersion": "3.2.0",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0
},
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
}
]
}