Open
Description
Describe the bug
CIS.M365.2.1.12 (L1) reports a failure with the result that "The connection filter IP allow list was not empty."
I manually reviewed this setting and confirmed that it is empty and the safe list setting is Off
.
To Reproduce
Steps to reproduce the behavior:
- Run Maester and check the results for this test.
- Manually check the setting at https://security.microsoft.com
Expected behavior
This test should handle cases where the allow list is not even enabled.
It should be an easy fix. The current code checks for lists where the count of items does not equal 0, but when it is not enabled, the test actually returns a 1
.
Test code:
$result = $connectionFilterIPAllowList | Where-Object { $connectionFilterIPAllowList.Count -ne 0 }
Manual test and output:
>> $connectionFilterIPAllowList = Get-HostedConnectionFilterPolicy -Identity Default | Select-Object IPAllowList
>> $connectionFilterIPAllowList
IPAllowList
-----------
{}
>> $connectionFilterIPAllowList.count
1
Module Version
1.1.7
Environment Data
Name Value
---- -----
PSVersion 7.5.1
PSEdition Core
GitCommitId 7.5.1
OS Microsoft Windows 10.0.26120
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0