[bug] CISA checks are skipped due to license, but the skipped reason disappears
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.
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.
Here is with an unlicensed tenant and connected to Graph.
Hey @Oppedijk, have you seen this on current main or preview releases? Thanks!
@Snozzberries That was on the current main, I had some issues with the preview release that other things didn't work.
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.
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.
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