Join our Newsletter — 33% off our NHI Course
Home› Guides› How to detect mass downloads from SharePoint and…
Guide SOC & Detection Engineering

How to detect mass downloads from SharePoint and OneDrive: audit events, queries and leaver alerts

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 28 November 2026 14 min read
On this page

A leaver syncing a whole document library to a personal laptop, or an attacker replaying a stolen session token, both show up in Microsoft 365 as a burst of FileDownloaded and FileSyncDownloadedFull events that most tenants never alert on. This guide shows how to turn those audit events into working detections: which operations to collect, how to build a per-user baseline, which sample queries to start from in Microsoft Sentinel or Defender XDR advanced hunting, and how to tune them for two scenarios that matter most, departing employees and token theft. It is for SOC analysts, detection engineers and Microsoft 365 administrators. Cross-platform SaaS detection logic is covered in the SaaS Threat Detection Guide, and bulk pulls by applications through Microsoft Graph in Microsoft Graph Exfiltration Detection; this page stays with user downloads from SharePoint and OneDrive.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • Two operations carry most of the signal. FileDownloaded records browser and app downloads from a site, and FileSyncDownloadedFull records files pulled to a computer by the OneDrive sync app; count both, or a sync-based theft looks quiet.
  • Baselines beat fixed thresholds. A sales user who downloads 40 files a day and an engineer who syncs 4,000 need different limits, so compare each user with their own recent history and with peers.
  • Context turns volume into an alert. A spike matters far more when it comes from a new IP or country, an unmanaged device, a user with a resignation date, or a sensitive site.
  • Latency and retention set your limits. Microsoft says core audit records typically arrive 60 to 90 minutes after the event, and Audit (Standard) keeps them for 180 days, so plan for near-real-time rather than real-time, and export what you need to keep.
  • Prevention reduces the noise you must chase. Limited web-only access for unmanaged devices and download-blocking session policies stop many bulk pulls before they need an alert.

The audit events that matter

Every detection here starts from the Microsoft Purview unified audit log. Microsoft states that audit log search is turned on by default for enterprise organisations; confirm it in Exchange Online PowerShell with Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled (Microsoft notes the value always shows False in Security & Compliance PowerShell, so do not check there). The table lists the operations worth collecting, with Microsoft's description and how to use each one.

OperationWhat Microsoft says it recordsDetection use
FileDownloadedUser downloads a document from a sitePrimary volume signal for browser, app and API downloads
FileSyncDownloadedFullUser downloaded a file to their computer from a SharePoint document library or OneDrive using the OneDrive sync app (OneDrive.exe)Bulk theft by syncing a library; often thousands of rows per session
FileSyncDownloadedPartialDeprecated with the old sync app (Groove.exe)Ignore in new rules; keep only for old historical searches
FileAccessedUser or system account accesses a file; not logged again for the same user and file for five minutesSupporting context, not a volume measure (de-duplication skews counts)
FilePreviewedUser previews files; typically high volume from one action such as an image galleryExclude from volume counts to avoid false positives
FileCopiedUser copies a document from a siteStaging inside the tenant before a download or share
UnmanagedSyncClientBlockedSync attempt from a computer outside the allowed domains was blockedEarly sign that someone tried to sync to a personal machine
AnonymousLinkCreated, AnonymousLinkUsedAn "Anyone" link was created, or an anonymous user accessed a resource with one (the IP is recorded)Downloads that leave through sharing rather than a signed-in user
SharingSet, CompanyLinkUsedSharing with a directory user or guest, and use of a company-wide linkPrecursor to bulk access by a second account

In Microsoft Sentinel these records land in the OfficeActivity table, with Operation, OfficeWorkload, UserId, ClientIP, UserAgent, Site_Url, SourceFileName, SourceFileExtension, SourceRelativeUrl and UserType. In Defender XDR advanced hunting the equivalent is CloudAppEvents, which adds IsAnonymousProxy and CountryCode and is populated only when the Microsoft 365 app connector is enabled in Defender for Cloud Apps. One caveat from the Management Activity API schema: for some services ClientIP can be the address of a trusted application such as Office on the web acting for the user, not the user's device, so treat IP-based context as a hint rather than proof.

