From 38f42eafa57f6b2a9cb211e2d9ffeb2c924f126b Mon Sep 17 00:00:00 2001 From: Wes Lambert Date: Tue, 28 Jan 2020 15:02:50 +0000 Subject: [PATCH] Add Features enable script --- salt/common/tools/sbin/so-features-enable | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 salt/common/tools/sbin/so-features-enable diff --git a/salt/common/tools/sbin/so-features-enable b/salt/common/tools/sbin/so-features-enable new file mode 100644 index 000000000..a37743960 --- /dev/null +++ b/salt/common/tools/sbin/so-features-enable @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2014,2015,2016,2017,2018,2019,2020 Security Onion Solutions, LLC + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +. /usr/sbin/so-common + +VERSION=$(grep soversion /opt/so/saltstack/pillar/static.sls | cut -d':' -f2|sed 's/ //g') +# Modify static.sls to enable Features +sed -i 's/features: False/features: True/' /opt/so/saltstack/pillar/static.sls +SUFFIX="-features" +TRUSTED_CONTAINERS=( \ + "so-elasticsearch:$VERSION$SUFFIX" \ + "so-filebeat:$VERSION$SUFFIX" \ + "so-kibana:$VERSION$SUFFIX" \ + "so-logstash:$VERSION$SUFFIX" ) + +for i in "${TRUSTED_CONTAINERS[@]}" +do + # Pull down the trusted docker image + echo "Downloading $i" + docker pull --disable-content-trust=false docker.io/soshybridhunter/$i + # Tag it with the new registry destination + docker tag soshybridhunter/$i $HOSTNAME:5000/soshybridhunter/$i + docker push $HOSTNAME:5000/soshybridhunter/$i +done +for i in "${TRUSTED_CONTAINERS[@]}" +do + echo "Removing $i locally" + docker rmi soshybridhunter/$i +done