[fix] Sensor needs to set up firewall before installing packages

This commit is contained in:
William Wernert
2020-05-13 12:43:20 -04:00
parent 36b16cd2fe
commit 8ce520317e
2 changed files with 8 additions and 6 deletions

View File

@@ -1130,7 +1130,7 @@ saltify() {
echo "Using apt-key add to add SALTSTACK-GPG-KEY.pub and GPG-KEY-WAZUH" >> "$setup_log" 2>&1 echo "Using apt-key add to add SALTSTACK-GPG-KEY.pub and GPG-KEY-WAZUH" >> "$setup_log" 2>&1
apt-key add "$temp_install_dir"/gpg/SALTSTACK-GPG-KEY.pub >> "$setup_log" 2>&1 apt-key add "$temp_install_dir"/gpg/SALTSTACK-GPG-KEY.pub >> "$setup_log" 2>&1
apt-key add "$temp_install_dir"/gpg/GPG-KEY-WAZUH >> "$setup_log" 2>&1 apt-key add "$temp_install_dir"/gpg/GPG-KEY-WAZUH >> "$setup_log" 2>&1
echo "deb http://repo.saltstack.com/apt/ubuntu/$ubuntu_version/amd64/2019.2 $OSVER main" > /etc/apt/sources.list.d/saltstack.list >> "$setup_log" 2>&1 echo "deb http://repo.saltstack.com$py_ver_url_path/ubuntu/$ubuntu_version/amd64/2019.2 $OSVER main" > /etc/apt/sources.list.d/saltstack.list >> "$setup_log" 2>&1
echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list >> "$setup_log" 2>&1 echo "deb https://packages.wazuh.com/3.x/apt/ stable main" | tee /etc/apt/sources.list.d/wazuh.list >> "$setup_log" 2>&1
;; ;;
esac esac

View File

@@ -282,7 +282,12 @@ export percentage=0
sensor_pillar >> "$setup_log" 2>&1 sensor_pillar >> "$setup_log" 2>&1
fi fi
set_progress_str 3 'Installing Salt and dependencies' if [[ $is_minion ]]; then
set_progress_str 3 'Configuring firewall'
set_initial_firewall_policy 2>> "$setup_log"
fi
set_progress_str 4 'Installing Salt and dependencies'
saltify 2>> "$setup_log" saltify 2>> "$setup_log"
set_progress_str 7 'Installing Docker and dependencies' set_progress_str 7 'Installing Docker and dependencies'
@@ -311,10 +316,7 @@ export percentage=0
master_pillar 2>> "$setup_log" master_pillar 2>> "$setup_log"
fi fi
if [[ $is_minion ]]; then
set_progress_str 14 'Configuring firewall'
set_initial_firewall_policy 2>> "$setup_log"
fi
set_progress_str 16 'Running first Salt checkin' set_progress_str 16 'Running first Salt checkin'
salt_firstcheckin 2>> "$setup_log" salt_firstcheckin 2>> "$setup_log"