feat: add currentsetting

This commit is contained in:
fukusuket
2025-05-16 18:05:43 +09:00
parent 0633cf3ee5
commit b4b18408f9

View File

@@ -391,7 +391,7 @@ function GuideYamatoSecurity
$enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging" -valueName "EnableModuleLogging" -expectedValue 1 $enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging" -valueName "EnableModuleLogging" -expectedValue 1
$rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid } $rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid }
$rules | ForEach-Object { $_.applicable = $enabled } $rules | ForEach-Object { $_.applicable = $enabled }
$current = $enabled ? "Enabled" : "Disabled" $current = if ($enabled) { "Enabled" } else { "Disabled"}
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"Module", "Module",
@@ -410,7 +410,7 @@ function GuideYamatoSecurity
$enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -valueName "EnableScriptBlockLogging" -expectedValue 1 $enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging" -valueName "EnableScriptBlockLogging" -expectedValue 1
$rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid } $rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid }
$rules | ForEach-Object { $_.applicable = $enabled } $rules | ForEach-Object { $_.applicable = $enabled }
$current = $enabled ? "Enabled" : "Disabled" $current = if ($enabled) { "Enabled" } else { "Disabled"}
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"ScriptBlock", "ScriptBlock",