From 5ecb48359693d8eaa355e311984eb1b0c2d949e8 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 29 Apr 2025 09:35:36 -0400 Subject: [PATCH] excluded harmless log error; suppress so-user grep output --- salt/common/tools/sbin/so-log-check | 1 + salt/manager/tools/sbin/so-user | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/salt/common/tools/sbin/so-log-check b/salt/common/tools/sbin/so-log-check index 66f6825e9..96881aa56 100755 --- a/salt/common/tools/sbin/so-log-check +++ b/salt/common/tools/sbin/so-log-check @@ -128,6 +128,7 @@ if [[ $EXCLUDE_STARTUP_ERRORS == 'Y' ]]; then EXCLUDED_ERRORS="$EXCLUDED_ERRORS|No shard available" # Typical error when making a query before ES has finished loading all indices EXCLUDED_ERRORS="$EXCLUDED_ERRORS|responded with status-code 503" # telegraf getting 503 from ES during startup EXCLUDED_ERRORS="$EXCLUDED_ERRORS|process_cluster_event_timeout_exception" # logstash waiting for elasticsearch to start + EXCLUDED_ERRORS="$EXCLUDED_ERRORS|not configured for GeoIP" # SO does not bundle the maxminddb with Zeek fi if [[ $EXCLUDE_FALSE_POSITIVE_ERRORS == 'Y' ]]; then diff --git a/salt/manager/tools/sbin/so-user b/salt/manager/tools/sbin/so-user index e6ac9eb1f..92b3ba385 100755 --- a/salt/manager/tools/sbin/so-user +++ b/salt/manager/tools/sbin/so-user @@ -356,7 +356,7 @@ function syncElastic() { [[ $? != 0 ]] && fail "Unable to read credential hashes from database" user_data_formatted=$(echo "${userData}" | jq -r '.user + ":" + .data.hashed_password') - if lookup_salt_value "features" "" "pillar" | grep -x odc; then + if lookup_salt_value "features" "" "pillar" | grep -qx odc; then # generate random placeholder salt/hash for users without passwords random_crypt=$(get_random_value 53) user_data_formatted=$(echo "${user_data_formatted}" | sed -r "s/^(.+:)\$/\\1\$2a\$12${random_crypt}/")