Detection rules › Splunk

O365 Mailbox Read Access Granted to Application

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

The following analytic identifies instances where the Mail.Read Graph API permissions are granted to an application registration within an Office 365 tenant. It leverages O365 audit logs, specifically events related to changes in application permissions within the AzureActiveDirectory workload. This activity is significant because the Mail.Read permission allows applications to access and read all emails within a user's mailbox, which often contain sensitive or confidential information. If confirmed malicious, this could lead to data exfiltration, spear-phishing attacks, or further compromise based on the information gathered from the emails.

Known false positives

  • There are legitimate scenarios in wich an Application registrations requires Mailbox read access. Filter as needed.

MITRE ATT&CK coverage

Telemetry coverage

PlatformRecord / event type
Microsoft 365Update application.

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: O365 Mailbox Read Access Granted to Application
id: 27ab61c5-f08a-438a-b4d3-325e666490b3
version: 10
creation_date: '2023-12-06'
modification_date: '2026-05-13'
author: Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic identifies instances where the Mail.Read Graph API permissions are granted to an application registration within an Office 365 tenant. It leverages O365 audit logs, specifically events related to changes in application permissions within the AzureActiveDirectory workload. This activity is significant because the Mail.Read permission allows applications to access and read all emails within a user's mailbox, which often contain sensitive or confidential information. If confirmed malicious, this could lead to data exfiltration, spear-phishing attacks, or further compromise based on the information gathered from the emails.
data_source:
    - O365 Update application.
search: "`o365_management_activity` Operation=\"Update application.\" | eval json_data=mvindex('ModifiedProperties{}.NewValue',0) | eval json_data=replace(json_data,\"^\\[\\s*\",\"\") | eval json_data=replace(json_data,\"\\s*\\]$\",\"\") | spath input=json_data path=RequiredAppPermissions{}.EntitlementId output=EntitlementIds | eval match_found=mvfind(EntitlementIds, \"810c84a8-4a9e-49e6-bf7d-12d183f40d01\") | where isnotnull(match_found) | fillnull | stats count earliest(_time) as firstTime max(_time) as lastTime values(EntitlementIds) as EntitlementIds by signature, user, dest, vendor_account, vendor_product, object, src | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `o365_mailbox_read_access_granted_to_application_filter`"
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
known_false_positives: There are legitimate scenarios in wich an Application registrations requires Mailbox read access. Filter as needed.
references:
    - https://attack.mitre.org/techniques/T1098/003/
    - https://attack.mitre.org/techniques/T1114/002/
    - https://www.mandiant.com/sites/default/files/2022-08/remediation-hardening-strategies-for-m365-defend-against-apt29-white-paper.pdf
    - https://www.cisa.gov/sites/default/files/publications/Supply_Chain_Compromise_Detecting_APT_Activity_from_known_TTPs.pdf
    - https://learn.microsoft.com/en-us/graph/permissions-reference
    - https://graphpermissions.merill.net/permission/Mail.Read
finding:
    title: Application registration $object$ was grandes mailbox read access by $user$
    entity:
        field: user
        type: user
        score: 50
analytic_story:
    - Office 365 Persistence Mechanisms
asset_type: O365 Tenant
mitre_attack_id:
    - T1098.003
    - T1114.002
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: access

Stages and Predicates

Stage 1: search

`o365_management_activity` Operation="Update application."

Stage 2: eval

| eval json_data=mvindex('ModifiedProperties{}.NewValue',0)

Stage 3: eval

| eval json_data=replace(json_data,"^\[\s*","")

Stage 4: eval

| eval json_data=replace(json_data,"\s*\]$","")

Stage 5: spath

| spath input=json_data path=RequiredAppPermissions{}.EntitlementId output=EntitlementIds

Stage 6: eval

| eval match_found=mvfind(EntitlementIds, "810c84a8-4a9e-49e6-bf7d-12d183f40d01")

Stage 7: where

| where isnotnull(match_found)

Stage 8: fillnull

| fillnull

Stage 9: stats

| stats count earliest(_time) as firstTime max(_time) as lastTime values(EntitlementIds) as EntitlementIds by signature, user, dest, vendor_account, vendor_product, object, src

Stage 10: search

| `security_content_ctime(firstTime)`

Stage 11: search

| `security_content_ctime(lastTime)`

Stage 12: search

| `o365_mailbox_read_access_granted_to_application_filter`

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Operationeq
  • "Update application."
field:"Operation" kind:eq
match_foundis_not_null
  • (no value, null check)
field:"match_found" kind:is_not_null
sourcetypeeq
  • o365:management:activity
field:"sourcetype" kind:eq value:"o365:management:activity"