Description
Zero-hour auto purge (ZAP) is on in every policy that applies to users:
- anti-malware policies:
ZapEnabled $true; - anti-spam policies:
PhishZapEnabled $trueandSpamZapEnabled $true, with spam and phishing actions that ZAP can carry out (Move message to Junk Email folder or Quarantine message, not Add X-header, Prepend subject line or Redirect); - with Defender for Office 365, the Microsoft Teams protection policy:
ZapEnabled $true.
Rationale
Many campaigns are only recognized minutes or hours after the first messages are delivered, for example when a link turns malicious after delivery. ZAP pulls those messages out of mailboxes retroactively. It is on by default, which makes a disabled ZAP a sign of an old troubleshooting change that was never reverted.
Impact
None known. A message moved by mistake can be released from quarantine or Junk Email.
Audit
- Sign in to the Microsoft Defender portal (https://security.microsoft.com) as at least a Security Reader.
- Browse to Email & collaboration > Policies & rules > Threat policies. In Anti-malware, check Enable zero-hour auto purge for malware in every policy. In Anti-spam, check Zero-hour auto purge (ZAP) for phishing and spam in every inbound policy and the spam and phishing actions.
- In Exchange Online PowerShell (read-only):
Get-MalwareFilterPolicy | Format-Table Name, ZapEnabled Get-HostedContentFilterPolicy | Format-Table Name, PhishZapEnabled, SpamZapEnabled, SpamAction, PhishSpamAction, HighConfidencePhishAction Get-TeamsProtectionPolicy | Format-Table Name, ZapEnabled - Fail if one of the ZAP values is
Falsein a policy that applies to users, or if a spam or phishing action isAddXHeader,ModifySubjectorRedirect.
Remediation
- In the Defender portal, edit each anti-malware and anti-spam policy, turn the ZAP options on and set the actions as in CB-M365-MAIL-030.
- PowerShell equivalent (Security Administrator):
(Preset policies cannot be edited and already have ZAP on.)Get-MalwareFilterPolicy | Set-MalwareFilterPolicy -ZapEnabled $true Get-HostedContentFilterPolicy | Set-HostedContentFilterPolicy -PhishZapEnabled $true -SpamZapEnabled $true Set-TeamsProtectionPolicy -Identity "Teams Protection Policy" -ZapEnabled $true
References
- Zero-hour auto purge (ZAP) in Exchange Online Microsoft, vendor-doc, accessed 2026-10-24
- Recommended settings for EOP and Microsoft Defender for Office 365 security Microsoft, vendor-doc, accessed 2026-10-24
- CISA SCuBA Microsoft 365 security suite baseline CISA, standard, accessed 2026-10-24
- ORCA - Office 365 Recommended Configuration Analyzer (checks ORCA-120, ORCA-121) Microsoft (community project), tool, accessed 2026-10-24
Mappings
| Framework | ID | Relation |
|---|---|---|
| NIST SP 800-53 Rev. 55.1.1 | SI-3 | related |
| NIST SP 800-53 Rev. 55.1.1 | SI-8 | related |
| CISA SCuBA Microsoft 365 Secure Configuration Baselines2.0.0 | MS.SECURITYSUITE.1.2v1 | equivalent |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Threats mitigated
| Taxonomy | ID |
|---|---|
| MITRE ATT&CK | T1566 |
Related controls
- related
CB-M365-MAIL-030Apply the recommended inbound anti-spam actions with no allowed senders or domains - related
CB-M365-MAIL-034Turn on automated remediation of malicious message clusters in AIR - related
CB-M365-COLLAB-033Keep zero-hour auto purge enabled for Teams messages
People and lifecycle
| Authors |
|
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-24, 2026-10-24 |
| Translations | fr |