Agent Foskett Academy • KQL Academy • Module 13 • Lesson 151 • Cloud & SaaS Investigation

Lesson 151 — The User Downloaded 4 GB of Data Before Resigning

Module 12 ended with an attacker moving from an endpoint toward another device. Module 13 changes the investigation completely.

There is no obvious malware alert. No encoded PowerShell command. No suspicious process tree. Instead, a user resigns — and shortly beforehand their Microsoft 365 activity shows an unusually large volume of SharePoint and OneDrive downloads. In this lesson we use KQL to determine what happened, whether the activity was genuinely unusual and what the evidence can defend.

Four gigabytes sounds suspicious. But volume alone is not a verdict. First establish what was downloaded, when, from where and whether the behaviour was abnormal for that user.
Agent Foskett KQL Academy SharePoint OneDrive data download investigation
Your case file

HR advises that alex.wilson@contoso.com resigned at 4:30 PM. Security then notices a sharp increase in SharePoint and OneDrive download activity during the preceding hours.

✓ Reconstruct the user's downloads
✓ Quantify the activity
✓ Compare it with historical behaviour
✓ Build the resignation timeline

Case briefing

CASE FILE User: alex.wilson@contoso.com 08:12 — normal Microsoft 365 activity begins ↓ 11:47 — download activity increases sharply ↓ 14:05 — hundreds of files accessed and downloaded ↓ 16:18 — final burst of SharePoint activity ↓ 16:30 — resignation submitted ↓ INITIAL ESTIMATE Approximately 4 GB of organisational data downloaded THE QUESTION Was this legitimate work before departure, or does the evidence support a data-exfiltration concern?

Investigation objective

Use Microsoft 365 audit data in Microsoft Sentinel to reconstruct SharePoint and OneDrive download activity, quantify the user's behaviour, compare it with an historical baseline and determine whether the sequence warrants escalation as a possible insider-risk or data-exfiltration investigation.

Investigator's rule

Unusual is not the same as malicious. A departing employee may legitimately download files for handover, offline work or an approved business process. Establish the behaviour first; intent requires additional evidence.

Stage 1 — reconstruct the user's cloud download activity

Start with the user and the relevant Microsoft 365 workloads. Preserve timestamps, operations, file names, sites, client IP and user-agent context.

01-reconstruct-cloud-download-activity.kql
12345678910111213141516
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated > ago(7d)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| project TimeGenerated,
          UserId,
          OfficeWorkload,
          Operation,
          Site_Url,
          SourceFileName,
          SourceRelativeUrl,
          ClientIP,
          UserAgent
| order by TimeGenerated asc

Why start with OfficeActivity?

When Microsoft 365 audit data is connected to Sentinel, OfficeActivity can provide a useful investigation view of SharePoint and OneDrive operations. The exact fields available can vary with the workload and event type.

Preserve the operation

FileDownloaded and sync-related operations can represent different user behaviours. Do not collapse them into one story before checking what each event means in your environment.

Stage 2 — quantify the download volume

The initial report says “about 4 GB.” Test that claim against the telemetry. Where your audit records expose a usable file-size field, convert it safely and calculate the total.

02-quantify-download-volume.kql
1234567891011121314
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated > ago(7d)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| extend DownloadBytes = tolong(column_ifexists("FileSize", 0))
| summarize FilesDownloaded=count(),
            TotalBytes=sum(DownloadBytes),
            Sites=dcount(Site_Url),
            FirstDownload=min(TimeGenerated),
            LastDownload=max(TimeGenerated)
          by UserId
| extend TotalGB = round(TotalBytes / 1024.0 / 1024.0 / 1024.0, 2)

Schema matters

Microsoft 365 audit records are not identical across every operation. This query uses column_ifexists() defensively because a file-size field may not be populated in every event. Validate the schema in your tenant before treating the byte total as complete.

Count files as well as bytes

Volume tells one part of the story. File count, number of sites, duration and concentration of activity can reveal whether the behaviour was a small number of large files or a broad collection of organisational data.

Stage 3 — establish the user's normal download baseline

Now step away from the incident day. Look at the preceding 30-day period and calculate the user's normal daily download count.

03-establish-download-baseline.kql
1234567891011
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated between (ago(37d) .. ago(7d))
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| summarize DailyDownloads=count() by bin(TimeGenerated, 1d)
| summarize BaselineDays=count(),
            AverageDailyDownloads=round(avg(DailyDownloads), 1),
            MaximumDailyDownloads=max(DailyDownloads),
            MinimumDailyDownloads=min(DailyDownloads)

Why exclude the incident week?

A baseline should not be contaminated by the activity you are trying to evaluate. Here we deliberately use an earlier historical window to provide cleaner behavioural context.

Baseline is context, not guilt

If the user normally downloads 20 files per day and suddenly downloads 900, the deviation is important. It still does not tell us why the user did it.

Stage 4 — investigate where the downloads came from

Group the activity by client IP, user agent and SharePoint site. This helps determine whether the downloads came from familiar access patterns or a new source.

04-investigate-download-source.kql
123456789101112
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated > ago(7d)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| summarize Downloads=count(),
            FirstSeen=min(TimeGenerated),
            LastSeen=max(TimeGenerated),
            Files=make_set(SourceFileName, 50)
          by ClientIP, UserAgent, Site_Url
| order by Downloads desc

Known source can still matter

A corporate IP or familiar browser does not make bulk downloading harmless. Insider activity often uses legitimate credentials from legitimate devices.

New source changes the investigation

An unfamiliar IP, user agent or access method can increase concern and may justify correlation with Entra sign-in telemetry, device evidence and Conditional Access results.

Stage 5 — build the resignation-day timeline

