Top File Owners Holding Malware (SharePoint, OneDrive and Teams)
Description
This query lists the file owners (or the SharePoint/Teams site, when a file has no individual owner) whose files in SharePoint, OneDrive or Teams were flagged as malware, using the FileMaliciousContentInfo table.
Query · kql
// Groups by the file owner, or by the SharePoint/Teams site when a file has no individual owner.
FileMaliciousContentInfo
| where Timestamp > ago(30d)
| where isnotempty(ThreatTypes)
| extend Owner = iff(isnotempty(FileOwnerUpn), FileOwnerUpn, strcat('Site: ', tostring(split(FolderPath, '/')[4])))
| summarize MaliciousFiles = count(),
DistinctFiles = dcount(SHA256),
Workloads = make_set(Workload, 3),
SampleThreats = make_set_if(ThreatNames, isnotempty(ThreatNames), 5),
LastSeen = max(Timestamp)
by Owner
| top 20 by MaliciousFiles