Zero-hour auto purge should be turned on for Microsoft Teams
This check looks at the Teams protection policy in Microsoft Defender for Office 365 and whether zero-hour auto purge (ZAP) is switched on. The safe setting is ZAP for Teams turned on, so messages later found to be malware or high-confidence phishing are pulled back after delivery.
Why it matters
A chat message can look harmless when it arrives and only be flagged as malicious later, once Microsoft's detection signals catch up. Chat feels informal, so people tend to click links and open files there with less suspicion than in email. ZAP closes that gap: after delivery, it acts on Teams messages that are later identified as malware or high-confidence phishing and quarantines them. Because everyone in a chat gets the same copy of a message, a block removes it for every participant at once.
Microsoft's documentation says the protection covers internal messages in chats and standard channels, and that action can come up to 48 hours after delivery. Messages from external senders in chats are not covered, so ZAP is one layer and not a full answer to Teams abuse. It needs Microsoft Defender for Office 365 Plan 1 or Plan 2.
Sources: Zero-hour auto purge in Defender for Office 365 and Defender for Office 365 support for Teams on Microsoft Learn.
How to check it yourself
In the Microsoft Defender portal (security.microsoft.com), go to Settings > Email & collaboration > Microsoft Teams protection. In the Zero-hour auto purge (ZAP) section the toggle should be On. Also read the Exclude these participants list, because ZAP does not act for recipients who are excluded.
Read-only check with Exchange Online PowerShell:
Connect-ExchangeOnline
Get-TeamsProtectionPolicy | Format-List Name,ZapEnabled,HighConfidencePhishQuarantineTag,MalwareQuarantineTag
Get-TeamsProtectionPolicyRule | Format-List Name,ExceptIfSentTo,ExceptIfSentToMemberOf,ExceptIfRecipientDomainIsThe safe result is ZapEnabled : True. If the second command returns nothing, no exclusions are defined. Try this on a test tenant first if you can.
How to fix it
In the Defender portal, open Settings > Email & collaboration > Microsoft Teams protection, move the ZAP toggle to On, review the exclusions and select Save. You need an account allowed to manage these settings in Defender, and a Defender for Office 365 plan in your licence set.
The same change in Exchange Online PowerShell:
Set-TeamsProtectionPolicy -Identity "Teams Protection Policy" -ZapEnabled $trueConfigCobra itself only reads your tenant and never changes it. Apply the fix yourself through the portal or the script above, then run a new scan to confirm the check now passes.
What changes when you fix it
Users notice nothing during normal use. A message that ZAP later flags as malware or high-confidence phishing is blocked for everyone in that chat, and it goes to quarantine. Microsoft states that quarantined Teams messages can currently be managed by admins only, and users do not receive quarantine notifications, so tell your security or help desk team to expect questions such as "a message disappeared". Admins release or review those messages in the Defender portal quarantine view.
If you excluded users, groups or domains, ZAP will skip them. Keep that list short and review it now and then. Turning ZAP on does not alter older messages that were already judged clean.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Microsoft 365 Foundations v7.0.0 | 2.4.4 | E5 Level 1 |
More checks in Microsoft Defender
- Priority account protection should be enabled and configuredCIS 2.4.1
- Priority accounts should have Strict protection presets appliedCIS 2.4.2
- Safe Links for Office Applications should be enabledCIS 2.1.1
- The common attachment types filter should be enabledCIS 2.1.2
- Notifications for internal users sending malware should be enabledCIS 2.1.3
Go further
- Microsoft Defender21 controls in this section
- CIS Microsoft 365 Foundations v7.0.0160 controls
- CIS Microsoft 365 Foundations checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftScheduled scans, drift detection and email alerts when a control regresses
Check this on your Microsoft 365
ConfigCobra runs this check with every other control of the CIS Microsoft 365 Foundations Benchmark, read-only.