Finally, place file access, downloads and sharing-related operations around the known resignation time. Chronology helps distinguish ordinary working activity from a concentrated departure sequence.

05-build-resignation-day-timeline.kql
1234567891011121314151617
let TargetUser = "alex.wilson@contoso.com";
let ResignationTime = datetime(2026-08-18 16:30:00);
OfficeActivity
| where TimeGenerated between (ResignationTime - 24h .. ResignationTime + 1h)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileAccessed", "FileDownloaded", "FileSyncDownloadedFull",
                       "SharingSet", "AnonymousLinkCreated")
| project TimeGenerated,
          Operation,
          OfficeWorkload,
          Site_Url,
          SourceFileName,
          SourceRelativeUrl,
          ClientIP,
          UserAgent
| order by TimeGenerated asc

Look beyond downloads

File access followed by downloads, external sharing or anonymous-link creation can materially change the risk assessment. Follow the evidence into the operations that surround the bulk activity.

HR context is not telemetry

The resignation time is business context supplied to the investigation. Keep it distinct from the Microsoft 365 events so the final report clearly separates organisational facts from technical evidence.

Agent Foskett's cloud activity timeline

08:12 Normal Microsoft 365 activity ↓ 11:47 Download rate begins increasing ↓ SHAREPOINT + ONEDRIVE Large number of files accessed ↓ DOWNLOAD VOLUME Approximately 4 GB reported ↓ BASELINE Activity materially exceeds recent behaviour ↓ SOURCE REVIEW IP + user agent + sites investigated ↓ 16:18 Final burst of download activity ↓ 16:30 Resignation submitted ↓ ASSESSMENT Unusual pre-departure data collection requires escalation and further validation
The resignation made the downloads interesting. The baseline, timing and scope made them an investigation.

Your evidence board

EvidenceWhat it supportsWeight
Large volume of SharePoint and OneDrive downloadsEstablishes unusual data collection when validated against the audit schema.Strong behavioural evidence
Activity materially exceeds the user's historical baselineSupports the conclusion that the behaviour was abnormal for this user.Strong context
Downloads concentrated shortly before resignationCreates a significant temporal relationship with the departure event.Strong context
Unfamiliar IP or user agentMay suggest a different access source and warrants identity correlation.Strong when validated
Known corporate device or IPShows the source may be legitimate infrastructure.Does not remove risk
Resignation plus 4 GB aloneDoes not prove theft, malicious intent or unauthorised disclosure.Insufficient alone

Write the finding like an investigator

Example: Microsoft 365 audit telemetry recorded a substantial increase in SharePoint and OneDrive download activity by alex.wilson@contoso.com during the period immediately preceding the user's resignation. The activity was reviewed by timestamp, workload, file operation, site, client IP and user-agent context and compared with an earlier behavioural baseline. The incident-day download pattern materially exceeded the user's recent normal activity and was concentrated within the hours before the recorded resignation time. This supports escalation as unusual pre-departure data collection. The available evidence does not, by itself, establish malicious intent, unauthorised disclosure or successful exfiltration outside the organisation. Further investigation should review the sensitivity of the files, external sharing activity, endpoint evidence, identity telemetry and applicable HR or legal context.

Lesson 151 key takeaways

  • Large download volume should be measured and validated rather than accepted from an initial alert or report.
  • OfficeActivity can support SharePoint and OneDrive investigations when Microsoft 365 audit data is available in Sentinel.
  • Audit schemas can vary by operation, so validate fields before relying on calculated byte totals.
  • Preserve file, site, IP, user-agent and operation context.
  • Historical behaviour helps distinguish routine downloading from a genuine anomaly.
  • A baseline identifies abnormality; it does not establish intent.
  • Known devices and corporate IPs do not automatically make bulk data collection legitimate.
  • Correlate download activity with sharing operations and identity telemetry.
  • Keep HR facts separate from technical telemetry in the final report.
  • Write the conclusion at exactly the strength the evidence supports.

Module 13 has begun

Lesson 151 opens a new investigation path. Instead of following malware across an endpoint, Module 13 follows users, sessions and applications through Microsoft 365 and cloud services. Next, the same account appears to access SharePoint from two different countries.

Next: Lesson 152 — The Same Account Accessed SharePoint From Two Countries.

Continue your KQL investigation training

Module 13 moves beyond the endpoint into advanced Microsoft 365, cloud and SaaS investigations.

Related Agent Foskett Investigations

Continue investigating suspicious user and cloud activity where legitimate credentials and legitimate services can still produce high-risk behaviour.

🔎 KQL Academy — Module 13: Advanced Cloud & SaaS Investigation

Following users, sessions, applications and data through Microsoft 365 and cloud services.
⬅ Previous lesson
Lesson 150 — Building the Complete Endpoint Compromise TimelineComplete the Module 12 endpoint attack chain and final compromise assessment.
✅ Current lesson
Lesson 151 — The User Downloaded 4 GB of Data Before ResigningInvestigate unusually large SharePoint and OneDrive downloads before a user's departure.
Next lesson
Lesson 152 — The Same Account Accessed SharePoint From Two CountriesCorrelate cloud activity and identity context to determine whether geographically separated access represents normal behaviour or session compromise.

Investigate SharePoint and OneDrive downloads with KQL

Lesson 151 of the Agent Foskett KQL Academy uses Microsoft Sentinel and Microsoft 365 audit data to investigate unusually large SharePoint and OneDrive download activity before a user resigns.

Use KQL to investigate possible Microsoft 365 data exfiltration

Learn how to reconstruct file-download activity, quantify cloud data collection, establish a historical baseline, review source context and write a defensible insider-risk investigation finding without assuming malicious intent.