From f31fbbf1ed92278f539b0af1eca32e51c96215f3 Mon Sep 17 00:00:00 2001 From: Josh Brower Date: Wed, 9 Feb 2022 13:57:18 -0500 Subject: [PATCH] IDH - states allowed --- salt/allowed_states.map.jinja | 2 +- salt/idh/Dockerfile | 12 ------------ salt/idh/init.sls | 4 ++++ salt/idh/supervise-opencanary.conf | 4 ---- setup/so-setup | 4 ++-- 5 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 salt/idh/Dockerfile delete mode 100644 salt/idh/supervise-opencanary.conf diff --git a/salt/allowed_states.map.jinja b/salt/allowed_states.map.jinja index 39596f595..36fd86321 100644 --- a/salt/allowed_states.map.jinja +++ b/salt/allowed_states.map.jinja @@ -248,7 +248,7 @@ {% do allowed_states.append('strelka') %} {% endif %} - {% if WAZUH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-receiver']%} + {% if WAZUH and grains.role in ['so-eval', 'so-manager', 'so-standalone', 'so-node', 'so-managersearch', 'so-heavynode', 'so-receiver','so-idh']%} {% do allowed_states.append('wazuh') %} {% endif %} diff --git a/salt/idh/Dockerfile b/salt/idh/Dockerfile deleted file mode 100644 index d4f4ad67b..000000000 --- a/salt/idh/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM python:3.6-slim - -WORKDIR /root/ - -RUN rm /bin/sh && ln -s /bin/bash /bin/sh - -RUN apt update && apt-get install -y sudo supervisor && rm -rf /var/lib/apt/lists/* -RUN pip install opencanary - -ADD supervise-opencanary.conf /etc/supervisor/conf.d/supervise-opencanary.conf - -CMD ["/usr/bin/supervisord", "-n"] \ No newline at end of file diff --git a/salt/idh/init.sls b/salt/idh/init.sls index a0bcc4572..ea68aaa8c 100644 --- a/salt/idh/init.sls +++ b/salt/idh/init.sls @@ -1,3 +1,7 @@ +{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %} +{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %} +{% set MANAGER = salt['grains.get']('master') %} + # IDH State # Create a config directory diff --git a/salt/idh/supervise-opencanary.conf b/salt/idh/supervise-opencanary.conf deleted file mode 100644 index c60a32d9f..000000000 --- a/salt/idh/supervise-opencanary.conf +++ /dev/null @@ -1,4 +0,0 @@ - [program:opencanaryd] -command=/usr/local/bin/opencanaryd --start -redirect_stderr=true -autorestart=true \ No newline at end of file diff --git a/setup/so-setup b/setup/so-setup index eb44743f6..91a45de7e 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -253,7 +253,7 @@ elif [ "$install_type" = 'FLEET' ]; then OSQUERY=1 elif [ "$install_type" = 'IDH' ]; then is_minion=true - is_idh_standalone=true + is_idh=true IDH=1 elif [ "$install_type" = 'HELIXSENSOR' ]; then is_helix=true @@ -809,7 +809,7 @@ echo "1" > /root/accept_changes set_progress_str 62 "$(print_salt_state_apply 'common')" salt-call state.apply -l info common >> $setup_log 2>&1 - if [[ ! $is_helix && ! $is_receiver ]]; then + if [[ ! $is_helix && ! $is_receiver && ! $is_idh ]]; then set_progress_str 62 "$(print_salt_state_apply 'nginx')" salt-call state.apply -l info nginx >> $setup_log 2>&1 fi