Agent Foskett Investigation • Data Exfiltration • OneDrive Sync • SharePoint • Microsoft Defender XDR • KQL

The File Was Never Downloaded — It Was Synchronised

The investigators searched for bulk downloads.

Nothing unusual appeared.

No 4GB browser download. No obvious file-transfer spike. No malware alert.

But thousands of company files had still arrived on the user's device.

The files were never downloaded one by one.

OneDrive had synchronised the library.

Agent Foskett investigating OneDrive and SharePoint synchronisation as a possible data exfiltration path
Cloud Data Investigation

The hunt was correct. The assumption was wrong.

Do not hunt only for downloads
Inspect OneDrive and SharePoint sync activity
Correlate cloud activity with endpoint evidence

The download hunt returned almost nothing

The security team asked a reasonable question: did the user download a large amount of company data? The problem was that the data had moved without matching the behaviour they were looking for.
No obvious bulk downloadThe expected browser-based download spike was not present in the first review.
Legitimate Microsoft clientOneDrive was an approved application performing a normal business function.
The files still movedA SharePoint library had been synchronised to the endpoint, placing large numbers of files within local reach.

The clue was the question nobody had asked

Instead of asking only “what was downloaded?”, Agent Foskett asked “how else could the files have reached the device?”
investigation-notes.txt
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
Bulk browser download:
Not found

OneDrive client:
Active

SharePoint library:
Recently synchronised

Start by inspecting the user's cloud activity

CloudAppEvents can expose useful Microsoft 365 activity, but action names and available fields vary by workload and tenant. Begin broadly and inspect the data before building a narrow hunt.
inspect-cloud-activity.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
CloudAppEvents
| where Timestamp > ago(30d)
| where AccountDisplayName == "Alex Morgan"
| project Timestamp,
          Application,
          ActionType,
          ObjectName,
          IPAddress,
          RawEventData

Discover the activity names before filtering

A download-only filter can hide the very behaviour you need. Look at the action types associated with SharePoint and OneDrive, then identify the events that represent file access, synchronisation or related activity in your own tenant.
discover-cloud-actions.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
CloudAppEvents
| where Timestamp > ago(30d)
| where AccountDisplayName == "Alex Morgan"
| summarize Events = count()
    by Application, ActionType
| order by Events desc

Search for sync-related behaviour

After inspecting the available action names, broaden the hunt beyond the word “download”. The following is a discovery query, not a promise that every tenant uses these exact values.
hunt-sync-activity.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
CloudAppEvents
| where Timestamp > ago(30d)
| where AccountDisplayName == "Alex Morgan"
| where Application has_any ("OneDrive", "SharePoint")
| where ActionType has_any ("sync", "file", "access")
| project Timestamp, Application, ActionType,
          ObjectName, IPAddress
| order by Timestamp asc

Now check the endpoint

Cloud evidence tells you what happened in Microsoft 365. Endpoint telemetry can help establish whether the OneDrive client was active and what happened around the same time.
onedrive-process-activity.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
DeviceProcessEvents
| where Timestamp > ago(30d)
| where AccountName =~ "alex.morgan"
| where FileName =~ "OneDrive.exe"
| project Timestamp, DeviceName, AccountName,
          FileName, ProcessCommandLine
| order by Timestamp asc

Correlate the cloud and device timelines

The strongest finding is not simply that OneDrive ran. It is that OneDrive activity, SharePoint access and local file activity occurred together during the period being investigated.
local-file-timeline.kql
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
DeviceFileEvents
| where Timestamp > ago(7d)
| where DeviceName == "LAPTOP-042"
| where FolderPath has "OneDrive"
| summarize FileEvents = count(),
            FirstSeen = min(Timestamp),
            LastSeen = max(Timestamp)
    by FolderPath
| order by FileEvents desc

The important distinction: access method versus outcome

A browser download and a synchronised library use different mechanisms, but the security question is the same: did sensitive company data move somewhere it should not have?
Do not over-trust event namesAn investigation built around one expected action can miss another legitimate feature that produces the same security outcome.
Follow the dataAsk where the files started, where they appeared and what process or cloud activity connects those points.
Preserve contextSync activity can be entirely legitimate. User role, device ownership, timing, data sensitivity and business purpose determine whether it is suspicious.

Agent Foskett's investigation mindset

Do not search only for the action you expect. Search for every plausible path to the outcome.
Do not ask only: Was it downloaded?The absence of a traditional download event does not prove the data remained in the cloud.
Ask: How could it have moved?Consider sync clients, mapped libraries, browser access, archives, removable media and other paths supported by the evidence.
Ask: What happened next?Once files reach an endpoint, continue into local file activity, archive creation, USB use, browser uploads and other available telemetry.

Investigation findings

The first query did not fail. It answered a question that was too narrow.
No bulk browser download was foundThe original hunt accurately showed that the expected download pattern was absent.
Synchronisation changed the pictureOneDrive and SharePoint activity provided another plausible path for large-scale file movement.
Endpoint evidence completed the timelineCloud activity became more meaningful when correlated with OneDrive process activity and local file events.
The file was never downloaded. It was synchronised.
Broaden the hunt, correlate the endpoint and follow the data.
Visit the Agent Foskett Academy

Final thought

Security investigations become fragile when the query is built around one assumed method instead of the outcome you are trying to explain.
The first query was not wrongIt correctly showed that the expected bulk download was not there.
The investigation was too narrowSearching only for downloads ignored another legitimate Microsoft 365 mechanism capable of moving the same data.
Follow outcomes, not assumptionsIf the evidence says the files moved, keep investigating until you understand how.
Develop IT. Protect IT.
GEMXIT PTY LTD | GEMXIT UK LTD
Talk to GEMXIT

The File Was Never Downloaded — It Was Synchronised

This Agent Foskett investigation explores how OneDrive and SharePoint synchronisation can move large numbers of company files without presenting as the traditional bulk browser download an investigator may initially expect.

OneDrive Sync, SharePoint And Microsoft Defender XDR Investigation

The page demonstrates how to inspect CloudAppEvents, discover relevant Microsoft 365 action types, review OneDrive process activity and correlate cloud evidence with DeviceProcessEvents and DeviceFileEvents.

KQL, Data Exfiltration And Cloud Activity Investigation

GEMXIT helps organisations investigate Microsoft 365 data movement, insider-risk indicators, OneDrive and SharePoint activity, endpoint context and Microsoft Defender XDR telemetry using practical KQL and investigation workflows.