Try in Splunk Security Cloud


The following analytic detects when emails are accessed in Office 365 Exchange via Exchange Web Services (EWS) using OAuth-authenticated applications. It leverages the ClientInfoString field to identify EWS interactions and aggregates metrics such as access counts, timing, and client IP addresses, categorized by user, ClientAppId, OperationCount, and AppId. Monitoring OAuth applications accessing emails through EWS is crucial for identifying potential abuse or unauthorized data access. If confirmed malicious, this activity could lead to unauthorized email access, data exfiltration, or further compromise of sensitive information.

  • Type: TTP
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
  • Datamodel: Web
  • Last Updated: 2024-05-14
  • Author: Mauricio Velazco, Splunk
  • ID: e600cf1a-0bef-4426-b42e-00176d610a4d




ID Technique Tactic
T1114.002 Remote Email Collection Collection
Kill Chain Phase
  • Exploitation
  • DE.CM
  • CIS 10
 `o365_management_activity` Workload=Exchange Operation=MailItemsAccessed AppId=* ClientAppId=* 
| regex ClientInfoString="^Client=WebServices;ExchangeWebServices" 
|  stats count earliest(_time) as firstTime latest(_time) as lastTime values(ClientIPAddress) as src_ip by user ClientAppId OperationCount AppId ClientInfoString 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `o365_oauth_app_mailbox_access_via_ews_filter`


The SPL above uses the following Macros:

:information_source: o365_oauth_app_mailbox_access_via_ews_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Required fields

List of fields required to use this analytic.

  • _time
  • Workload
  • Operation
  • AppId
  • ClientAppId
  • OperationCount

How To Implement

You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.

Known False Positives

OAuth applications may access mailboxes for legitimate purposes, you can use the src_ip to add trusted sources to an allow list.

Associated Analytic Story


Risk Score Impact Confidence Message
42.0 70 60 An OAuth application identified with id $ClientAppId$ accesed mailboxes through the Graph API.

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.


Test Dataset

Replay any dataset to Splunk Enterprise by using our tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 2