How the attack works
Mail for Exchange Online mailboxes is filtered by threat policies: anti-malware, anti-spam and anti-phishing for all cloud mailboxes, and Safe Links and Safe Attachments in Microsoft Defender for Office 365. In PowerShell a custom policy is two objects, a policy that holds the settings and a rule that holds the recipients, the priority and the enabled state. Disable-SafeLinksRule, Disable-SafeAttachmentRule, Disable-AntiPhishRule, Disable-MalwareFilterRule and Disable-HostedContentFilterRule turn a policy off, and the matching Remove- cmdlets delete the rule or the policy. Disable-EOPProtectionPolicyRule and Disable-ATPProtectionPolicyRule turn off the Standard or Strict preset security policy.
Recipients of a disabled or removed policy are not left without filtering. They fall to the next policy in Microsoft's order of precedence, and in the end to the default policies and to Built-in protection. That is usually weaker than what the organization configured on purpose, for example for executives or for finance, and this gap is what an attacker wants before sending phishing links or malicious attachments. The cmdlets are Exchange admin operations and are written to the Microsoft 365 unified audit log with the cmdlet in Operation, the policy or rule in ObjectId and the parameters in Parameters.
What an attacker needs
- An account that can manage threat policies. Microsoft lists membership in the Organization Management or Security Administrator role groups, or the Microsoft Entra roles Global Administrator and Security Administrator.
Impact
The affected recipients lose the protection settings that were chosen for them and are filtered by the next policy that applies, in the end by the default policies and Built-in protection. Phishing links and malicious attachments that the disabled policy would have blocked or quarantined can reach their mailboxes. When the Standard or Strict preset security policy is turned off, this applies to everyone the preset was assigned to.
Detection rules
Standard or Strict Preset Security Policy Turned Off
Detects the Exchange Online cmdlets that turn off the Standard or Strict preset security policy by disabling its rules (Disable-EOPProtectionPolicyRule for the protections of all cloud mailboxes, Disable-ATPProtectionPolicyRule for the Defender for Office 365 protections), and the cmdlets that remove those rules. The recipients of the preset then fall to custom policies, default policies and Built-in protection. The rule matches the cmdlet name only, so read ObjectId for the preset that was changed. Requires Microsoft 365 audit logging and the Exchange records of the unified audit log in the SIEM.
title: Standard or Strict Preset Security Policy Turned Off
id: 611527bd-1edc-4a7c-b353-d7dfbb52101b
status: experimental
description: >-
Detects the Exchange Online cmdlets that turn off the Standard or Strict
preset security policy by disabling its rules
(Disable-EOPProtectionPolicyRule for the protections of all cloud mailboxes,
Disable-ATPProtectionPolicyRule for the Defender for Office 365
protections), and the cmdlets that remove those rules. The recipients of the
preset then fall to custom policies, default policies and Built-in
protection. The rule matches the cmdlet name only, so read ObjectId for the
preset that was changed. Requires Microsoft 365 audit logging and the
Exchange records of the unified audit log in the SIEM.
references:
- https://attack.mitre.org/techniques/T1685/
- https://learn.microsoft.com/en-us/defender-office-365/preset-security-policies
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-eopprotectionpolicyrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-atpprotectionpolicyrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/remove-eopprotectionpolicyrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/remove-atpprotectionpolicyrule
author: Forestall
date: 2026-11-16
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: m365
service: exchange
detection:
selection:
Operation:
- Disable-EOPProtectionPolicyRule
- Disable-ATPProtectionPolicyRule
- Remove-EOPProtectionPolicyRule
- Remove-ATPProtectionPolicyRule
condition: selection
falsepositives:
- A planned move from preset security policies to custom policies. Match the event to a change request and check which policy now applies to the recipients.
level: medium
False positives
- A planned move from preset security policies to custom policies. Match the event to a change request and check which policy now applies to the recipients.
Email Threat Policy or Rule Disabled or Removed
Detects the Exchange Online cmdlets that disable the rule of a custom anti-phishing, Safe Links, Safe Attachments, anti-malware or anti-spam policy, or that remove such a rule or policy. Disabling the rule turns the whole policy off for its recipients. The rule matches the cmdlet name only, so read ObjectId and Parameters for the policy that was changed. Microsoft notes that some Exchange Online cmdlets are not written to the audit log, so confirm on a test change that these arrive in your tenant, in particular for changes made in the Microsoft Defender portal. Requires Microsoft 365 audit logging and the Exchange records of the unified audit log in the SIEM.
title: Email Threat Policy or Rule Disabled or Removed
id: 60ba61b1-99a5-41ff-af07-18debd27bb70
status: experimental
description: >-
Detects the Exchange Online cmdlets that disable the rule of a custom
anti-phishing, Safe Links, Safe Attachments, anti-malware or anti-spam
policy, or that remove such a rule or policy. Disabling the rule turns the
whole policy off for its recipients. The rule matches the cmdlet name only,
so read ObjectId and Parameters for the policy that was changed. Microsoft
notes that some Exchange Online cmdlets are not written to the audit log, so
confirm on a test change that these arrive in your tenant, in particular
for changes made in the Microsoft Defender portal. Requires Microsoft 365
audit logging and the Exchange records of the unified audit log in the SIEM.
references:
- https://attack.mitre.org/techniques/T1685/
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-antiphishrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-safelinksrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-safeattachmentrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-malwarefilterrule
- https://learn.microsoft.com/en-us/powershell/module/exchangepowershell/disable-hostedcontentfilterrule
- https://learn.microsoft.com/en-us/defender-office-365/safe-links-policies-configure
- https://learn.microsoft.com/en-us/purview/audit-log-activities#exchange-admin-activities
author: Forestall
date: 2026-11-16
tags:
- attack.defense-impairment
- attack.t1685
logsource:
product: m365
service: exchange
detection:
selection:
Operation:
- Disable-AntiPhishRule
- Remove-AntiPhishRule
- Remove-AntiPhishPolicy
- Disable-SafeLinksRule
- Remove-SafeLinksRule
- Remove-SafeLinksPolicy
- Disable-SafeAttachmentRule
- Remove-SafeAttachmentRule
- Remove-SafeAttachmentPolicy
- Disable-MalwareFilterRule
- Remove-MalwareFilterRule
- Remove-MalwareFilterPolicy
- Disable-HostedContentFilterRule
- Remove-HostedContentFilterRule
- Remove-HostedContentFilterPolicy
condition: selection
falsepositives:
- Administrators who replace custom policies with preset security policies, or who clean up test and duplicate policies. Match each event to a change request and check that the recipients are covered by another policy.
level: medium
False positives
- Administrators who replace custom policies with preset security policies, or who clean up test and duplicate policies. Match each event to a change request and check that the recipients are covered by another policy.
Triage
- Read
Operationfor the cmdlet,ObjectIdandParametersfor the policy or rule, andUserIdfor the account that ran it. Match the change to a request. - Find out which recipients the policy covered and whether another policy with comparable settings now applies to them. A policy for executives, finance or all users that was disabled without a replacement is the pattern to look for.
- Look at the mail delivered to those recipients after the change, in particular messages with links or attachments from senders that are new to the organization.
- Check the sign-ins of the admin account before the change, and whether it also changed mail flow rules, connectors, audit settings or other threat policies.
Response
Once the attack is confirmed:
- Turn the policy back on, or create the removed policy and its rule again from the documented baseline. Microsoft says to allow up to 6 hours for a new or updated Safe Links policy to be applied, so count that time as part of the exposure.
- Contain the admin account that made the change. Revoke its sessions, reset its credentials and remove it from the role groups that manage threat policies.
- Search the mailboxes of the affected recipients for messages delivered during the gap, remove the malicious ones, and find out who followed a link or opened an attachment. Treat those users as possibly compromised.
- Review every other threat policy and rule in the same pass, including settings that were weakened and not removed, because the rules on this page do not match the
Set-cmdlets. - Check the other mail settings that the same roles can change, such as mail flow rules, connectors and allow lists, for changes made by the same account.
Mitigation
- Keep the role groups and Microsoft Entra roles that manage threat policies small, and assign them through just-in-time elevation.
- Prefer the Standard and Strict preset security policies over custom policies. Microsoft recommends them, and they are always applied before custom policies.
- Review the state of threat policies and their rules on a schedule and compare it with a documented baseline, including rules that are disabled and policies that have no rule.
- Send the unified audit log to your SIEM, so the record of the change is kept outside the tenant and reaches an analyst.
Frequently asked questions
Are the recipients completely unprotected after a policy is disabled?
No. Microsoft applies threat policies in an order of precedence, namely the Strict and Standard preset security policies, then custom policies by priority, then Built-in protection for Safe Links and Safe Attachments and the default policies for anti-malware, anti-spam and anti-phishing. Recipients of a disabled or removed policy fall to the next one that applies to them, which is usually weaker than the policy that was configured for them on purpose.
Do the rules catch a policy that was weakened but not disabled?
No. The rules match the Disable and Remove cmdlets. Changing the settings of a policy, narrowing the recipients of its rule or adding exceptions to Built-in protection is done with Set cmdlets, such as `Set-SafeLinksPolicy` or `Set-ATPBuiltInProtectionRule`, and those are not matched. Review the settings of the remaining policies whenever one of the rules fires.
Why does the detection list cmdlets for both policies and rules?
In PowerShell a threat policy is two objects. The policy holds the settings, and the rule holds the recipients, the priority and the enabled state. Microsoft documents for Safe Links that disabling the rule turns off the whole policy, and that removing one of the two objects in PowerShell does not remove the other. The detection therefore lists the Disable cmdlets for rules and the Remove cmdlets for both rules and policies.
References
- Microsoft Learn: Preset security policies
- Microsoft Learn: Order and precedence of email protection
- Microsoft Learn: Set up Safe Links policies in Microsoft Defender for Office 365
- Microsoft Learn: Disable-SafeLinksRule
- Microsoft Learn: Disable-EOPProtectionPolicyRule
- Microsoft Learn: Audit log activities, Exchange admin activities
- MITRE ATT&CK T1685: Disable or Modify Tools