mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-05-17 00:30:58 +02:00
Merge pull request #15884 from Security-Onion-Solutions/reyesj2/strelkalnk
rename strelka ScanLNK - ScanLnk
This commit is contained in:
@@ -655,6 +655,27 @@ ensure_postgres_secret() {
|
||||
chown socore:socore "$secrets_file"
|
||||
}
|
||||
|
||||
rename_strelka_scan_lnk() {
|
||||
echo "Renaming strelka pillar ScanLNK to ScanLnk."
|
||||
local STRELKA_FILE=/opt/so/saltstack/local/pillar/strelka/soc_strelka.sls
|
||||
local MINIONDIR=/opt/so/saltstack/local/pillar/minions
|
||||
local OLD_KEY=strelka.backend.config.backend.scanners.ScanLNK
|
||||
local NEW_KEY=strelka.backend.config.backend.scanners.ScanLnk
|
||||
local TMP_VALUE_FILE
|
||||
TMP_VALUE_FILE=$(mktemp)
|
||||
|
||||
for pillar_file in "$STRELKA_FILE" "$MINIONDIR"/*.sls; do
|
||||
[[ -f "$pillar_file" ]] || continue
|
||||
# Skip if ScanLNK doesn't exist
|
||||
so-yaml.py get "$pillar_file" "$OLD_KEY" > "$TMP_VALUE_FILE" 2>/dev/null || continue
|
||||
echo "Found 'ScanLNK' key in $pillar_file. Renaming to 'ScanLnk'."
|
||||
so-yaml.py add "$pillar_file" "$NEW_KEY" "file:$TMP_VALUE_FILE"
|
||||
so-yaml.py remove "$pillar_file" "$OLD_KEY"
|
||||
done
|
||||
|
||||
rm -f "$TMP_VALUE_FILE"
|
||||
}
|
||||
|
||||
up_to_3.1.0() {
|
||||
ensure_postgres_local_pillar
|
||||
ensure_postgres_secret
|
||||
@@ -662,7 +683,7 @@ up_to_3.1.0() {
|
||||
elasticsearch_backup_index_templates
|
||||
# Clear existing component template state file.
|
||||
rm -f /opt/so/state/esfleet_component_templates.json
|
||||
|
||||
rename_strelka_scan_lnk
|
||||
|
||||
INSTALLEDVERSION=3.1.0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user