Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/powershell/private/tests/Test-Assessment.21866.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
...
Microsoft Entra recommendations provide opportunities to implement best practices and optimize your organization’s security posture. Not acting might result in increased surface area of risk or suboptimal operations or user experience.

**Remediation action**

Address each of the high impact recommendations. Each recommendation will have its own set of remediation steps:

- [What are Microsoft Entra recommendations?](https://learn.microsoft.com/en-us/entra/identity/monitoring-health/overview-recommendations#recommendations-overview-table)
<!--- Results --->
%TestResult%
28 changes: 23 additions & 5 deletions src/powershell/private/tests/Test-Assessment.21866.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,33 @@ function Test-Assessment-21866{
Write-PSFMessage '🟦 Start' -Tag Test -Level VeryVerbose

$activity = "Checking All Microsoft Entra recommendations are addressed"
Write-ZtProgress -Activity $activity -Status "Getting policy"
Write-ZtProgress -Activity $activity

$result = $false
$testResultMarkdown = "Planned for future release."
$passed = $result
$recommendations = Invoke-ZtGraphRequest -RelativeUri "directory/recommendations" -ApiVersion beta
$result = $recommendations | Where-Object { $_.status -in @('active', 'postponed') }

Write-Output $result.Count
$passed = $result.Count -eq 0
if ($passed) {
$testResultMarkdown = "All Entra Recommendations are addressed.`n`n"
}
else {
$testResultMarkdown = "Found $($result.Count) unaddressed Entra recommendations.`n`n%TestResult%"
}

if ($result.Count -gt 0) {
$mdInfo = "`n## Unaddressed Entra recommendations`n`n"
$mdInfo += "| Display Name | Status | Insights | Priority |`n"
$mdInfo += "| :--- | :--- | :--- | :--- |`n"
foreach ($item in $result) {
$mdInfo += "| $($item.displayName) | $($item.status) | $($item.Insights) | $($item.priority) |`n"
}
}

$testResultMarkdown = $testResultMarkdown -replace "%TestResult%", $mdInfo

Add-ZtTestResultDetail -TestId '21866' -Title "All Microsoft Entra recommendations are addressed" `
-UserImpact Low -Risk Medium -ImplementationCost High `
-AppliesTo Identity -Tag Identity `
-Status $passed -Result $testResultMarkdown -SkippedBecause UnderConstruction
-Status $passed -Result $testResultMarkdown
}