mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-06-14 14:18:40 +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
|
# non-default integrations that are in-use in any policy
|
||||||
while IFS= read -r PACKAGE_NAME; do
|
while IFS= read -r PACKAGE_NAME; do
|
||||||
[ -n "$PACKAGE_NAME" ] && in_use_integrations+=("$PACKAGE_NAME")
|
[ -n "$PACKAGE_NAME" ] && in_use_integrations+=("$PACKAGE_NAME")
|
||||||
done < <(jq -r --argjson def "$default_packages_json" \
|
done < <(jq -r --argjson defaults "$default_packages_json" \
|
||||||
'.item.package_policies[].package.name | select(. as $n | ($def | index($n)) | not)' \
|
'.item.package_policies[].package.name | select(. as $n | ($defaults | index($n)) | not)' \
|
||||||
<<<"$policy_json")
|
<<<"$policy_json")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user