← Back to SOC feed Coverage →

File Scanning Coverage (SharePoint, OneDrive and Teams)

kql MEDIUM Azure-Sentinel
T1566T1080
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-09-03T11:00:00Z · Confidence: medium

Hunt Hypothesis

This hypothesis targets the adversary behavior of delivering malicious payloads via common collaboration platforms (T1566) and the subsequent execution or persistence of those files (T1080), which often bypass traditional perimeter defenses. Proactively hunting for gaps in file scanning coverage within Azure Sentinel ensures that SOC teams can identify unscanned or undetected files in SharePoint, OneDrive, and Teams, thereby reducing the risk of overlooked malware that has already been ingested into the user environment.

KQL Query

FileMaliciousContentInfo
| where Timestamp > ago(30d)
| summarize FilesProcessed = count(),
            FilesWithMalware = countif(isnotempty(ThreatTypes)),
            FilesNoDetection = countif(isempty(ThreatTypes))
| extend DetectionRatePct = iif(FilesProcessed == 0, 0.0, round(100.0 * FilesWithMalware / FilesProcessed, 2))

Analytic Rule Definition

id: 7d86be89-dbdd-487e-961a-80228935563f
name: File Scanning Coverage (SharePoint, OneDrive and Teams)
description: |
  This query summarises file scanning coverage in SharePoint, OneDrive and Teams: how many files were processed, how many were found malicious, and how many were scanned with no detection, using the FileMaliciousContentInfo table.
description-detailed: |
  The FileMaliciousContentInfo table records files scanned across SharePoint, OneDrive and Teams, whether or not a threat was found. This query reports the total files processed, the number found malicious and the number scanned with no detection, with a detection rate. This scanning-coverage view is not available from action-only sources such as CloudAppEvents.
  This query is part of the Microsoft Defender for Office 365 Detections and Insights workbook in Microsoft Sentinel: https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/part-3-build-custom-email-security-reports-with-power-bi-and-workbooks-in-micros/4490127
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - FileMaliciousContentInfo
tactics:
  - InitialAccess
  - LateralMovement
relevantTechniques:
  - T1566
  - T1080
query: |
  FileMaliciousContentInfo
  | where Timestamp > ago(30d)
  | summarize FilesProcessed = count(),
              FilesWithMalware = countif(isnotempty(ThreatTypes)),
              FilesNoDetection = countif(isempty(ThreatTypes))
  | extend DetectionRatePct = iif(FilesProcessed == 0, 0.0, round(100.0 * FilesWithMalware / FilesProcessed, 2))
version: 1.0.0

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/File Scanning Coverage.yaml