mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-05-02 17:37:58 +02:00
flip logic to check there aren't two default policies and fleet-default-output is disabled
This commit is contained in:
@@ -75,11 +75,11 @@ printf "\n\n"
|
|||||||
status "Verifying so-manager_elasticsearch policy is configured as the current default"
|
status "Verifying so-manager_elasticsearch policy is configured as the current default"
|
||||||
|
|
||||||
# Grab the fleet-default-output policy instead of so-manager_elasticsearch, because a weird state can exist where both fleet-default-output & so-elasticsearch_manager can be set as the active default output for logs / metrics. Resulting in logs not ingesting on import/eval nodes
|
# Grab the fleet-default-output policy instead of so-manager_elasticsearch, because a weird state can exist where both fleet-default-output & so-elasticsearch_manager can be set as the active default output for logs / metrics. Resulting in logs not ingesting on import/eval nodes
|
||||||
# Check that fleet-default-output isn't configured as a default for anything
|
|
||||||
if DEFAULTPOLICY=$(fleet_api "outputs/fleet-default-output"); then
|
if DEFAULTPOLICY=$(fleet_api "outputs/fleet-default-output"); then
|
||||||
fleet_default=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default')
|
fleet_default=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default')
|
||||||
fleet_default_monitoring=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default_monitoring')
|
fleet_default_monitoring=$(echo "$DEFAULTPOLICY" | jq -er '.item.is_default_monitoring')
|
||||||
if [[ ! $fleet_default ]] && [[ ! $fleet_default_monitoring ]]; then
|
# Check that fleet-default-output isn't configured as a default for anything ( both variables return false )
|
||||||
|
if [[ $fleet_default ]] && [[ $fleet_default_monitoring ]]; then
|
||||||
echo -e "\nso-manager_elasticsearch is configured as the current default policy..."
|
echo -e "\nso-manager_elasticsearch is configured as the current default policy..."
|
||||||
else
|
else
|
||||||
echo -e "\nVerification of so-manager_elasticsearch policy failed... The default 'fleet-default-output' output is still active..."
|
echo -e "\nVerification of so-manager_elasticsearch policy failed... The default 'fleet-default-output' output is still active..."
|
||||||
|
|||||||
Reference in New Issue
Block a user