maester icon indicating copy to clipboard operation
maester copied to clipboard

🪲 MT.1014 fails, despite all recommended admin roles being covered by recommended policy

Open GeldHades27355 opened this issue 5 months ago • 6 comments

To Reproduce

  1. install maester 1.3.0.
  2. autoinstall pester 5.5.0
  3. connect-azaccount -tenant -scope
  4. invoke-maester

Expected behavior

Result: PASS

Environment Data

PSVersion 7.5.2 PSEdition Core GitCommitId 7.5.2 OS Microsoft Windows 10.0.26100, Arm64 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 Tenant license M365 Business Premium + Entra P2

GeldHades27355 avatar Jul 24 '25 10:07 GeldHades27355

@GeldHades27355 can you upload the json from the conditional access policy too search for the reason the test failed?

l-gosling avatar Aug 30 '25 00:08 l-gosling

Admins compliant devices for local admins.json

Does that help?

Bear in mind that one admin is excluded, due to being a break glass account.

GeldHades27355 avatar Sep 01 '25 12:09 GeldHades27355

thanks @GeldHades27355 for the json file.

Exclusion is fine. Admin Roles are correct.

There are two things that cause the failure.

  1. Error in code base. I will create a PR for that.
  2. You added only compliant devices. Not the "Entra hybrid joined devices".

l-gosling avatar Sep 01 '25 17:09 l-gosling

Correct - we do not allow hybrid joined devices on our tenants. Given Microsoft's recommendation to NOT hybrid join devices anymore, I'd vote for not penalizing folks who do not allow it, if they fulfil the main requirement that devices should be compliant.

GeldHades27355 avatar Sep 03 '25 10:09 GeldHades27355

@merill Should the test reflect the CA policy templates, or do you agree with @GeldHades27355? I share his view and would use the blue box at the beginning of this document to strengthen the argument.

l-gosling avatar Sep 04 '25 20:09 l-gosling

I think we can find a way to change this to check for compliant OR hybrid and still be compliant with the intent of Microsoft's recommended CA policy. Or, more explicitly, we could check for compliant and Entra-joined OR compliant and hybrid-joined.

      if ( 'domainJoinedDevice' -in $policy.grantControls.builtInControls -and
        'compliantDevice' -in $policy.grantControls.builtInControls -and
        $policy.grantControls.operator -eq "OR" -and $PolicyIncludesAllRoles -and
        $policy.conditions.applications.includeApplications -eq "All"
      )

SamErde avatar Oct 27 '25 10:10 SamErde