← Back to SOC feed Coverage →

Malware detections by Workload Locations

kql MEDIUM Azure-Sentinel
T1566
CloudAppEvents
huntingmicrosoftofficial
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-05-11T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may leverage SharePoint, OneDrive, or Teams to store and execute malware, exploiting the widespread use of these platforms to evade traditional detection. SOC teams should proactively hunt for this behavior to identify potential lateral movement or data exfiltration tactics hidden within legitimate cloud storage environments.

KQL Query

CloudAppEvents
| where ActionType == 'FileMalwareDetected'
| project location=(split(RawEventData.SiteUrl, '/')[4])
| summarize count() by tostring(location)
| sort by count_ desc
| render columnchart

Analytic Rule Definition

id: bb6afb85-8e80-4c98-b73b-c2c821528a1c
name: Malware detections by Workload Locations
description: |
  This query visualises the amount of total Malware detections of files located on SharePoint, OneDrive and Teams, summarizing by the locations they are stored
description-detailed: |
  This query visualises the amount of total Malware detections of files located on SharePoint, OneDrive and Teams, summarizing by the locations they are stored
  Query is also included as part of the Defender for Office 365 solution in Sentinel: https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/part-2-build-custom-email-security-reports-and-dashboards-with-workbooks-in-micr/4411303
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - CloudAppEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  CloudAppEvents
  | where ActionType == 'FileMalwareDetected'
  | project location=(split(RawEventData.SiteUrl, '/')[4])
  | summarize count() by tostring(location)
  | sort by count_ desc
  | render columnchart
version: 1.0.0

Required Data Sources

Sentinel TableNotes
CloudAppEventsEnsure 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/Microsoft 365 Defender/Email and Collaboration Queries/Malware/Malware detections by Workload Locations.yaml