mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-12 21:29:16 +02:00
Fix jq $def keyword collision in optional-integrations-load
The agent-policy enumeration passed --argjson def, creating a jq variable $def. 'def' is a reserved keyword in jq and the deployed jq version rejects it, so the program failed to compile and in_use_integrations was left empty (silently disabling the in-use upgrade guard). Rename the arg to $defaults.
This commit is contained in:
@@ -53,8 +53,8 @@ for AGENT_POLICY in $agent_policies; do
|
||||
# non-default integrations that are in-use in any policy
|
||||
while IFS= read -r PACKAGE_NAME; do
|
||||
[ -n "$PACKAGE_NAME" ] && in_use_integrations+=("$PACKAGE_NAME")
|
||||
done < <(jq -r --argjson def "$default_packages_json" \
|
||||
'.item.package_policies[].package.name | select(. as $n | ($def | index($n)) | not)' \
|
||||
done < <(jq -r --argjson defaults "$default_packages_json" \
|
||||
'.item.package_policies[].package.name | select(. as $n | ($defaults | index($n)) | not)' \
|
||||
<<<"$policy_json")
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user