From fcc44cbf741bfbd2d30121095c33bd976472d734 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 7 May 2019 15:28:11 -0400 Subject: [PATCH] Breaking the Hive --- salt/common/init.sls | 1 + salt/hive/thehive/scripts/hive_init.sh | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/salt/common/init.sls b/salt/common/init.sls index 15ba20e83..b582deda2 100644 --- a/salt/common/init.sls +++ b/salt/common/init.sls @@ -37,6 +37,7 @@ sensorpkgs: - skip_suggestions: False - pkgs: - docker-ce + - wget {% if grains['os'] != 'CentOS' %} - python-docker - python-m2crypto diff --git a/salt/hive/thehive/scripts/hive_init.sh b/salt/hive/thehive/scripts/hive_init.sh index cb901e36b..4e121e078 100755 --- a/salt/hive/thehive/scripts/hive_init.sh +++ b/salt/hive/thehive/scripts/hive_init.sh @@ -33,5 +33,14 @@ hive_init(){ if [ -f /opt/so/state/thehive.txt ]; then exit 0 else + rm -f garbage_file + while ! wget -O garbage_file {{MASTERIP}}:9500 2>/dev/null + do + echo "Waiting for Elasticsearch..." + rm -f garbage_file + sleep 1 + done + rm -f garbage_file + sleep 5 hive_init fi