Detection rules › Kusto
Dataverse - New Dataverse application user activity type
Identifies new or previously unseen activity types associated with Dataverse application (non-interactive) user.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | T1078 Valid Accounts |
| Credential Access | T1635 Steal Application Access Token |
| Execution | T0871 Execution through API |
Rule body kusto
id: 5c768e7d-7e5e-4d57-80d4-3f50c96fbf70
kind: Scheduled
name: Dataverse - New Dataverse application user activity type
description: Identifies new or previously unseen activity types associated with Dataverse
application (non-interactive) user.
severity: Medium
status: Available
requiredDataConnectors:
- connectorId: Dataverse
dataTypes:
- DataverseActivity
queryFrequency: 1h
queryPeriod: 14d
triggerOperator: gt
triggerThreshold: 0
tactics:
- CredentialAccess
- Execution
- PrivilegeEscalation
relevantTechniques:
- T1635
- T0871
- T1078
query: |
let query_frequency = 1h;
let query_lookback = 14d;
let app_user_regex = "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\.com$";
let guid_regex = "([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})";
let application_users = DataverseActivity
| where UserId !endswith "@onmicrosoft.com" and UserId != "Unknown"
| summarize by UserId
| where split(UserId, "@")[1] matches regex app_user_regex;
let historical_app_activity = application_users
| join kind = inner (
DataverseActivity
| where TimeGenerated between(ago(query_lookback) .. ago(query_frequency))
| summarize by UserId, EntityName, Message, InstanceUrl)
on
UserId;
let current_activity = application_users
| join kind= inner (
DataverseActivity
| where TimeGenerated >= ago(query_frequency)
| summarize by UserId, EntityName, Message, InstanceUrl)
on
UserId;
current_activity
| join kind = leftanti (historical_app_activity) on UserId, Message, EntityName, InstanceUrl
| summarize NewActivities = make_set(strcat(Message, " ", EntityName), 1000) by UserId, InstanceUrl
| extend
AadUserId = extract(guid_regex, 1, tostring(split(UserId, "@")[0])),
CloudAppId = int(32780)
| project
UserId,
NewActivities,
InstanceUrl,
AadUserId,
CloudAppId
eventGroupingSettings:
aggregationKind: SingleAlert
entityMappings:
- entityType: Account
fieldMappings:
- identifier: AadUserId
columnName: AadUserId
- entityType: CloudApplication
fieldMappings:
- identifier: AppId
columnName: CloudAppId
- identifier: InstanceName
columnName: InstanceUrl
alertDetailsOverride:
alertDisplayNameFormat: 'Dataverse - Unusual non-interactive account activity in
{{InstanceUrl}} '
alertDescriptionFormat: '{{UserId}} generated new activities in {{InstanceUrl}}
which had not been seen previously in the Dataverse.'
version: 3.2.0
Stages and Predicates
Parameters
let query_frequency = 1h;
let query_lookback = 14d;
let app_user_regex = "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\.com$";
let guid_regex = "([0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12})";
Let binding: historical_app_activity
let historical_app_activity = application_users
| join kind = inner (
DataverseActivity
| where TimeGenerated between(ago(query_lookback) .. ago(query_frequency))
| summarize by UserId, EntityName, Message, InstanceUrl)
on
UserId;
Derived from query_frequency, query_lookback, application_users.
The stages below define let current_activity (the rule's main pipeline source).
Stage 1: source
DataverseActivity
Stage 2: where
| where UserId !endswith "@onmicrosoft.com" and UserId != "Unknown"
Stage 3: summarize
| summarize by UserId
Stage 4: where
| where split(UserId, "@")[1] matches regex app_user_regex
Stage 5: join
| join kind= inner (
DataverseActivity
| where TimeGenerated >= ago(query_frequency)
| summarize by UserId, EntityName, Message, InstanceUrl)
on
UserId
The stages below run on current_activity (the outer pipeline).
Stage 6: join (negated)
current_activity
| join kind = leftanti (historical_app_activity) on UserId, Message, EntityName, InstanceUrl
Stage 7: summarize
| summarize NewActivities = make_set(strcat(Message, " ", EntityName), 1000) by UserId, InstanceUrl
Stage 8: extend
| extend
AadUserId = extract(guid_regex, 1, tostring(split(UserId, "@")[0])),
CloudAppId = int(32780)
Stage 9: project
| project
UserId,
NewActivities,
InstanceUrl,
AadUserId,
CloudAppId
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
UserId | ends_with | @onmicrosoft.com |
UserId | ne | Unknown |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
Output fields
Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.
| Field | Source |
|---|---|
AadUserId | project |
CloudAppId | project |
InstanceUrl | project |
NewActivities | project |
UserId | project |