← Back to SOC feed Coverage →

Malware detections by Workload Type

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 these cloud workloads as persistent or command-and-control channels. 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'
| extend Appwithteams = iff(Application =~ 'Microsoft SharePoint Online',strcat(Application,' / Teams Files'),Application)
| extend Appwithteams = trim_start('Microsoft',Appwithteams) | summarize count() by Appwithteams
| sort by count_ desc
| render piechart
// | render columnchart // Uncomment to change the graph type

Analytic Rule Definition

id: 094a9823-e053-4b36-8678-cd70f048db91
name: Malware detections by Workload Type
description: |
  This query visualises the amount of total Malware detections of files located on SharePoint, OneDrive and Teams, summarizing by the workload in which 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 workload in which 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'
  | extend Appwithteams = iff(Application =~ 'Microsoft SharePoint Online',strcat(Application,' / Teams Files'),Application)
  | extend Appwithteams = trim_start('Microsoft',Appwithteams) | summarize count() by Appwithteams
  | sort by count_ desc
  | render piechart
  // | render columnchart // Uncomment to change the graph type
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 Type.yaml