mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-07 09:42:48 +01:00
fix: add Crypto-DPAPI Debug logging support to WELA.ps1
This commit is contained in:
83
WELA.ps1
83
WELA.ps1
@@ -277,6 +277,26 @@ function GuideYamatoSecurity
|
|||||||
""
|
""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Crypto-DPAPI Debug
|
||||||
|
$guid = ""
|
||||||
|
$eids = @()
|
||||||
|
$channels = @("Microsoft-Windows-Crypto-DPAPI/Debug")
|
||||||
|
$enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Crypto-DPAPI/Debug" -valueName "Enabled" -expectedValue 1
|
||||||
|
$current = if ($enabled) { "Enabled" } else { "Disabled" }
|
||||||
|
$rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid }
|
||||||
|
$rules | ForEach-Object { $_.applicable = $enabled }
|
||||||
|
$rules | ForEach-Object { $_.ideal = $true }
|
||||||
|
$auditResult += [WELA]::New(
|
||||||
|
"Crypto-DPAPI Debug",
|
||||||
|
"",
|
||||||
|
$current,
|
||||||
|
[array]$rules,
|
||||||
|
"Disabled",
|
||||||
|
"Enabled",
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
)
|
||||||
|
|
||||||
# CodeIntegrity Operational
|
# CodeIntegrity Operational
|
||||||
$guid = ""
|
$guid = ""
|
||||||
$eids = @()
|
$eids = @()
|
||||||
@@ -1513,6 +1533,26 @@ function GuideASD {
|
|||||||
""
|
""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Crypto-DPAPI Debug
|
||||||
|
$guid = ""
|
||||||
|
$eids = @()
|
||||||
|
$channels = @("Microsoft-Windows-Crypto-DPAPI/Debug")
|
||||||
|
$enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Crypto-DPAPI/Debug" -valueName "Enabled" -expectedValue 1
|
||||||
|
$current = if ($enabled) { "Enabled" } else { "Disabled" }
|
||||||
|
$rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid }
|
||||||
|
$rules | ForEach-Object { $_.applicable = $enabled }
|
||||||
|
$rules | ForEach-Object { $_.ideal = $false }
|
||||||
|
$auditResult += [WELA]::New(
|
||||||
|
"Crypto-DPAPI Debug",
|
||||||
|
"",
|
||||||
|
$current,
|
||||||
|
[array]$rules,
|
||||||
|
"Disabled",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
)
|
||||||
|
|
||||||
# Diagnosis-Scripted Operational
|
# Diagnosis-Scripted Operational
|
||||||
$guid = ""
|
$guid = ""
|
||||||
$eids = @()
|
$eids = @()
|
||||||
@@ -2730,6 +2770,26 @@ function GuideMSC {
|
|||||||
""
|
""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Crypto-DPAPI Debug
|
||||||
|
$guid = ""
|
||||||
|
$eids = @()
|
||||||
|
$channels = @("Microsoft-Windows-Crypto-DPAPI/Debug")
|
||||||
|
$enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Crypto-DPAPI/Debug" -valueName "Enabled" -expectedValue 1
|
||||||
|
$current = if ($enabled) { "Enabled" } else { "Disabled" }
|
||||||
|
$rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid }
|
||||||
|
$rules | ForEach-Object { $_.applicable = $enabled }
|
||||||
|
$rules | ForEach-Object { $_.ideal = $false }
|
||||||
|
$auditResult += [WELA]::New(
|
||||||
|
"Crypto-DPAPI Debug",
|
||||||
|
"",
|
||||||
|
$current,
|
||||||
|
[array]$rules,
|
||||||
|
"Disabled",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
)
|
||||||
|
|
||||||
# Diagnosis-Scripted Operational
|
# Diagnosis-Scripted Operational
|
||||||
$guid = ""
|
$guid = ""
|
||||||
$eids = @()
|
$eids = @()
|
||||||
@@ -3947,6 +4007,26 @@ function GuideMSS {
|
|||||||
""
|
""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Crypto-DPAPI Debug
|
||||||
|
$guid = ""
|
||||||
|
$eids = @()
|
||||||
|
$channels = @("Microsoft-Windows-Crypto-DPAPI/Debug")
|
||||||
|
$enabled = CheckRegistryValue -registryPath "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Crypto-DPAPI/Debug" -valueName "Enabled" -expectedValue 1
|
||||||
|
$current = if ($enabled) { "Enabled" } else { "Disabled" }
|
||||||
|
$rules = $all_rules | Where-Object { RuleFilter $_ $eids $channels $guid }
|
||||||
|
$rules | ForEach-Object { $_.applicable = $enabled }
|
||||||
|
$rules | ForEach-Object { $_.ideal = $false }
|
||||||
|
$auditResult += [WELA]::New(
|
||||||
|
"Crypto-DPAPI Debug",
|
||||||
|
"",
|
||||||
|
$current,
|
||||||
|
[array]$rules,
|
||||||
|
"Disabled",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
""
|
||||||
|
)
|
||||||
|
|
||||||
# Diagnosis-Scripted Operational
|
# Diagnosis-Scripted Operational
|
||||||
$guid = ""
|
$guid = ""
|
||||||
$eids = @()
|
$eids = @()
|
||||||
@@ -5506,6 +5586,7 @@ function ConfigureAuditSettings {
|
|||||||
"Microsoft-Windows-AppLocker/Packaged app-Deployment",
|
"Microsoft-Windows-AppLocker/Packaged app-Deployment",
|
||||||
"Microsoft-Windows-AppLocker/Packaged app-Execution",
|
"Microsoft-Windows-AppLocker/Packaged app-Execution",
|
||||||
"Microsoft-Windows-CodeIntegrity/Operational",
|
"Microsoft-Windows-CodeIntegrity/Operational",
|
||||||
|
"Microsoft-Windows-Crypto-DPAPI/Debug",
|
||||||
"Microsoft-Windows-Diagnosis-Scripted/Operational",
|
"Microsoft-Windows-Diagnosis-Scripted/Operational",
|
||||||
"Microsoft-Windows-DriverFrameworks-UserMode/Operational",
|
"Microsoft-Windows-DriverFrameworks-UserMode/Operational",
|
||||||
"Microsoft-Windows-WMI-Activity/Operational",
|
"Microsoft-Windows-WMI-Activity/Operational",
|
||||||
@@ -5545,7 +5626,7 @@ function ConfigureAuditSettings {
|
|||||||
# 特定のログの有効化
|
# 特定のログの有効化
|
||||||
Write-Host "Enabling Event Logs..."
|
Write-Host "Enabling Event Logs..."
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
foreach ($log in @("Microsoft-Windows-TaskScheduler/Operational", "Microsoft-Windows-DriverFrameworks-UserMode/Operational")) {
|
foreach ($log in @("Microsoft-Windows-TaskScheduler/Operational", "Microsoft-Windows-DriverFrameworks-UserMode/Operational", "Microsoft-Windows-Crypto-DPAPI/Debug")) {
|
||||||
try {
|
try {
|
||||||
$logInfo = Get-WinEvent -ListLog $log -ErrorAction Stop
|
$logInfo = Get-WinEvent -ListLog $log -ErrorAction Stop
|
||||||
$currentState = if ($logInfo.IsEnabled) { "Enabled" } else { "Disabled" }
|
$currentState = if ($logInfo.IsEnabled) { "Enabled" } else { "Disabled" }
|
||||||
|
|||||||
Reference in New Issue
Block a user