@@ -73,14 +73,17 @@ $unusablePercentages = $unusableCounts | ForEach-Object {
73
73
}
74
74
75
75
# Step 6: Generate the required outputtotal
76
+ $customOrder = @ (" critical" , " high" , " medium" , " low" , " informational" )
76
77
Write-Output " Checking event log audit settings. Please wait."
77
78
Write-Output " "
78
79
Write-Output " Detection rules that can be used on this system versus total possible rules:"
80
+ $usablePercentages = $usablePercentages | Sort-Object { $customOrder.IndexOf ($_.Level ) }
79
81
$usablePercentages | ForEach-Object {
80
82
Write-Output " $ ( $_.Level ) rules: $ ( $_.UsableCount ) / $ ( $_.TotalCount ) ($ ( $_.Percentage ) %)"
81
83
}
82
84
Write-Output " "
83
85
Write-Output " Detection rules that cannot be used on this system:"
86
+ $unusablePercentages = $unusablePercentages | Sort-Object { $customOrder.IndexOf ($_.Level ) }
84
87
$unusablePercentages | ForEach-Object {
85
88
Write-Output " $ ( $_.Level ) rules: $ ( $_.UnusableCount ) / $ ( $_.TotalCount ) ($ ( $_.Percentage ) %)"
86
89
}
@@ -91,7 +94,7 @@ Write-Output ""
91
94
$totalUsable = ($usablePercentages | Measure-Object - Property UsableCount - Sum).Sum
92
95
$totalRulesCount = ($totalCounts | Measure-Object - Property Count - Sum).Sum
93
96
$utilizationPercentage = " {0:N2}" -f (($totalUsable / $totalRulesCount ) * 100 )
94
- Write-Output " You can only utilize $utilizationPercentage % of your Security detection rules."
97
+ Write-Output " You can utilize $utilizationPercentage % of your detection rules."
95
98
96
99
# Step 7: Save the lists of usable and unusable rules to CSV files
97
100
$usableRules | Select-Object title, level, id | Export-Csv - Path " UsableRules.csv" - NoTypeInformation
0 commit comments