Detection rules › Splunk

O365 OAuth App Mailbox Access via Graph API

Status
production
Severity
medium
Group by
AppId, ClientAppId, OperationCount, aws::recipientAccountId, dest, signature, user, vendor_product
Author
Mauricio Velazco, Splunk
Source
github.com/splunk/security_content

The following analytic detects when emails are accessed in Office 365 Exchange via the Microsoft Graph API using the client ID '00000003-0000-0000-c000-000000000000'. It leverages the 'MailItemsAccessed' operation within the Exchange workload, focusing on OAuth-authenticated applications. This activity is significant as unauthorized access to emails can lead to data breaches and information theft. If confirmed malicious, attackers could exfiltrate sensitive information, compromise user accounts, and further infiltrate the organization's network.

Known false positives

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

MITRE ATT&CK coverage

Telemetry coverage

PlatformRecord / event type
Microsoft 365MailItemsAccessed

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: O365 OAuth App Mailbox Access via Graph API
id: 9db0d5b0-4058-4cb7-baaf-77d8143539a2
version: 11
creation_date: '2024-02-14'
modification_date: '2026-05-13'
author: Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic detects when emails are accessed in Office 365 Exchange via the Microsoft Graph API using the client ID '00000003-0000-0000-c000-000000000000'. It leverages the 'MailItemsAccessed' operation within the Exchange workload, focusing on OAuth-authenticated applications. This activity is significant as unauthorized access to emails can lead to data breaches and information theft. If confirmed malicious, attackers could exfiltrate sensitive information, compromise user accounts, and further infiltrate the organization's network.
data_source:
    - O365 MailItemsAccessed
search: |-
    `o365_management_activity` Workload=Exchange Operation=MailItemsAccessed AppId=* AppId=00000003-0000-0000-c000-000000000000
      | fillnull
      | stats count earliest(_time) as firstTime latest(_time) as lastTime values(ClientIPAddress) as src
        BY user ClientAppId OperationCount
           AppId vendor_account vendor_product
           dest signature
      | `security_content_ctime(firstTime)`
      | `security_content_ctime(lastTime)`
      | `o365_oauth_app_mailbox_access_via_graph_api_filter`
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 ClientAppId to add trusted applications to an allow list.
references:
    - https://attack.mitre.org/techniques/T1114/002/
    - https://learn.microsoft.com/en-us/troubleshoot/azure/active-directory/verify-first-party-apps-sign-in
    - https://learn.microsoft.com/en-us/graph/permissions-reference
finding:
    title: An OAuth application identified with id $ClientAppId$ accesed mailboxes through the Graph API.
    entity:
        field: user
        type: user
        score: 50
analytic_story:
    - Office 365 Collection Techniques
    - NOBELIUM Group
asset_type: O365 Tenant
mitre_attack_id:
    - T1114.002
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: threat

Stages and Predicates

Stage 1: search

`o365_management_activity` Workload=Exchange Operation=MailItemsAccessed AppId=* AppId=00000003-0000-0000-c000-000000000000

Stage 2: fillnull

| fillnull

Stage 3: stats

| stats count earliest(_time) as firstTime latest(_time) as lastTime values(ClientIPAddress) as src
    BY user ClientAppId OperationCount
       AppId vendor_account vendor_product
       dest signature

Stage 4: search

| `security_content_ctime(firstTime)`

Stage 5: search

| `security_content_ctime(lastTime)`

Stage 6: search

| `o365_oauth_app_mailbox_access_via_graph_api_filter`

Indicators

These rows show field, operator, and value matches.