From eef1f49d09c49a28f94113c100cbd749e15e75c8 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 22 Dec 2020 22:56:01 -0500 Subject: [PATCH] Corrected cortex_init process which was incorrectly attempting to access ES via the external URL; Removing 1-2 minute sleeps during init to see if those are no longer needed --- salt/thehive/scripts/cortex_init | 4 ++-- salt/thehive/scripts/hive_init | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/salt/thehive/scripts/cortex_init b/salt/thehive/scripts/cortex_init index beade9c4b..ce12fffe0 100644 --- a/salt/thehive/scripts/cortex_init +++ b/salt/thehive/scripts/cortex_init @@ -1,4 +1,5 @@ #!/bin/bash +# {%- set MANAGERIP = salt['pillar.get']('global:managerip', '') %} # {%- set URLBASE = salt['pillar.get']('global:url_base', '') %} # {%- set CORTEXUSER = salt['pillar.get']('global:cortexuser', 'cortexadmin') %} # {%- set CORTEXPASSWORD = salt['pillar.get']('global:cortexpassword', 'cortexchangeme') %} @@ -16,7 +17,6 @@ cortex_clean(){ } cortex_init(){ - sleep 60 CORTEX_API_URL="{{URLBASE}}/cortex/api" CORTEX_USER="{{CORTEXUSER}}" CORTEX_PASSWORD="{{CORTEXPASSWORD}}" @@ -60,7 +60,7 @@ if [ -f /opt/so/state/cortex.txt ]; then exit 0 else rm -f garbage_file - while ! wget -O garbage_file {{URLBASE}}:9500 2>/dev/null + while ! wget -O garbage_file {{MANAGERIP}}:9500 2>/dev/null do echo "Waiting for Elasticsearch..." rm -f garbage_file diff --git a/salt/thehive/scripts/hive_init b/salt/thehive/scripts/hive_init index 51eefeac8..6a836be60 100755 --- a/salt/thehive/scripts/hive_init +++ b/salt/thehive/scripts/hive_init @@ -11,7 +11,6 @@ thehive_clean(){ } thehive_init(){ - sleep 120 THEHIVE_URL="{{URLBASE}}/thehive" THEHIVE_API_URL="$THEHIVE_URL/api" THEHIVE_USER="{{THEHIVEUSER}}"