From beeae6027d8b4bb53c462be4e5274652f1c8b591 Mon Sep 17 00:00:00 2001 From: Jeremy Finney Date: Tue, 10 Nov 2026 15:36:40 +1300 Subject: [PATCH 1/6] feat(cisa): migrate Security Suite audit and spam checks 5.1-5.2 and 6.1-6.2 (Part 3) Move EXO 17.1, 17.3 and 14.3 to SECURITYSUITE 5.1, 5.2 and 6.2, and replace EXO 14.1 and 14.2 with 6.1, which follows ScubaGear for the effective spam policy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Test-MtCisaSecuritySuiteSpam.Tests.ps1 | 72 +++++++ .../functions/engine/Frameworks.Tests.ps1 | 8 +- .../engine/NativeLicenseGates.Tests.ps1 | 2 +- tests/cisa/exchange/Test.CISA.MS.EXO.14.1.md | 23 --- tests/cisa/exchange/Test.CISA.MS.EXO.14.1.ps1 | 84 -------- tests/cisa/exchange/Test.CISA.MS.EXO.14.2.md | 23 --- tests/cisa/exchange/Test.CISA.MS.EXO.14.2.ps1 | 99 --------- tests/cisa/exchange/Test.CISA.MS.EXO.17.3.md | 16 -- ...1.md => Test.CISA.MS.SECURITYSUITE.5.1.md} | 6 +- ...ps1 => Test.CISA.MS.SECURITYSUITE.5.1.ps1} | 4 +- .../Test.CISA.MS.SECURITYSUITE.5.2.md | 21 ++ ...ps1 => Test.CISA.MS.SECURITYSUITE.5.2.ps1} | 12 +- .../Test.CISA.MS.SECURITYSUITE.6.1.md | 20 ++ .../Test.CISA.MS.SECURITYSUITE.6.1.ps1 | 191 ++++++++++++++++++ ...3.md => Test.CISA.MS.SECURITYSUITE.6.2.md} | 4 +- ...ps1 => Test.CISA.MS.SECURITYSUITE.6.2.ps1} | 4 +- tests/cisa/frameworks/cisa-scuba.json | 24 +++ 17 files changed, 348 insertions(+), 265 deletions(-) create mode 100644 powershell/tests/functions/Test-MtCisaSecuritySuiteSpam.Tests.ps1 delete mode 100644 tests/cisa/exchange/Test.CISA.MS.EXO.14.1.md delete mode 100644 tests/cisa/exchange/Test.CISA.MS.EXO.14.1.ps1 delete mode 100644 tests/cisa/exchange/Test.CISA.MS.EXO.14.2.md delete mode 100644 tests/cisa/exchange/Test.CISA.MS.EXO.14.2.ps1 delete mode 100644 tests/cisa/exchange/Test.CISA.MS.EXO.17.3.md rename tests/cisa/exchange/{Test.CISA.MS.EXO.17.1.md => Test.CISA.MS.SECURITYSUITE.5.1.md} (68%) rename tests/cisa/exchange/{Test.CISA.MS.EXO.17.1.ps1 => Test.CISA.MS.SECURITYSUITE.5.1.ps1} (93%) create mode 100644 tests/cisa/exchange/Test.CISA.MS.SECURITYSUITE.5.2.md rename tests/cisa/exchange/{Test.CISA.MS.EXO.17.3.ps1 => Test.CISA.MS.SECURITYSUITE.5.2.ps1} (68%) create mode 100644 tests/cisa/exchange/Test.CISA.MS.SECURITYSUITE.6.1.md create mode 100644 tests/cisa/exchange/Test.CISA.MS.SECURITYSUITE.6.1.ps1 rename tests/cisa/exchange/{Test.CISA.MS.EXO.14.3.md => Test.CISA.MS.SECURITYSUITE.6.2.md} (80%) rename tests/cisa/exchange/{Test.CISA.MS.EXO.14.3.ps1 => Test.CISA.MS.SECURITYSUITE.6.2.ps1} (96%) diff --git a/powershell/tests/functions/Test-MtCisaSecuritySuiteSpam.Tests.ps1 b/powershell/tests/functions/Test-MtCisaSecuritySuiteSpam.Tests.ps1 new file mode 100644 index 0000000000..0afb387bda --- /dev/null +++ b/powershell/tests/functions/Test-MtCisaSecuritySuiteSpam.Tests.ps1 @@ -0,0 +1,72 @@ +BeforeAll { + $testRoot = Resolve-Path (Join-Path $PSScriptRoot '..\..\..') + . (Join-Path $testRoot 'tests\cisa\exchange\Test.CISA.MS.SECURITYSUITE.6.1.ps1') +} +Describe 'CISA Security Suite spam filter checks' { + BeforeEach { + Mock Add-MtTestResultDetail {} + } + + It 'uses active all-recipient spam-policy precedence and checks the strict preset first' { + $script:exoResponses = @{ + HostedContentFilterPolicy = @( + [pscustomobject]@{ + Identity = 'Strict'; RecommendedPolicyType = 'Strict'; IsDefault = $false + SpamAction = 'Quarantine'; HighConfidenceSpamAction = 'Delete' + PhishSpamAction = 'Redirect'; HighConfidencePhishAction = 'MoveToJmf' + }, + [pscustomobject]@{ + Identity = 'Custom'; RecommendedPolicyType = 'Custom'; IsDefault = $false + SpamAction = 'Deliver'; HighConfidenceSpamAction = 'Deliver' + PhishSpamAction = 'Deliver'; HighConfidencePhishAction = 'Deliver' + }, + [pscustomobject]@{ + Identity = 'Default'; RecommendedPolicyType = 'Custom'; IsDefault = $true + SpamAction = 'Deliver'; HighConfidenceSpamAction = 'Deliver' + PhishSpamAction = 'Deliver'; HighConfidencePhishAction = 'Deliver' + } + ) + EOPProtectionPolicyRule = @( + [pscustomobject]@{ + Identity = 'Strict Preset Security Policy'; HostedContentFilterPolicy = 'Strict' + State = 'Enabled'; SentTo = @(); SentToMemberOf = @(); RecipientDomainIs = @() + } + ) + HostedContentFilterRule = @( + [pscustomobject]@{ + Identity = 'Custom'; HostedContentFilterPolicy = 'Custom'; State = 'Enabled' + SentTo = @(); SentToMemberOf = @(); RecipientDomainIs = @() + ExceptIfSentTo = @(); ExceptIfSentToMemberOf = @(); ExceptIfRecipientDomainIs = @() + } + ) + AcceptedDomain = @() + } + Mock Get-MtExo { $script:exoResponses[$Request] } + + Test-MtCisaSpamAction | Should -BeTrue + + $script:exoResponses.HostedContentFilterPolicy[0].HighConfidencePhishAction = 'Deliver' + Test-MtCisaSpamAction | Should -BeFalse + } + + It 'checks the default spam policy when no higher-priority policy is compliant' { + $script:exoResponses = @{ + HostedContentFilterPolicy = @( + [pscustomobject]@{ + Identity = 'Default'; RecommendedPolicyType = 'Custom'; IsDefault = $true + SpamAction = 'Deliver'; HighConfidenceSpamAction = 'Quarantine' + PhishSpamAction = 'Quarantine'; HighConfidencePhishAction = 'Quarantine' + } + ) + EOPProtectionPolicyRule = @() + HostedContentFilterRule = @() + AcceptedDomain = @() + } + Mock Get-MtExo { $script:exoResponses[$Request] } + + Test-MtCisaSpamAction | Should -BeFalse + + $script:exoResponses.HostedContentFilterPolicy[0].SpamAction = 'Delete' + Test-MtCisaSpamAction | Should -BeTrue + } +} diff --git a/powershell/tests/functions/engine/Frameworks.Tests.ps1 b/powershell/tests/functions/engine/Frameworks.Tests.ps1 index 06a6372fd8..1adc555872 100644 --- a/powershell/tests/functions/engine/Frameworks.Tests.ps1 +++ b/powershell/tests/functions/engine/Frameworks.Tests.ps1 @@ -336,7 +336,7 @@ Describe 'Benchmark of the tests shipped with Maester' { It 'Gives every test a Benchmark of