Building the baseline

Fixed thresholds such as "more than 500 files in an hour" either flood the queue or miss the quiet thief. Build the rule in layers instead.

  1. Normalise the events: union FileDownloaded and FileSyncDownloadedFull into one count per user per hour, keeping site, device hints (user agent) and IP. Drop FilePreviewed and FileAccessed from the count.
  2. Per-user history: calculate each user's 30-day daily and hourly percentile (the 95th is a reasonable starting point) and alert when today's count exceeds both a floor (for example 200 files) and a multiple of that percentile (for example five times). Both values are samples to tune.
  3. Breadth, not just volume: count distinct sites and distinct folders (SourceRelativeUrl). A user who normally touches two sites and suddenly pulls from 25 is more interesting than one who pulls many files from their own team site.
  4. Peer group: compare against users with the same department or manager from Entra ID. New starters have no history, so use the peer baseline for their first 30 days.
  5. Sensitivity weighting: raise the score for sites tagged as sensitive (finance, HR, legal, source code, M&A) or files with high-impact sensitivity labels. See the Microsoft Purview Information Protection Guide for labelling.

Here is a sample Sentinel rule outline in KQL. It is a starting point to adapt, not a tested production rule, and the numbers are placeholders.

1 Sample only, based on the public documentation cited. Assess it independently against the current official documentation, test outside production and back up first.

Sample 1
// Sample only: tune floor and multiplier to your tenant
let lookback = 30d;
let floor = 200;
let multiplier = 5;
let dl = OfficeActivity
  | where OfficeWorkload in ("SharePoint", "OneDrive")
  | where Operation in ("FileDownloaded", "FileSyncDownloadedFull");
let baseline = dl
  | where TimeGenerated between (ago(lookback) .. ago(1d))
  | summarize daily = count() by UserId, bin(TimeGenerated, 1d)
  | summarize p95 = percentile(daily, 95) by UserId;
dl
| where TimeGenerated > ago(1d)
| summarize files = count(), sites = dcount(Site_Url),
            ips = make_set(ClientIP, 10), agents = make_set(UserAgent, 5)
            by UserId
| join kind=leftouter baseline on UserId
| where files > floor and files > multiplier * coalesce(p95, 0.0)
| order by files desc

For hourly bursts, repeat the same logic with one-hour bins. Because audit records typically arrive 60 to 90 minutes late, schedule the rule with a lookback that overlaps the delay, for example running every hour over the last three hours, and de-duplicate alerts by user.

Scenario one: departing employees

The highest-value tuning is to know who is leaving. Microsoft describes leaver data theft as including "downloading files from SharePoint Online, printing files, and copying data to personal cloud messaging and storage services" near resignation and end dates.

  • Feed the leaver list: import resignation and termination dates from HR into a Sentinel watchlist, or use the Microsoft 365 HR connector. Lower the floor and multiplier for users on the list from the notice date, and look back at least 30 days before the notice, because theft often starts before resignation.
  • Use the built-in template where licensed: the Purview Insider Risk Management "Data theft by departing users" template is triggered by a resignation or termination date from the HR connector or by Microsoft Entra account deletion. The "Data leaks" template scores SharePoint downloads, sharing and printing, triggered by High severity DLP alerts or custom indicators.
  • Watch sync to new machines: a first-ever FileSyncDownloadedFull from a new device name or user agent during the notice period is a strong signal. UnmanagedSyncClientBlocked shows an attempt that the sync restriction stopped.
  • Check sharing to self: SharingSet or AnonymousLinkCreated on many files shortly before the end date can be a route around download controls.

Handle these alerts through HR and legal, not only the SOC. The Departing Employee Data Protection Playbook covers the response, and the Employee Monitoring and Privacy Guide covers the transparency and proportionality questions that monitoring leavers raises.

Scenario two: stolen sessions and token replay

