LoFP LoFP / legitimate applications may access multiple mailboxes via an api. you can filter by the clientappid or the clientipaddress fields.

Techniques

Sample rules

O365 Multiple Mailboxes Accessed via API

Description

The following analytic detects when a high number of Office 365 Exchange mailboxes are accessed via API (Microsoft Graph API or Exchange Web Services) within a short timeframe. It leverages ‘MailItemsAccessed’ operations in Exchange, using AppId and regex to identify API interactions. This activity is significant as it may indicate unauthorized mass email access, potentially signaling data exfiltration or account compromise. If confirmed malicious, attackers could gain access to sensitive information, leading to data breaches and further exploitation of compromised accounts. The threshold is set to flag over five unique mailboxes accessed within 10 minutes, but should be tailored to your environment.

Detection logic

`o365_management_activity` Workload=Exchange Operation=MailItemsAccessed AppId=* ClientAppId=* 
| bucket span=10m _time 
| eval matchRegex=if(match(ClientInfoString, "^Client=WebServices;ExchangeWebServices"), 1, 0) 
| search (AppId="00000003-0000-0000-c000-000000000000" OR matchRegex=1) 
| stats values(ClientIPAddress) as src_ip dc(user) as unique_mailboxes values(user) as user by _time ClientAppId ClientInfoString 
| where unique_mailboxes > 5 
| `o365_multiple_mailboxes_accessed_via_api_filter`