← Back to SOC feed Coverage →

Integrate Purview with Cloud App Events

kql MEDIUM Azure-Sentinel
T1074
CloudAppEventsSecurityAlert
backdoorhuntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-06-03T23:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may leverage integration between Microsoft Purview and cloud app events to exfiltrate data or monitor user activity undetected. SOC teams should proactively hunt for this behavior to identify potential data theft or insider threats in their Azure Sentinel environment.

KQL Query

SecurityAlert
  | where TimeGenerated >= ago(30d)
  | extend EntitiesDynamicArray = parse_json(Entities) 
  | mv-expand EntitiesDynamicArray
  | extend Entitytype = tostring(parse_json(EntitiesDynamicArray).Type), EntityName = tostring(parse_json(EntitiesDynamicArray).Name),
  EntityUPNSuffix = tostring(parse_json(EntitiesDynamicArray).UPNSuffix)
  | where Entitytype =~ "file" and EntityName != ""
  | join kind=inner(CloudAppEvents
  | extend ActivityObjectsDynamicArray = parse_json(ActivityObjects) 
  | mv-expand ActivityObjectsDynamicArray
  | extend Entitytype = tostring(parse_json(ActivityObjectsDynamicArray).Type), EntityName = tostring(RawEventData.SourceFileName),
  EntityUPNSuffix = tostring(parse_json(ActivityObjectsDynamicArray).UPNSuffix)
  | where Entitytype =~ "file") on $left.EntityName == $right.EntityName

Analytic Rule Definition

id: a1adce9c-5945-4a20-984e-d95b6071a791
name: Integrate Purview with Cloud App Events
description: |
  "This query searches for any files in Cloud App Events that have trigger a security alert."
severity: Medium
requiredDataConnectors:
  - connectorId: MicrosoftThreatProtection
    dataTypes:
      - CloudAppEvents
  - connectorId: MicrosoftCloudAppSecurity
    dataTypes:
      - SecurityAlert
tactics:
  - Collection
relevantTechniques:
  - T1074
query: |
  SecurityAlert
    | where TimeGenerated >= ago(30d)
    | extend EntitiesDynamicArray = parse_json(Entities) 
    | mv-expand EntitiesDynamicArray
    | extend Entitytype = tostring(parse_json(EntitiesDynamicArray).Type), EntityName = tostring(parse_json(EntitiesDynamicArray).Name),
    EntityUPNSuffix = tostring(parse_json(EntitiesDynamicArray).UPNSuffix)
    | where Entitytype =~ "file" and EntityName != ""
    | join kind=inner(CloudAppEvents
    | extend ActivityObjectsDynamicArray = parse_json(ActivityObjects) 
    | mv-expand ActivityObjectsDynamicArray
    | extend Entitytype = tostring(parse_json(ActivityObjectsDynamicArray).Type), EntityName = tostring(RawEventData.SourceFileName),
    EntityUPNSuffix = tostring(parse_json(ActivityObjectsDynamicArray).UPNSuffix)
    | where Entitytype =~ "file") on $left.EntityName == $right.EntityName
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: EntityName
      - identifier: UPNSuffix
        columnName: EntityUPNSuffix
      - identifier: FullName
        columnName: UserId
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: ClientIP
version: 1.0.0
kind: Scheduled

Required Data Sources

Sentinel TableNotes
CloudAppEventsEnsure this data connector is enabled
SecurityAlertEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/MultipleDataSources/SuspiciousActivitiesRelatedToConfidentialDocuments.yaml