An attacker who steals a session cookie or token (for example through adversary-in-the-middle phishing or an infostealer) signs in as the user and often pulls data quickly. Volume alone may not stand out for a heavy user, so key on what changed.

  • New network context: downloads from an IP, ASN or country not seen for that user in 30 days, or from a known anonymous proxy (IsAnonymousProxy in CloudAppEvents).
  • New client: a user agent never seen for the user, such as a scripting library or command-line client instead of a browser or OneDrive.exe.
  • Concurrent locations: downloads from two distant locations in an overlapping window while the user's normal device is still active.
  • Join with sign-in risk: correlate the download burst with Entra ID risky sign-ins or AiTM indicators in the same hour. See How to detect adversary-in-the-middle phishing and session token replay in Entra ID.

Defender for Cloud Apps includes anomaly detections that cover parts of this, including "Unusual multiple file download activities" and "Suspicious OAuth app file download activities", which flags apps that download many files from SharePoint or OneDrive in a way unusual for the user. Microsoft notes a seven-day initial learning period during which not all anomaly alerts are raised, and that several older policies were disabled in June 2025 and moved to a dynamic detection model, so check which policies are active in your tenant rather than assuming.

Choosing your detection stack

OptionStrengthTrade-offBest fit
Custom rules in Microsoft Sentinel on OfficeActivityFull control of baselines, watchlists and joins with HR and sign-in dataYou own tuning and maintenanceOrganisations with a detection engineering team
Defender XDR advanced hunting on CloudAppEventsProxy and country enrichment, links to incidents across DefenderNeeds Defender for Cloud Apps and the Microsoft 365 connectorTenants already on Defender XDR
Defender for Cloud Apps anomaly policiesBuilt-in behaviour models, little setupLess transparent logic; learning periodSmall teams wanting coverage quickly
Purview Insider Risk ManagementLeaver and data leak templates, pseudonymised case handlingLicensing, HR connector setup, case workflow outside the SOCOrganisations with an insider risk programme
Third-party SIEM via Management Activity APIOne place for all SaaS logsCollection lag on top of audit latencyMulti-cloud estates with an existing SIEM

Small organisations: start with the built-in anomaly policies plus one simple daily query for the top downloaders, and review the list weekly. Large organisations: run custom baselined rules with HR watchlists, keep the built-in policies as a second opinion, and route leaver cases to insider risk.

Prevention that reduces the alert load

  • Limit unmanaged devices: Set-SPOTenant -ConditionalAccessPolicy AllowLimitedAccess gives browser-only access with no download, print or sync on unmanaged devices; Set-SPOSite applies it to sensitive sites only, and the site setting must be at least as strict as the tenant setting.
  • Block downloads in session: a Defender for Cloud Apps session policy with "Control file download (with inspection)" and the Block action replaces restricted downloads with a text file. Start with the Audit action to see impact. It needs Defender for Cloud Apps, Entra ID P1 and a Conditional Access policy using Conditional Access App Control.
  • Restrict sync: allow OneDrive sync only from domain-joined computers, which is what produces the ManagedSyncClientAllowed and UnmanagedSyncClientBlocked events.
  • Bind tokens to devices: Conditional Access token protection accepts only device-bound sign-in session tokens; Microsoft lists SharePoint Online native apps as supported and recommends report-only mode and a pilot group first.
  • Fix oversharing: broad "Everyone except external users" permissions make bulk access easy. See the SharePoint and OneDrive Security Guide.

Where identity fits

Not every bulk download is a person. Backup tools, migration tools, search connectors and AI assistants read SharePoint at scale through app registrations, and their activity can swamp user baselines or hide a misused app. Keep a list of approved service principals and exclude them from user rules, then watch them with their own rules: a backup app downloading from a site it has never touched, or at an unusual hour, deserves an alert. Narrowing what each app can reach makes that easier; see How to find tenant-wide SharePoint app-only access and move apps to Sites.Selected.

