feat: add currentsetting

This commit is contained in:
fukusuket
2025-05-16 18:29:05 +09:00
parent 3daf3bb055
commit 0cd793dbcb

View File

@@ -1586,11 +1586,11 @@ function GuideASD {
$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 = if ($enabled) { "Enabled" } else { "Disabled" }
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"Module", "Module",
$auditpol[$guid], $current,
[array]$rules, [array]$rules,
"No Auditing", "No Auditing",
"Enabled", "Enabled",
@@ -1605,11 +1605,11 @@ function GuideASD {
$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 = if ($enabled) { "Enabled" } else { "Disabled" }
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"ScriptBlock", "ScriptBlock",
$auditpol[$guid], $current,
[array]$rules, [array]$rules,
"Patially", "Patially",
"Enabled", "Enabled",
@@ -2784,11 +2784,11 @@ function GuideMSC {
$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 = if ($enabled) { "Enabled" } else { "Disabled" }
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"Module", "Module",
$auditpol[$guid], $current,
[array]$rules, [array]$rules,
"No Auditing", "No Auditing",
"", "",
@@ -2803,11 +2803,11 @@ function GuideMSC {
$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 = if ($enabled) { "Enabled" } else { "Disabled" }
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"ScriptBlock", "ScriptBlock",
$auditpol[$guid], $current,
[array]$rules, [array]$rules,
"Patially", "Patially",
"", "",
@@ -3982,11 +3982,11 @@ function GuideMSS {
$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 = if ($enabled) { "Enabled" } else { "Disabled" }
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"Module", "Module",
$auditpol[$guid], $current,
[array]$rules, [array]$rules,
"No Auditing", "No Auditing",
"", "",
@@ -4001,11 +4001,11 @@ function GuideMSS {
$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 = if ($enabled) { "Enabled" } else { "Disabled" }
$auditResult += [WELA]::New( $auditResult += [WELA]::New(
"PowerShell", "PowerShell",
"ScriptBlock", "ScriptBlock",
$auditpol[$guid], $current,
[array]$rules, [array]$rules,
"Patially", "Patially",
"", "",