Skip to content

Commit

Permalink
Merge pull request #352 from Snozzberries/aadFix
Browse files Browse the repository at this point in the history
More fixes to #325
  • Loading branch information
merill authored Jul 14, 2024
2 parents 5f5352e + de0e7b3 commit d2c5fcf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ Function Test-MtCisaActivationNotification {
return $null
}else{
$EntraIDPlan = Get-MtLicenseInformation -Product EntraID
if($EntraIDPlan -ne "P2"){
Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDP2
}elseif($EntraIDPlan -ne "Governance"){
Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDGovernance
if($EntraIDPlan -notin @("P2","Governance")){
if($EntraIDPlan -ne "P2"){
Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDP2
return $null
}elseif($EntraIDPlan -ne "Governance"){
#This will not currently be hit
Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDGovernance
return $null
}
}
return $null
}

$roles = Get-MtRole -CisaHighlyPrivilegedRoles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Function Test-MtCisaDiagnosticSettings {
$result = "| Log Name | Result |`n"
$result += "| --- | --- |`n"

foreach ($item in $array) {
foreach ($item in ($array | Sort-Object Log)) {
$itemResult = $resultFail
if($item.Enabled){
$itemResult = $resultPass
Expand Down
4 changes: 3 additions & 1 deletion powershell/public/cisa/entra/Test-MtCisaGlobalAdminRatio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Function Test-MtCisaGlobalAdminRatio {
$_.'@odata.type' -eq "#microsoft.graph.user"}

If ($otherAssignments.Count) {
$ratio = 0
$ratio = $globalAdministrators.Count / $otherAssignments.Count
$testResult = $ratio -le 1
} Else {
Expand All @@ -55,7 +56,8 @@ Function Test-MtCisaGlobalAdminRatio {
} else {
$testResultMarkdown = "Your tenant does not have enough granular [role assignments]($link).`n`n%TestResult%"
}
$result = "$ratio = $($globalAdministrators.Count) / $($otherAssignments.Count)"
$result = "Current Ratio: $([System.Math]::Round($ratio,2)) = $($globalAdministrators.Count) / $($otherAssignments.Count)`n"
$result += "Ratio >= 1 - $($ratio -ge 1)"
$testResultMarkdown = $testResultMarkdown -replace "%TestResult%", $result

Add-MtTestResultDetail -Result $testResultMarkdown
Expand Down

0 comments on commit d2c5fcf

Please sign in to comment.