Repository navigation
refactor(tests): make CIS.M365.4.1 a shim of MT.1054 - #2720
Conversation
CIS M365 v7.0.0 4.1 audits GET deviceManagement/settings and verifies that secureByDefault is True, which is what MT.1054 checks. The CIS test now returns Test-MtDeviceComplianceSettings instead of re-reading the setting, so the two suites cannot give different answers for one setting. It keeps its own Id, Title, Control and guide; the guide names MT.1054. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M6VYBXV5GBJX6ZY6Y3HQ9VVF
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Up to standards ✅🟢 Issues
|
📑 Description
CIS.M365.4.1 now runs MT.1054's check instead of a copy of it: its body is
return Test-MtDeviceComplianceSettings. It follows "Reviewing a test for duplicates" inAGENTS.md.Why it's a duplicate. The CIS Microsoft 365 Foundations Benchmark v7.0.0, 4.1 (p.185), audits with
GET https://graph.microsoft.com/v1.0/deviceManagement/settingsand verifies thatsecureByDefaultisTrue. MT.1054 reads the same property and passes only when it istrue, so both tests checked the same setting in two different ways. MT.1054 reads the beta endpoint, which returns the same property. When the setting isn't returned, the test still fails.What changes
tests/cis/Test.CIS.M365.4.1.ps1: the body is now the onereturn. The test keeps its ownId,Title,Control(cis-m365:4.1first) and guide. Its other attributes already matched MT.1054's. The help now says which test it runs, and.LINKpoints to the test page, as CIS 4.2 does.tests/cis/Test.CIS.M365.4.1.md: one paragraph that names MT.1054 and explains what the audit checks.✅ Checks
/powershell/tests/pester.ps1locally.ℹ️ Additional Information
Step = 'intune.mark-unassigned-noncompliant'to both CIS.M365.4.1 and MT.1054 and addsStepto the attributes a shim must match inTestShims.Tests.ps1. Whichever PR merges second must keep the shim'sStepthe same as MT.1054's, or TestShims fails.🤖 Generated with Claude Code
Summary by CodeRabbit
falsefails the check.