maester icon indicating copy to clipboard operation
maester copied to clipboard

[bug] CISA checks are skipped due to license, but the skipped reason disappears

Open Oppedijk opened this issue 1 year ago • 5 comments

For instance in: powershell/public/cisa/entra/Test-MtCisaPermanentRoleAssignment.ps1

  $EntraIDPlan = Get-MtLicenseInformation -Product EntraID
    $pim = $EntraIDPlan -eq "P2" -or $EntraIDPlan -eq "Governance"
    if(-not $pim){
        Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDP2
        return $null
    }

The return null delivers no object, and then the ResultsInfoDialog.jsx will just return this:

if (props.Item.Result === "Skipped") {
        return "Test skipped.";
      }

And not display the reason that there was a license not available.

Oppedijk avatar Aug 28 '24 19:08 Oppedijk

I know I have seen this with a skip, but I couldn't recreate it this evening on 0.3.9. I was able to cause a similar issue I believe for a failed result though. What was your scenario to recreate the skipped issue @Oppedijk?

Here is with a licensed tenant, but not connected to Graph. image

Here is with an unlicensed tenant and connected to Graph. image

soulemike avatar Sep 03 '24 03:09 soulemike

Hey @Oppedijk, have you seen this on current main or preview releases? Thanks!

soulemike avatar Sep 16 '24 00:09 soulemike

@Snozzberries That was on the current main, I had some issues with the preview release that other things didn't work.

Oppedijk avatar Sep 16 '24 07:09 Oppedijk

EDIT: I see that this has been fixed in the preview version, so thanks!

I have a similar issue with the MS.AAD.7.x tests. I know this is because I don't have the correct permissions consented to for this specific test, but it should still show this as the skipped reason. image

It seems that this test is skipped in the .tests.ps1 file already, and not in the Test function. Not similar to other tests. So I'm not sure how to fix this myself.

magnusjak avatar Sep 19 '24 08:09 magnusjak

Thanks @magnusjak this looks like it may be related to Add-MtTestResultDetail not having the NotConnectedGraph option for the SkippedBecause parameter though it is available in the Get-MtSkippedReason logic.

Refs

  • https://github.com/maester365/maester/blob/main/powershell/public/Add-MtTestResultDetail.ps1#L67
  • https://github.com/maester365/maester/blob/main/powershell/internal/Get-MtSkippedReason.ps1#L15

soulemike avatar Oct 04 '24 18:10 soulemike