mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-06 09:12:46 +01:00
update
This commit is contained in:
13
WELA.ps1
13
WELA.ps1
@@ -54,9 +54,16 @@ function CalculateUsableRate {
|
|||||||
function ShowRulesCountsByLevel {
|
function ShowRulesCountsByLevel {
|
||||||
param ($usableRate, $msg)
|
param ($usableRate, $msg)
|
||||||
Write-Output $msg
|
Write-Output $msg
|
||||||
$levelOrder = @("critical", "high", "medium", "low", "informational")
|
$levelColorMap = [ordered]@{
|
||||||
$usableRate | Sort-Object { $levelOrder.IndexOf($_.Level) } | ForEach-Object {
|
"critical" = "ff0000"
|
||||||
Write-Output "$($_.Level) rules: $($_.UsableCount) / $($_.TotalCount) ($($_.Percentage)%)"
|
"high" = "ffc100"
|
||||||
|
"medium" = "ffff00"
|
||||||
|
"low" = "00ff00"
|
||||||
|
"informational" = "ffffff" # Assuming a default color for informational
|
||||||
|
}
|
||||||
|
$usableRate | Sort-Object { $levelColorMap.Keys.IndexOf($_.Level) } | ForEach-Object {
|
||||||
|
$color = $levelColorMap[$_.Level]
|
||||||
|
Write-Host "$($_.Level) rules: $($_.UsableCount) / $($_.TotalCount) ($($_.Percentage)%)" -ForegroundColor $color
|
||||||
}
|
}
|
||||||
Write-Output ""
|
Write-Output ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user