Detection rules › Splunk

O365 New Forwarding Mailflow Rule Created

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

The following analytic detects the creation of new mail flow rules in Office 365 that may redirect or copy emails to unauthorized or external addresses. It leverages Office 365 Management Activity logs, specifically querying for the "New-TransportRule" operation and parameters like "BlindCopyTo", "CopyTo", and "RedirectMessageTo". This activity is significant as it can indicate potential data exfiltration or unauthorized access to sensitive information. If confirmed malicious, attackers could intercept or redirect email communications, leading to data breaches or information leakage.

Known false positives

  • Forwarding mail flow rules may be created for legitimate reasons, filter as needed.

MITRE ATT&CK coverage

TacticTechniques
Collection

Telemetry coverage

Rules detecting the same action

These rules filter on the same operation.

Rule body

name: O365 New Forwarding Mailflow Rule Created
id: 289ed0a1-4c78-4a43-9321-44ea2e089c14
version: 9
creation_date: '2024-04-17'
modification_date: '2026-05-13'
author: Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic detects the creation of new mail flow rules in Office 365 that may redirect or copy emails to unauthorized or external addresses. It leverages Office 365 Management Activity logs, specifically querying for the "New-TransportRule" operation and parameters like "BlindCopyTo", "CopyTo", and "RedirectMessageTo". This activity is significant as it can indicate potential data exfiltration or unauthorized access to sensitive information. If confirmed malicious, attackers could intercept or redirect email communications, leading to data breaches or information leakage.
data_source: []
search: "`o365_management_activity` Workload=Exchange Operation=\"New-TransportRule\" | eval match1=mvfind('Parameters{}.Name',\"BlindCopyTo\") | eval match2=mvfind('Parameters{}.Name',\"CopyTo\") | eval match3=mvfind('Parameters{}.Name', \"RedirectMessageTo\") | where match1>= 0 OR match2>= 0 OR match3>=0 | eval ForwardTo=coalesce(BlindCopyTo, CopyTo, RedirectMessageTo) | search ForwardTo!=\"\" | rename UserId as user | fillnull | stats count earliest(_time) as firstTime latest(_time) as lastTime by user, Name, ForwardTo, vendor_account, vendor_product, dest, signature | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `o365_new_forwarding_mailflow_rule_created_filter`"
how_to_implement: You must install the Splunk Microsoft Office 365 Add-on and ingest Office 365 management activity events.
known_false_positives: Forwarding mail flow rules may be created for legitimate reasons, filter as needed.
references:
    - https://attack.mitre.org/techniques/T1114/
    - https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rules
    - https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rule-actions
finding:
    title: A new forwarding mailflow rule was created by $user$
    entity:
        field: user
        type: user
        score: 50
analytic_story:
    - Office 365 Collection Techniques
asset_type: O365 Tenant
mitre_attack_id:
    - T1114
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: cloud
security_domain: audit

Stages and Predicates

Stage 1: search

`o365_management_activity` Workload=Exchange Operation="New-TransportRule"

Stage 2: eval

| eval match1=mvfind('Parameters{}.Name',"BlindCopyTo")

Stage 3: eval

| eval match2=mvfind('Parameters{}.Name',"CopyTo")

Stage 4: eval

| eval match3=mvfind('Parameters{}.Name', "RedirectMessageTo")

Stage 5: where

| where match1>= 0 OR match2>= 0 OR match3>=0

Stage 6: eval

| eval ForwardTo=coalesce(BlindCopyTo, CopyTo, RedirectMessageTo)

Stage 7: search

| search ForwardTo!=""

Stage 8: rename

| rename UserId as user

Stage 9: fillnull

| fillnull

Stage 10: stats

| stats count earliest(_time) as firstTime latest(_time) as lastTime by user, Name, ForwardTo, vendor_account, vendor_product, dest, signature

Stage 11: search

| `security_content_ctime(firstTime)`

Stage 12: search

| `security_content_ctime(lastTime)`

Stage 13: search

| `o365_new_forwarding_mailflow_rule_created_filter`

Indicators

These rows show field, operator, and value matches.