Skip to content

Commit 9de8908

Browse files
authored
Update o365_exfiltration_via_file_access.yml
update search yaml for better readability / remove single quote in SPL issues
1 parent 8cc8402 commit 9de8908

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

detections/cloud/o365_exfiltration_via_file_access.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ type: Anomaly
88
description: The following analytic detects when an excessive number of files are access from o365 by the same user over a short period of time. A malicious actor may abuse the "open in app" functionality of SharePoint through scripted or Graph API based access to evade triggering the FileDownloaded Event. This behavior may indicate an attacker staging data for exfiltration or an insider threat removing organizational data. Additional attention should be take with any Azure Guest (#EXT#) accounts.
99
data_source:
1010
- Office 365 Universal Audit Log
11-
search: '`o365_management_activity` Operation IN ("fileaccessed") UserId!=app@sharepoint NOT SourceFileExtension IN (bmp,png,jpeg,jpg)
12-
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_")
13-
| where NOT match(SiteUrl,user_flat)
14-
| stats values(user) as user, latest(ClientIP) as src values(ZipFileName) as file_name, values(Operation) as signature, values(UserAgent) as http_user_agent, dc(SourceFileName) as count, min(_time) as firstTime, max(_time) as lastTime by Workload,UserId,SiteUrl
15-
| eventstats avg(count) as avg stdev(count) as stdev by Workload
16-
| rename SiteUrl as file_path,Workload as app
17-
| where count > 50 AND count > (avg + (3*(stdev)))
18-
| `security_content_ctime(firstTime)`
19-
| `security_content_ctime(lastTime)`
20-
| `o365_exfiltration_via_file_access_filter`'
11+
search: |-
12+
`o365_management_activity` Operation IN ("fileaccessed") UserId!=app@sharepoint NOT SourceFileExtension IN (bmp,png,jpeg,jpg)
13+
| eval user = replace(mvindex(split(lower(UserId),"#ext#"),0),"_","@"), user_flat = replace(UserId, "[^A-Za-z0-9]","_")
14+
| where NOT match(SiteUrl,user_flat)
15+
| stats values(user) as user, latest(ClientIP) as src values(ZipFileName) as file_name, values(Operation) as signature, values(UserAgent) as http_user_agent, dc(SourceFileName) as count, min(_time) as firstTime, max(_time) as lastTime by Workload,UserId,SiteUrl
16+
| eventstats avg(count) as avg stdev(count) as stdev by Workload
17+
| rename SiteUrl as file_path,Workload as app
18+
| where count > 50 AND count > (avg + (3*(stdev)))
19+
| `security_content_ctime(firstTime)`
20+
| `security_content_ctime(lastTime)`
21+
| `o365_exfiltration_via_file_access_filter`
2122
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
2223
known_false_positives: It is possible that certain file access scenarios may trigger this alert, specifically OneDrive syncing and users accessing personal onedrives of other users. Adjust threshold and filtering as needed.
2324
references:

0 commit comments

Comments
 (0)