mirror of
https://github.com/Yamato-Security/WELA.git
synced 2025-12-07 17:52:49 +01:00
Merge pull request #34 from Yamato-Security/9-update-rules-command
feat: add update-rules command
This commit is contained in:
2
.github/workflows/create-rule-meta.yml
vendored
2
.github/workflows/create-rule-meta.yml
vendored
@@ -1,7 +1,5 @@
|
|||||||
name: create security_rules.json
|
name: create security_rules.json
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches: [ "*" ]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 20 * * *'
|
- cron: '0 20 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|||||||
23
WELA.ps1
23
WELA.ps1
@@ -1521,6 +1521,24 @@ function AuditFileSize {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function UpdateRules {
|
||||||
|
$urls = @(
|
||||||
|
"https://raw.githubusercontent.com/Yamato-Security/WELA/main/config/eid_subcategory_mapping.csv",
|
||||||
|
"https://raw.githubusercontent.com/Yamato-Security/WELA/main/config/security_rules.json"
|
||||||
|
)
|
||||||
|
$outputPaths = @(
|
||||||
|
"./config/eid_subcategory_mapping.csv",
|
||||||
|
"./config/security_rules.json"
|
||||||
|
)
|
||||||
|
|
||||||
|
for ($i = 0; $i -lt $urls.Count; $i++) {
|
||||||
|
Write-Host "Downloading $($urls[$i])"
|
||||||
|
Invoke-WebRequest -Uri $urls[$i] -OutFile $outputPaths[$i] -UseBasicParsing
|
||||||
|
Write-Host "Saved to $($outputPaths[$i])"
|
||||||
|
Write-Host ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$logo = @"
|
$logo = @"
|
||||||
┏┓┏┓┏┳━━━┳┓ ┏━━━┓
|
┏┓┏┓┏┳━━━┳┓ ┏━━━┓
|
||||||
┃┃┃┃┃┃┏━━┫┃ ┃┏━┓┃
|
┃┃┃┃┃┃┏━━┫┃ ┃┏━┓┃
|
||||||
@@ -1538,6 +1556,7 @@ Usage:
|
|||||||
./WELA.ps1 audit-settings gui # Audit current setting and show in gui, save to csv
|
./WELA.ps1 audit-settings gui # Audit current setting and show in gui, save to csv
|
||||||
./WELA.ps1 audit-settings table # Audit current setting and show in table layout, save to csv
|
./WELA.ps1 audit-settings table # Audit current setting and show in table layout, save to csv
|
||||||
./WELA.ps1 audit-filesize # Audit current file size and show in stdout, save to csv
|
./WELA.ps1 audit-filesize # Audit current file size and show in stdout, save to csv
|
||||||
|
./WELA.ps1 update-rules # Update rule config files from https://github.com/Yamato-Security/WELA
|
||||||
./WELA.ps1 help # Show this help
|
./WELA.ps1 help # Show this help
|
||||||
"@
|
"@
|
||||||
|
|
||||||
@@ -1568,6 +1587,10 @@ switch ($command) {
|
|||||||
AuditFileSize
|
AuditFileSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"update-rules" {
|
||||||
|
UpdateRules
|
||||||
|
}
|
||||||
|
|
||||||
"help" {
|
"help" {
|
||||||
Write-Host $help
|
Write-Host $help
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user