Rollout and testing

  1. Confirm logging: check unified audit ingestion is on and the Sentinel Microsoft 365 connector or Defender for Cloud Apps connector is collecting SharePoint and OneDrive records.
  2. Profile two weeks: run the baseline query without alerting and look at the top 50 users. Expect backup accounts, migration projects and heavy sync users; build exclusions with an owner and an expiry date.
  3. Test with a controlled event: with change approval, have a test account sync a library of dummy files from a new device and confirm the rule fires within your expected delay.
  4. Enable in stages: start with the leaver rule (high value, small population), then the token replay rule, then the general volume rule.
  5. Write the triage steps: who checks with the user's manager, when to revoke sessions, and when to involve HR or legal. Link to the Insider Data Theft Response Playbook.
  6. Roll back cleanly: if a rule floods the queue, switch it to a hunting query rather than deleting it, raise the floor, and review again after a week.

Detection and measurement

  • Coverage: percentage of licensed users whose SharePoint and OneDrive downloads reach the SIEM; target close to 100 percent.
  • Leaver coverage: share of leavers present on the watchlist before their last day.
  • Alert precision: share of mass download alerts that lead to a confirmed issue or a recorded business reason; review rules that fall below your agreed level.
  • Time to triage: median time from alert to first analyst action, measured from the event time so audit latency is visible.
  • Exclusion hygiene: number of exclusions past their expiry date; target zero.

Framework mapping

FrameworkReferenceHow this guide applies it
MITRE ATT&CKT1213.002 Sharepoint; T1530 Data from Cloud StorageBulk collection from SharePoint and OneDrive
MITRE ATT&CKT1539 Steal Web Session Cookie; T1550.001 Application Access TokenToken theft and replay before the download burst
MITRE ATT&CKT1567.002 Exfiltration to Cloud StorageOnward copying to personal storage
NIST CSF 2.0DE.CM-03; DE.AE-02Monitoring personnel activity and analysing adverse events
NIST SP 800-53 Rev 5AU-6, AU-12, SI-4, AC-4Audit generation and review, system monitoring, information flow control
CIS Controls v8.13.13 Deploy a Data Loss Prevention Solution; 8.11 Conduct Audit Log ReviewsDownload controls and routine review
ISO/IEC 27001:2022A.8.12 Data leakage prevention; A.8.15 Logging; A.8.16 Monitoring activitiesPreventing and detecting data leaving the tenant

Common failure patterns

  • Counting only FileDownloaded: sync-based theft through OneDrive.exe appears as FileSyncDownloadedFull and is missed entirely.
  • Counting previews and accesses: FilePreviewed bursts from galleries and FileAccessed de-duplication make baselines noisy and unreliable.
  • Short retention: the theft is found weeks later in an HR dispute and the records needed are past their retention, or were never exported to the SIEM.
  • No HR feed: the SOC learns a user resigned only after they have left, so the most useful context arrives too late.
  • Blanket exclusions: backup and migration accounts excluded forever become the perfect cover for a misused app.
  • Treating ClientIP as the device: some records carry a Microsoft service address, so location rules built on raw IP raise false alerts or miss real ones.

Practitioner checklist

  • Confirm UnifiedAuditLogIngestionEnabled is True and SharePoint and OneDrive records reach your SIEM.
  • Count FileDownloaded and FileSyncDownloadedFull together; exclude FilePreviewed and FileAccessed from volume.
  • Build per-user and peer baselines with a floor and a multiplier, plus distinct-site breadth.
  • Load HR leaver dates into a watchlist and apply tighter thresholds from the notice date.
  • Correlate download bursts with new IPs, user agents, proxies and Entra risky sign-ins.
  • Review which Defender for Cloud Apps anomaly policies are active after the June 2025 changes.
  • Apply limited web-only access or download-blocking session policies to sensitive sites.
  • Keep app exclusions on an owned list with expiry dates and give apps their own rules.
  • Set audit retention or SIEM retention long enough for HR and legal timelines.

Standards and references

Related NHI Mgmt Group resources: SaaS Threat Detection Guide · Insider Data Theft Guide · Microsoft Graph Exfiltration Detection · Employee Offboarding Security Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.