Detection: O365 Bypass MFA via Trusted IP

Description

The following analytic identifies instances where new IP addresses are added to the trusted IPs list in Office 365, potentially allowing users from these IPs to bypass Multi-Factor Authentication (MFA) during login. It leverages O365 audit logs, specifically focusing on events related to the modification of trusted IP settings. This activity is significant because adding trusted IPs can weaken the security posture by bypassing MFA, which is a critical security control. If confirmed malicious, this could lead to unauthorized access, compromising sensitive information and systems. Immediate investigation is required to validate the legitimacy of the IP addition.

 1`o365_management_activity` Operation="Set Company Information." ModifiedProperties{}.Name=StrongAuthenticationPolicy 
 2| rex max_match=100 field=ModifiedProperties{}.NewValue "(?<ip_addresses_new_added>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2})" 
 3| rex max_match=100 field=ModifiedProperties{}.OldValue "(?<ip_addresses_old>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2})" 
 4| eval ip_addresses_old=if(isnotnull(ip_addresses_old),ip_addresses_old,"0") 
 5| mvexpand ip_addresses_new_added 
 6| where isnull(mvfind(ip_addresses_old,ip_addresses_new_added)) 
 7|stats count min(_time) as firstTime max(_time) as lastTime values(ip_addresses_old) as ip_addresses_old by user ip_addresses_new_added Operation Workload vendor_account status user_id action 
 8| `security_content_ctime(firstTime)`
 9| `security_content_ctime(lastTime)`
10| `o365_bypass_mfa_via_trusted_ip_filter`

Data Source

Name Platform Sourcetype Source Supported App
O365 Set Company Information. N/A 'o365:management:activity' 'o365' N/A

Macros Used

Name Value
o365_management_activity sourcetype=o365:management:activity
o365_bypass_mfa_via_trusted_ip_filter search *
o365_bypass_mfa_via_trusted_ip_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1562.007 Disable or Modify Cloud Firewall Defense Evasion
T1562 Impair Defenses Defense Evasion
KillChainPhase.EXPLOITAITON
NistCategory.DE_CM
Cis18Value.CIS_10
Magic Hound

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Notable Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Risk Event True
This configuration file applies to all detections of type TTP. These detections will use Risk Based Alerting and generate Notable Events.

Implementation

You must install Splunk Microsoft Office 365 add-on. This search works with o365:management:activity

Known False Positives

Unless it is a special case, it is uncommon to continually update Trusted IPs to MFA configuration.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
User $user_id$ has added new IP addresses $ip_addresses_new_added$ to a list of trusted IPs to bypass MFA 42 70 60
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset o365 o365:management:activity
Integration ✅ Passing Dataset o365 o365:management:activity

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


Source: GitHub | Version: 4