Detect When Large Number of Files Downloaded From OneDrive or SharePoint
Description of the Query:
KQL Query:
let start_time = ago(1d);
let threshold = 50; // Adjust this threshold based on your environment's normal activity
let highVolumeDownloads =
OfficeActivity
| where TimeGenerated >= start_time
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull", "FileSyncDownloadedPartial")
| where UserType == "Regular"
| summarize
FileCount = count(),
UniqueFiles = dcount(OfficeId)
by UserId, UserAgent, SourceFileName,
bin(TimeGenerated, 1h),
SourceRelativeUrl
| extend Site_ = iff(isnotempty(SourceRelativeUrl),
case(
SourceRelativeUrl contains "/personal/", "OneDrive",
SourceRelativeUrl contains "/sites/", "SharePoint",
"Unknown"
),
"Unknown")
| where FileCount > threshold
| project TimeGenerated, UserId, UserAgent, Site_, SourceFileName, FileCount, UniqueFiles;
highVolumeDownloadsExplanation of the Query:
Use Case:
Notes:
PreviousDetect Potential Cleartext Credentials in CommandlineNextIdentify and Investigate Phishing Attacks with KQL
Last updated