Merge branch 'dev' of github.com:Security-Onion-Solutions/securityonion-saltstack into dev

This commit is contained in:
William Wernert
2020-05-27 10:11:57 -04:00
2 changed files with 16 additions and 11 deletions

View File

@@ -112,5 +112,5 @@ strelka_filestream:
strelka_zeek_extracted_sync: strelka_zeek_extracted_sync:
cron.present: cron.present:
- user: root - user: root
- name: [ -d /nsm/zeek/extracted/complete/ ] && mv /nsm/zeek/extracted/complete/* /nsm/strelka/ > /dev/null 2>&1 - name: '[ -d /nsm/zeek/extracted/complete/ ] && mv /nsm/zeek/extracted/complete/* /nsm/strelka/ > /dev/null 2>&1'
- minute: '*' - minute: '*'

View File

@@ -28,6 +28,8 @@ automation=$2
automated=no automated=no
echo "---- Starting setup at $(date -u) ----" >> $setup_log 2>&1
function progress() { function progress() {
if [ $automated == no ]; then if [ $automated == no ]; then
whiptail --title "Security Onion Install" --gauge 'Please wait while installing' 6 60 0 whiptail --title "Security Onion Install" --gauge 'Please wait while installing' 6 60 0
@@ -35,31 +37,36 @@ function progress() {
} }
if [[ -f automation/$automation && $(basename $automation) == $automation ]]; then if [[ -f automation/$automation && $(basename $automation) == $automation ]]; then
echo "Preselecting variable values based on automated setup: $automation" echo "Preselecting variable values based on automated setup: $automation" >> $setup_log 2>&1
source automation/$automation source automation/$automation
automated=yes automated=yes
echo "Checking network configuration" >> $setup_log 2>&1g
ip a >> $setup_log 2>&1
attempt=1 attempt=1
attempts=60 attempts=60
ip a | grep "$MNIC:" | grep "state UP" ip a | grep "$MNIC:" | grep "state UP" >> $setup_log 2>&1
while [ $? -ne 0 ]; do while [ $? -ne 0 ]; do
ip a >> $setup_log 2>&1
if [ $attempt -gt $attempts ]; then if [ $attempt -gt $attempts ]; then
echo "Network unavailable - setup cannot continue" echo "Network unavailable - setup cannot continue" >> $setup_log 2>&1
exit 1 exit 1
fi fi
echo "Waiting for network to come up (attempt $attempt of $attempts)" echo "Waiting for network to come up (attempt $attempt of $attempts)" >> $setup_log 2>&1
attempt=$((attempt + 1)) attempt=$((attempt + 1))
sleep 10; sleep 10;
ip a | grep "$MNIC:" | grep "state UP" ip a | grep "$MNIC:" | grep "state UP" >> $setup_log 2>&1
done done
echo "Network is up on $MNIC" >> $setup_log 2>&1
fi fi
case "$setup_type" in case "$setup_type" in
iso | network) # Accepted values iso | network) # Accepted values
echo "Beginning Security Onion $setup_type install" echo "Beginning Security Onion $setup_type install" >> $setup_log 2>&1
;; ;;
*) *)
echo "Invalid install type, must be 'iso' or 'network'" echo "Invalid install type, must be 'iso' or 'network'" | tee $setup_log
exit 1 exit 1
;; ;;
esac esac
@@ -67,8 +74,6 @@ esac
# Allow execution of SO tools during setup # Allow execution of SO tools during setup
export PATH=$PATH:../salt/common/tools/sbin export PATH=$PATH:../salt/common/tools/sbin
date -u > $setup_log 2>&1
got_root got_root
if [[ $# -gt 1 ]]; then if [[ $# -gt 1 ]]; then
@@ -87,7 +92,7 @@ setterm -blank 0
if [ "$setup_type" == 'iso' ] || (whiptail_you_sure); then if [ "$setup_type" == 'iso' ] || (whiptail_you_sure); then
true true
else else
echo "User cancelled setup." >> $setup_log 2>&1 echo "User cancelled setup." | tee $setup_log
whiptail_cancel whiptail_cancel
fi fi