IDH - Final setup fixes

This commit is contained in:
Josh Brower
2022-02-19 21:01:48 -05:00
parent 780cd38adf
commit 2203e2fedd
13 changed files with 32 additions and 25 deletions

View File

@@ -462,7 +462,6 @@ collect_idh_services() {
;;
'Custom')
whiptail_idh_services_custom
echo $idh_services
;;
esac
}
@@ -884,6 +883,7 @@ check_requirements() {
req_cores=4
if [[ "$node_type" == 'sensor' ]]; then req_nics=2; else req_nics=1; fi
if [[ "$node_type" == 'fleet' ]]; then req_mem=4; fi
if [[ "$node_type" == 'idh' ]]; then req_mem=1 req_cores=2; fi
elif [[ "$standalone_or_dist" == 'import' ]]; then
req_mem=4
req_cores=2
@@ -2850,12 +2850,13 @@ wait_for_salt_minion() {
}
write_out_idh_services() {
local pillar_file="$temp_install_dir"/pillar/minions/"$MINION_ID".sls
printf '%s\n'\
"idh:"\
" opencanary:"\
" config:" >> "$minion_config"
" services:" >> "$pillar_file"
for service in ${idh_services[@]}; do
echo " - $service" >> "$minion_config"
echo " - $service" | tr '[:upper:]' '[:lower:]' >> "$pillar_file"
done
}

View File

@@ -280,6 +280,8 @@ if ! [[ -f $install_opt_file ]]; then
check_requirements "standalone"
elif [[ $is_fleet_standalone ]]; then
check_requirements "dist" "fleet"
elif [[ $is_idh ]]; then
check_requirements "dist" "idh"
elif [[ $is_sensor && ! $is_eval ]]; then
check_requirements "dist" "sensor"
elif [[ $is_distmanager || $is_minion ]] && [[ ! $is_import ]]; then
@@ -750,6 +752,12 @@ echo "1" > /root/accept_changes
logstash_pillar >> $setup_log 2>&1
fi
if [[ $is_idh ]]; then
# Write out services to minion pillar file
set_progress_str 19 'Generating IDH services pillar'
write_out_idh_services
fi
if [[ $is_minion ]]; then
set_progress_str 20 'Accepting Salt key on manager'
@@ -919,9 +927,6 @@ echo "1" > /root/accept_changes
fi
if [[ $is_idh ]]; then
# Write out services to minion pillar file
write_out_idh_services
set_progress_str 79 "$(print_salt_state_apply 'idh')"
salt-call state.apply -l info idh >> $setup_log 2>&1

View File

@@ -432,6 +432,14 @@ whiptail_end_settings() {
Hostname: $HOSTNAME
EOM
if [[ $is_idh ]]; then
__append_end_msg "IDH Services Enabled:"
for service in ${idh_services[@]}; do
__append_end_msg "- $service"
done
fi
[[ -n $NODE_DESCRIPTION ]] && __append_end_msg "Description: $NODE_DESCRIPTION"
[[ $is_airgap ]] && __append_end_msg "Airgap: True"
@@ -832,14 +840,12 @@ whiptail_install_type_dist_existing() {
local node_msg
read -r -d '' node_msg <<- EOM
Choose a distributed node type to join to an existing grid.
See https://docs.securityonion.net/architecture for details.
Choose a distributed node type to join to an existing grid. See https://docs.securityonion.net/architecture for details.
Note: Heavy nodes (HEAVYNODE) are NOT recommended for most users.
EOM
install_type=$(whiptail --title "$whiptail_title" --radiolist "$node_msg" 19 58 5 \
install_type=$(whiptail --title "$whiptail_title" --radiolist "$node_msg" 19 58 6 \
"SENSOR" "Create a forward only sensor " ON \
"SEARCHNODE" "Add a search node with parsing " OFF \
"FLEET" "Dedicated Fleet Osquery Node " OFF \