mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-06 09:12:46 +01:00
fix: update WELA.ps1 to handle empty Baseline parameter and provide usage examples for configure command
This commit is contained in:
16
WELA.ps1
16
WELA.ps1
@@ -1,7 +1,6 @@
|
|||||||
param (
|
param (
|
||||||
[string]$Cmd,
|
[string]$Cmd,
|
||||||
[string]$OutType = "std",
|
[string]$OutType = "std",
|
||||||
[string]$Baseline = "YamatoSecurity",
|
|
||||||
[bool]$Debug = $false,
|
[bool]$Debug = $false,
|
||||||
[switch]$Auto
|
[switch]$Auto
|
||||||
)
|
)
|
||||||
@@ -5436,6 +5435,8 @@ function ConfigureAuditSettings {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$autidpolTxt = "./auditpol.txt"
|
$autidpolTxt = "./auditpol.txt"
|
||||||
if (-not $debug) {
|
if (-not $debug) {
|
||||||
Start-Process -FilePath "cmd.exe" -ArgumentList "/c chcp 437 & auditpol /get /category:* /r" -NoNewWindow -Wait -RedirectStandardOutput $autidpolTxt
|
Start-Process -FilePath "cmd.exe" -ArgumentList "/c chcp 437 & auditpol /get /category:* /r" -NoNewWindow -Wait -RedirectStandardOutput $autidpolTxt
|
||||||
@@ -5811,6 +5812,9 @@ Write-Host $logo -ForegroundColor Green
|
|||||||
|
|
||||||
switch ($Cmd.ToLower()) {
|
switch ($Cmd.ToLower()) {
|
||||||
"audit-settings" {
|
"audit-settings" {
|
||||||
|
if ([string]::IsNullOrEmpty($Baseline)) {
|
||||||
|
$Baseline = "YamatoSecurity"
|
||||||
|
}
|
||||||
$validGuides = @("YamatoSecurity", "ASD", "Microsoft_Client", "Microsoft_Server")
|
$validGuides = @("YamatoSecurity", "ASD", "Microsoft_Client", "Microsoft_Server")
|
||||||
if (-not ($validGuides -contains $Baseline.ToLower())) {
|
if (-not ($validGuides -contains $Baseline.ToLower())) {
|
||||||
Write-Host "Invalid Guide specified. Valid options are: YamatoSecurity, ASD, Microsoft_Client, Microsoft_Server."
|
Write-Host "Invalid Guide specified. Valid options are: YamatoSecurity, ASD, Microsoft_Client, Microsoft_Server."
|
||||||
@@ -5823,9 +5827,13 @@ switch ($Cmd.ToLower()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
"configure" {
|
"configure" {
|
||||||
$validGuides = @("YamatoSecurity", "ASD", "Microsoft_Client", "Microsoft_Server")
|
if ([string]::IsNullOrEmpty($Baseline)) {
|
||||||
if (-not ($validGuides -contains $Baseline.ToLower())) {
|
Write-Host "You need to specify a baseline. The following baselines are available:"
|
||||||
Write-Host "Invalid Guide specified. Valid options are: YamatoSecurity, ASD, Microsoft_Client, Microsoft_Server."
|
Write-Host " * YamatoSecurity"
|
||||||
|
Write-Host ""
|
||||||
|
Write-Host "Examples: "
|
||||||
|
Write-Host "./WELA.ps1 configure -Baseline YamatoSecurity"
|
||||||
|
Write-Host "./WELA.ps1 configure -Baseline YamatoSecurity -Auto"
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
ConfigureAuditSettings -Baseline $Baseline -Auto:$Auto
|
ConfigureAuditSettings -Baseline $Baseline -Auto:$Auto
|
||||||
|
|||||||
Reference in New Issue
Block a user