# (L1) Ensure the connection filter IP allow list is not used (Only Checks Default Policy)

(L1) Ensure the connection filter IP allow list is not used (Only Checks Default Policy). A Maester check for Defender, Anti-spam.

Source: https://maester.dev/docs/tests/CIS.M365.2.1.12

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/nzlostboy" title="Ben Miles · Original author"><img src="https://github.com/NZLostboy.png" alt="Ben Miles" width="28" height="28" loading="lazy" decoding="async" /></a><a class="test-byline-avatar" href="/contributors/knussbaumer" title="Kim Nussbaumer · Co-contributor"><img src="https://github.com/knussbaumer.png" alt="Kim Nussbaumer" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/nzlostboy">Ben Miles</a> with <a href="/contributors/knussbaumer">Kim Nussbaumer</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/cis">CIS</a> · Defender · Anti-spam · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId CIS.M365.2.1.12
```

## Overview

2.1.12 (L1) Ensure the connection filter IP allow list is not used

In Microsoft 365 organizations with Exchange Online mailboxes or standalone Exchange Online Protection (EOP) organizations without Exchange Online mailboxes, connection filtering and the default connection filter policy identify good or bad source email servers by IP addresses. The key components of the default connection filter policy are IP Allow List, IP Block List and Safe list.
The recommended state is **IP Allow List** empty or undefined.

#### Rationale

Without additional verification like mail flow rules, email from sources in the IP Allow List skips spam filtering and sender authentication (SPF, DKIM, DMARC) checks. This method creates a high risk of attackers successfully delivering email to the Inbox that would otherwise be filtered. Messages that are determined to be malware or high confidence phishing are filtered.

#### Impact

This is the default behavior. IP Allow lists may reduce false positives, however, this benefit is outweighed by the importance of a policy which scans all messages regardless of the origin. This supports the principle of zero trust.

#### Remediation action

To remove IPs from the allow list:

1. Navigate to [Microsoft 365 Defender](https://security.microsoft.com).
2. Click to expand **Email & collaboration** select **Policies & rules** > **Threat policies**.
3. Under policies select **Anti-spam**.
4. Click on the **Connection filter policy (Default)**.
5. Click **Edit connection filter policy**.
6. Remove any IP entries from **Always allow messages from the following IP addresses or address range:**.
7. Click **Save**.

##### PowerShell

1. Connect to Exchange Online using `Connect-ExchangeOnline`.
2. Run the following PowerShell command:

```powershell
Set-HostedConnectionFilterPolicy -Identity Default -IPAllowList @{}
```

#### Related links

* [Microsoft 365 Defender](https://security.microsoft.com)
* [Configure connection filtering in cloud organizations](https://learn.microsoft.com/defender-office-365/connection-filter-policies-configure)
* [Create sender allowlists for cloud mailboxes](https://learn.microsoft.com/defender-office-365/create-safe-sender-lists-in-office-365#use-the-ip-allow-list)
* [When user and organization settings conflict](https://learn.microsoft.com/defender-office-365/how-policies-and-protections-are-combined#user-and-tenant-settings-conflict)
* [CIS Microsoft 365 Foundations Benchmark v7.0.0 - Page 128](https://www.cisecurity.org/benchmark/microsoft_365)

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | CIS.M365.2.1.12 |
| Severity | Medium |
| Suite | CIS |
| Product | Defender |
| Related products | Exchange Online |
| Feature | Anti-spam |
| Area | Email and collaboration protection |
| Resource type | Tenant |
| User impact | Low |
| Implementation cost | Medium |
| MITRE ATT&CK | T1566 Phishing, T1684.002 Email Spoofing |
| Supports benchmark | CIS Microsoft 365 Foundations Benchmark (version 7.0.0), requirement 2.1.12 |
| Benchmark level | L1 |
| Benchmark profiles | E3 Level 1 |
| Supports controls | cis-m365:2.1.12, nist-800-53-r5:AC-4 |
| PowerShell test | [Test-MtCisHostedConnectionFilterPolicy](https://github.com/maester365/maester/blob/main/tests/cis/Test.CIS.M365.2.1.12.ps1) |
| Services | ExchangeOnline |

</details>

## Source

- Test: [`tests/cis/Test.CIS.M365.2.1.12.ps1`](https://github.com/maester365/maester/blob/main/tests/cis/Test.CIS.M365.2.1.12.ps1)
- Documentation: [`tests/cis/Test.CIS.M365.2.1.12.md`](https://github.com/maester365/maester/blob/main/tests/cis/Test.CIS.M365.2.1.12.md)
