mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-06 17:22:50 +01:00
update
This commit is contained in:
8
WELA.ps1
8
WELA.ps1
@@ -1,17 +1,17 @@
|
|||||||
function Get-ApplicableRules {
|
function Get-ApplicableRules {
|
||||||
param (
|
param (
|
||||||
[string]$outputPath,
|
[string]$outputFilePath,
|
||||||
[string]$jsonPath
|
[string]$jsonFilePath
|
||||||
)
|
)
|
||||||
|
|
||||||
$extractedGuids = [System.Collections.Generic.HashSet[string]]::new()
|
$extractedGuids = [System.Collections.Generic.HashSet[string]]::new()
|
||||||
Get-Content -Path $outputPath | Select-String -NotMatch "No Auditing" | ForEach-Object {
|
Get-Content -Path $outputFilePath | Select-String -NotMatch "No Auditing" | ForEach-Object {
|
||||||
if ($_ -match '{(.*?)}') {
|
if ($_ -match '{(.*?)}') {
|
||||||
[void]$extractedGuids.Add($matches[1])
|
[void]$extractedGuids.Add($matches[1])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$jsonContent = Get-Content -Path $jsonPath -Raw | ConvertFrom-Json
|
$jsonContent = Get-Content -Path $jsonFilePath -Raw | ConvertFrom-Json
|
||||||
foreach ($rule in $jsonContent) {
|
foreach ($rule in $jsonContent) {
|
||||||
$rule | Add-Member -MemberType NoteProperty -Name "applicable" -Value $false
|
$rule | Add-Member -MemberType NoteProperty -Name "applicable" -Value $false
|
||||||
foreach ($guid in $rule.subcategory_guids) {
|
foreach ($guid in $rule.subcategory_guids) {
|
||||||
|
|||||||
Reference in New Issue
Block a user