Inbound anti-spam policies should not contain allowed sender domains
This check reads your inbound anti-spam policies in Exchange Online and looks for domains in the allowed sender domains list. The safe setting is to leave that list empty, so no whole domain is trusted by default.
Why it matters
Each inbound anti-spam policy has an Allowed section where admins can add allowed senders and allowed domains (see Configure spam filter policies, Microsoft Learn). An allowed domain is a standing trust decision for every address at that domain, and it tends to outlive the reason it was added: a vendor that was replaced, a campaign that ended, a ticket nobody remembers.
A sender domain is also something an attacker can imitate or abuse through a compromised mailbox at that domain. The wider the allow entry, the more mail you ask the filter to treat kindly on the strength of a name alone. Keeping the list empty means each sender earns delivery through normal filtering, and the exceptions you really need can be narrower and reviewed.
How to check it yourself
Portal: in the Microsoft Defender portal go to Email & collaboration > Policies & rules > Threat policies > Anti-spam. Open each inbound policy, including the default one, and read the Allowed and blocked senders and domains section.
PowerShell (read-only, in Exchange Online PowerShell):
Get-HostedContentFilterPolicy | Format-List Name,AllowedSenders,AllowedSenderDomainsThe safe setting is an empty AllowedSenderDomains on every policy. For each entry you find, note who asked for it and whether the sender still exists.
How to fix it
Portal: open the policy, edit the allowed domains in the Allowed section and remove the entries, then save.
PowerShell, which changes the tenant, so review the list from the check first (ConfigCobra only reports and suggests, it never changes your tenant). Replace the policy name and domain with your own values:
Set-HostedContentFilterPolicy -Identity "Default" -AllowedSenderDomains @{Remove="example.com"}Repeat per entry and per policy, then run the check command again and confirm the list is empty. If a partner really must be trusted, prefer a narrower, documented exception that has an owner, and review it on a schedule.
What changes when you fix it
Mail from a removed domain is filtered like mail from any other sender. Most of it will keep arriving; messages the filter judges to be spam or phishing may now go to Junk or quarantine, where before they were let through.
- Users who get mail from the removed domains may see some of it in Junk or quarantine.
- Security and help desk teams may need to release a few quarantined messages in the first days.
- Other policies are not affected; each anti-spam policy has its own list.
Before removing a long-standing entry, ask the business owner of that relationship, and look at recent mail from the domain in message trace so you know what normal looks like.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Microsoft 365 Foundations v7.0.0 | 2.1.14 | E3 Level 1 |
More checks in Microsoft Defender
- 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
- Safe Attachments policy should be enabledCIS 2.1.4
- Safe Attachments for SharePoint, OneDrive, and Microsoft Teams should be enabledCIS 2.1.5
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.