[refactor] Add variable to whiptail functions for quiet install

This is an initial change to allow for automated installs and testing.
The variable `QUIET` is checked in all whiptail functions and they are
skipped if the variable is set.

Closes #526
This commit is contained in:
William Wernert
2020-04-07 15:24:36 -04:00
parent cf8c33ccea
commit 56326026b7

View File

@@ -15,8 +15,11 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
whiptail_basic_bro() {
[ -z "$QUIET" ] && return
BASICBRO=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the number of bro processes:" 10 75 $LBPROCS 3>&1 1>&2 2>&3)
@@ -27,6 +30,8 @@ whiptail_basic_bro() {
whiptail_basic_suri() {
[ -z "$QUIET" ] && return
BASICSURI=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the number of Suricata Processes:" 10 75 $LBPROCS 3>&1 1>&2 2>&3)
@@ -37,7 +42,9 @@ whiptail_basic_suri() {
whiptail_bro_pins() {
BROPINS=$(whiptail --noitem --title "Pin Bro CPUS" --checklist "Please Select $LBPROCS cores to pin Bro to:" 20 75 12 ${LISTCORES[@]} 3>&1 1>&2 2>&3 )
[ -z "$QUIET" ] && return
BROPINS=$(whiptail --noitem --title "Pin Bro CPUS" --checklist "Please Select $LBPROCS cores to pin Bro to:" 20 75 12 "${LISTCORES[@]}" 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
@@ -46,6 +53,8 @@ whiptail_bro_pins() {
whiptail_bro_version() {
[ -z "$QUIET" ] && return
BROVERSION=$(whiptail --title "Security Onion Setup" --radiolist "What tool would you like to use to generate meta data?" 20 75 4 "ZEEK" "Install Zeek (aka Bro)" ON \
"SURICATA" "SUPER EXPERIMENTAL" OFF 3>&1 1>&2 2>&3)
@@ -56,18 +65,20 @@ whiptail_bro_version() {
whiptail_bond_nics() {
[ -z "$QUIET" ] && return
local nic_list=()
for FNIC in ${FNICS[@]}; do
nic_list+=($FNIC "Interface" "OFF")
for FNIC in "${FNICS[@]}"; do
nic_list+=("$FNIC" "Interface" "OFF")
done
BNICS=$(whiptail --title "NIC Setup" --checklist "Please add NICs to the Monitor Interface" 20 75 12 ${nic_list[@]} 3>&1 1>&2 2>&3 )
BNICS=$(whiptail --title "NIC Setup" --checklist "Please add NICs to the Monitor Interface" 20 75 12 "${nic_list[@]}" 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
while [ -z "$BNICS" ]
do
BNICS=$(whiptail --title "NIC Setup" --checklist "Please add NICs to the Monitor Interface" 20 75 12 ${nic_list[@]} 3>&1 1>&2 2>&3 )
BNICS=$(whiptail --title "NIC Setup" --checklist "Please add NICs to the Monitor Interface" 20 75 12 "${nic_list[@]}" 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
done
@@ -76,6 +87,8 @@ whiptail_bond_nics() {
whiptail_bond_nics_mtu() {
[ -z "$QUIET" ] && return
# Set the MTU on the monitor interface
MTU=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the MTU for the monitor NICs" 10 75 1500 3>&1 1>&2 2>&3)
@@ -99,7 +112,7 @@ whiptail_cancel() {
whiptail_check_exitstatus() {
if [ $1 == '1' ]; then
if [ "$1" == '1' ]; then
echo "They hit cancel"
whiptail_cancel
fi
@@ -108,6 +121,8 @@ whiptail_check_exitstatus() {
whiptail_create_admin_user() {
[ -z "$QUIET" ] && return
ADMINUSER=$(whiptail --title "Security Onion Install" --inputbox \
"Please enter a username for your new admin user. The onion account will be disabled during this install" 10 60 3>&1 1>&2 2>&3)
@@ -115,6 +130,8 @@ whiptail_create_admin_user() {
whiptail_create_admin_user_password1() {
[ -z "$QUIET" ] && return
ADMINPASS1=$(whiptail --title "Security Onion Install" --passwordbox \
"Enter a password for $ADMINUSER" 10 60 3>&1 1>&2 2>&3)
@@ -124,6 +141,8 @@ whiptail_create_admin_user_password1() {
whiptail_create_admin_user_password2() {
[ -z "$QUIET" ] && return
ADMINPASS2=$(whiptail --title "Security Onion Install" --passwordbox \
"Re-enter a password for $ADMINUSER" 10 60 3>&1 1>&2 2>&3)
@@ -134,12 +153,16 @@ whiptail_create_admin_user_password2() {
whiptail_create_soremote_user() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Set a password for the soremote user. This account is used for adding sensors remotely." 8 75
}
whiptail_create_soremote_user_password1() {
[ -z "$QUIET" ] && return
SOREMOTEPASS1=$(whiptail --title "Security Onion Install" --passwordbox \
"Enter a password for user soremote" 10 75 3>&1 1>&2 2>&3)
@@ -150,6 +173,8 @@ whiptail_create_soremote_user_password1() {
whiptail_create_soremote_user_password2() {
[ -z "$QUIET" ] && return
SOREMOTEPASS2=$(whiptail --title "Security Onion Install" --passwordbox \
"Re-enter a password for user soremote" 10 75 3>&1 1>&2 2>&3)
@@ -160,6 +185,8 @@ whiptail_create_soremote_user_password2() {
whiptail_create_web_user() {
[ -z "$QUIET" ] && return
WEBUSER=$(whiptail --title "Security Onion Install" --inputbox \
"Please enter an email address to create an administrator account for the web interface." 10 60 3>&1 1>&2 2>&3)
@@ -168,11 +195,16 @@ whiptail_create_web_user() {
}
whiptail_invalid_user_warning() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Please enter a valid email address." 8 75
}
whiptail_create_web_user_password1() {
[ -z "$QUIET" ] && return
WEBPASSWD1=$(whiptail --title "Security Onion Install" --passwordbox \
"Enter a password for $WEBUSER" 10 60 3>&1 1>&2 2>&3)
@@ -182,6 +214,8 @@ whiptail_create_web_user_password1() {
whiptail_create_web_user_password2() {
[ -z "$QUIET" ] && return
WEBPASSWD2=$(whiptail --title "Security Onion Install" --passwordbox \
"Re-enter a password for $WEBUSER" 10 60 3>&1 1>&2 2>&3)
@@ -191,11 +225,16 @@ whiptail_create_web_user_password2() {
}
whiptail_invalid_pass_warning() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Please choose a more secure password." 8 75
}
whiptail_cur_close_days() {
[ -z "$QUIET" ] && return
CURCLOSEDAYS=$(whiptail --title "Security Onion Setup" --inputbox \
"Please specify the threshold (in days) at which Elasticsearch indices will be closed" 10 75 $CURCLOSEDAYS 3>&1 1>&2 2>&3)
@@ -206,6 +245,8 @@ whiptail_cur_close_days() {
whiptail_dhcp_or_static() {
[ -z "$QUIET" ] && return
ADDRESSTYPE=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose how to set up your management interface:" 20 78 4 \
"STATIC" "Set a static IPv4 address" ON \
@@ -216,6 +257,9 @@ whiptail_dhcp_or_static() {
}
whiptail_enable_components() {
[ -z "$QUIET" ] && return
COMPONENTS=$(whiptail --title "Security Onion Setup" --checklist \
"Select Components to install" 20 75 8 \
"GRAFANA" "Enable Grafana for system monitoring" ON \
@@ -231,6 +275,9 @@ whiptail_enable_components() {
}
whiptail_eval_adv() {
[ -z "$QUIET" ] && return
EVALADVANCED=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose your eval install:" 20 75 4 \
"BASIC" "Install basic components for evaluation" ON \
@@ -241,10 +288,16 @@ whiptail_eval_adv() {
}
whiptail_eval_adv_warning() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Please keep in mind the more services that you enable the more RAM that is required." 8 75
}
whiptail_helix_apikey() {
[ -z "$QUIET" ] && return
HELIXAPIKEY=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your Helix API Key: \n \nThis can be set later using so-helix-apikey" 10 75 3>&1 1>&2 2>&3)
@@ -255,6 +308,8 @@ whiptail_helix_apikey() {
whiptail_homenet_master() {
[ -z "$QUIET" ] && return
# Ask for the HOME_NET on the master
HNMASTER=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your HOME_NET separated by ," 10 75 10.0.0.0/8,192.168.0.0/16,172.16.0.0/12 3>&1 1>&2 2>&3)
@@ -266,6 +321,8 @@ whiptail_homenet_master() {
whiptail_homenet_sensor() {
[ -z "$QUIET" ] && return
# Ask to inherit from master
whiptail --title "Security Onion Setup" --yesno "Do you want to inherit the HOME_NET from the Master?" 8 75
@@ -283,6 +340,8 @@ whiptail_homenet_sensor() {
whiptail_install_type() {
[ -z "$QUIET" ] && return
# What kind of install are we doing?
INSTALLTYPE=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose Install Type:" 20 75 13 \
@@ -307,6 +366,8 @@ whiptail_install_type() {
whiptail_log_size_limit() {
[ -z "$QUIET" ] && return
LOG_SIZE_LIMIT=$(whiptail --title "Security Onion Setup" --inputbox \
"Please specify the amount of disk space (in GB) you would like to allocate for Elasticsearch data storage. \
By default, this is set to 85% of the disk space allotted for /nsm." 10 75 $LOG_SIZE_LIMIT 3>&1 1>&2 2>&3)
@@ -318,6 +379,8 @@ whiptail_log_size_limit() {
whiptail_management_interface_dns() {
[ -z "$QUIET" ] && return
MDNS=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your DNS server using space between multiple" 10 60 8.8.8.8 8.8.4.4 3>&1 1>&2 2>&3)
@@ -325,6 +388,8 @@ whiptail_management_interface_dns() {
whiptail_management_interface_dns_search() {
[ -z "$QUIET" ] && return
MSEARCH=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your DNS search domain" 10 60 searchdomain.local 3>&1 1>&2 2>&3)
@@ -332,6 +397,8 @@ whiptail_management_interface_dns_search() {
whiptail_management_interface_gateway() {
[ -z "$QUIET" ] && return
MGATEWAY=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your gateway" 10 60 X.X.X.X 3>&1 1>&2 2>&3)
@@ -339,6 +406,8 @@ whiptail_management_interface_gateway() {
whiptail_management_interface_ip() {
[ -z "$QUIET" ] && return
MIP=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your IP address" 10 60 X.X.X.X 3>&1 1>&2 2>&3)
@@ -346,6 +415,8 @@ whiptail_management_interface_ip() {
whiptail_management_interface_mask() {
[ -z "$QUIET" ] && return
MMASK=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the bit mask for your subnet" 10 60 24 3>&1 1>&2 2>&3)
@@ -353,13 +424,15 @@ whiptail_management_interface_mask() {
whiptail_management_nic() {
MNIC=$(whiptail --title "NIC Setup" --radiolist "Please select your management NIC" 20 75 12 ${NICS[@]} 3>&1 1>&2 2>&3 )
[ -z "$QUIET" ] && return
MNIC=$(whiptail --title "NIC Setup" --radiolist "Please select your management NIC" 20 75 12 "${NICS[@]}" 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
while [ -z "$MNIC" ]
do
MNIC=$(whiptail --title "NIC Setup" --radiolist "Please select your management NIC" 20 75 12 ${NICS[@]} 3>&1 1>&2 2>&3 )
MNIC=$(whiptail --title "NIC Setup" --radiolist "Please select your management NIC" 20 75 12 "${NICS[@]}" 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
done
@@ -368,6 +441,8 @@ whiptail_management_nic() {
whiptail_nids() {
[ -z "$QUIET" ] && return
NIDS=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose which IDS to run:" 20 75 4 \
"Suricata" "Suricata 4.X" ON \
@@ -380,6 +455,8 @@ whiptail_nids() {
whiptail_oinkcode() {
[ -z "$QUIET" ] && return
OINKCODE=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your oinkcode" 10 75 XXXXXXX 3>&1 1>&2 2>&3)
@@ -390,6 +467,8 @@ whiptail_oinkcode() {
whiptail_make_changes() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --yesno "We are going to set this machine up as a $INSTALLTYPE. Please hit YES to make changes or NO to cancel." 8 75
local exitstatus=$?
@@ -399,6 +478,8 @@ whiptail_make_changes() {
whiptail_management_server() {
[ -z "$QUIET" ] && return
MSRV=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter your Master Server HOSTNAME. It is CASE SENSITIVE!" 10 75 XXXX 3>&1 1>&2 2>&3)
@@ -417,6 +498,8 @@ whiptail_management_server() {
# Ask if you want to do advanced setup of the Master
whiptail_master_adv() {
[ -z "$QUIET" ] && return
MASTERADV=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose what type of master install:" 20 75 4 \
"BASIC" "Install master with recommended settings" ON \
@@ -430,6 +513,8 @@ whiptail_master_adv() {
# Ask which additional components to install
whiptail_master_adv_service_brologs() {
[ -z "$QUIET" ] && return
BLOGS=$(whiptail --title "Security Onion Setup" --checklist "Please Select Logs to Send:" 24 75 12 \
"conn" "Connection Logging" ON \
"dce_rpc" "RPC Logs" ON \
@@ -477,6 +562,8 @@ whiptail_master_adv_service_brologs() {
whiptail_network_notice() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --yesno "Since this is a network install we assume the management interface, DNS, Hostname, etc are already set up. Hit YES to continue." 8 75
local exitstatus=$?
@@ -486,6 +573,8 @@ whiptail_network_notice() {
whiptail_node_advanced() {
[ -z "$QUIET" ] && return
NODESETUP=$(whiptail --title "Security Onion Setup" --radiolist \
"What type of config would you like to use?:" 20 75 4 \
"NODEBASIC" "Install Search Node with recommended settings" ON \
@@ -498,6 +587,8 @@ whiptail_node_advanced() {
whiptail_node_es_heap() {
[ -z "$QUIET" ] && return
es_heapsize
NODE_ES_HEAP_SIZE=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter ES Heap Size: \n \n(Recommended value is pre-populated)" 10 75 $ES_HEAP_SIZE 3>&1 1>&2 2>&3)
@@ -509,6 +600,8 @@ whiptail_node_es_heap() {
whiptail_node_ls_heap() {
[ -z "$QUIET" ] && return
ls_heapsize
NODE_LS_HEAP_SIZE=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter LogStash Heap Size: \n \n(Recommended value is pre-populated)" 10 75 $LS_HEAP_SIZE 3>&1 1>&2 2>&3)
@@ -520,6 +613,8 @@ whiptail_node_ls_heap() {
whiptail_node_ls_pipeline_worker() {
[ -z "$QUIET" ] && return
LSPIPELINEWORKERS=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter LogStash Pipeline Workers: \n \n(Recommended value is pre-populated)" 10 75 $CPUCORES 3>&1 1>&2 2>&3)
@@ -530,6 +625,8 @@ whiptail_node_ls_pipeline_worker() {
whiptail_node_ls_pipline_batchsize() {
[ -z "$QUIET" ] && return
LSPIPELINEBATCH=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter LogStash Pipeline Batch Size: \n \n(Default value is pre-populated)" 10 75 125 3>&1 1>&2 2>&3)
@@ -540,6 +637,8 @@ whiptail_node_ls_pipline_batchsize() {
whiptail_node_ls_input_threads() {
[ -z "$QUIET" ] && return
LSINPUTTHREADS=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter LogStash Input Threads: \n \n(Default value is pre-populated)" 10 75 1 3>&1 1>&2 2>&3)
@@ -550,6 +649,8 @@ whiptail_node_ls_input_threads() {
whiptail_node_ls_input_batch_count() {
[ -z "$QUIET" ] && return
LSINPUTBATCHCOUNT=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter LogStash Input Batch Count: \n \n(Default value is pre-populated)" 10 75 125 3>&1 1>&2 2>&3)
@@ -560,12 +661,16 @@ whiptail_node_ls_input_batch_count() {
whiptail_passwords_dont_match() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Passwords don't match. Please re-enter." 8 75
}
whiptail_patch_name_new_schedule() {
[ -z "$QUIET" ] && return
PATCHSCHEDULENAME=$(whiptail --title "Security Onion Setup" --inputbox \
"What name do you want to give this OS patch schedule? This schedule needs to be named uniquely. Available schedules can be found on the master under /opt/so/salt/patch/os/schedules/<schedulename>.yml" 10 75 3>&1 1>&2 2>&3)
@@ -585,6 +690,8 @@ whiptail_patch_name_new_schedule() {
whiptail_patch_schedule() {
[ -z "$QUIET" ] && return
# What kind of patch schedule are we doing?
PATCHSCHEDULE=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose OS patch schedule. This will NOT update Security Onion related tools such as Zeek, Elasticsearch, Kibana, SaltStack, etc." 15 75 5 \
@@ -600,6 +707,8 @@ whiptail_patch_schedule() {
whiptail_patch_schedule_import() {
[ -z "$QUIET" ] && return
unset PATCHSCHEDULENAME
PATCHSCHEDULENAME=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the name of the OS patch schedule you want to inherit. Available schedules can be found on the master under /opt/so/salt/patch/os/schedules/<schedulename>.yml" 10 75 3>&1 1>&2 2>&3)
@@ -619,8 +728,11 @@ whiptail_patch_schedule_import() {
}
whiptail_patch_schedule_select_days() {
[ -z "$QUIET" ] && return
# Select the days to patch
PATCHSCHEDULEDAYS=($(whiptail --title "Security Onion Setup" --checklist \
mapfile -t PATCHSCHEDULEDAYS< <(whiptail --title "Security Onion Setup" --checklist \
"Which days do you want to apply OS patches?" 15 75 8 \
"Monday" "" OFF \
"Tuesday" "" ON \
@@ -628,15 +740,18 @@ whiptail_patch_schedule_select_days() {
"Thursday" "" OFF \
"Friday" "" OFF \
"Saturday" "" OFF \
"Sunday" "" OFF 3>&1 1>&2 2>&3 ))
"Sunday" "" OFF 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
}
whiptail_patch_schedule_select_hours() {
[ -z "$QUIET" ] && return
# Select the hours to patch
PATCHSCHEDULEHOURS=($(whiptail --title "Security Onion Setup" --checklist \
mapfile -t PATCHSCHEDULEHOURS< <(whiptail --title "Security Onion Setup" --checklist \
"At which time, UTC, do you want to apply OS patches on the selected days? Hours 12 through 23 can be selected on the next screen." 22 75 13 \
"00:00" "" OFF \
"01:00" "" OFF \
@@ -649,13 +764,13 @@ whiptail_patch_schedule_select_hours() {
"08:00" "" OFF \
"09:00" "" OFF \
"10:00" "" OFF \
"11:00" "" OFF 3>&1 1>&2 2>&3 ))
"11:00" "" OFF 3>&1 1>&2 2>&3 )
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
# Select the hours to patch
PATCHSCHEDULEHOURS+=($(whiptail --title "Security Onion Setup" --checklist \
mapfile -t second_half < <(whiptail --title "Security Onion Setup" --checklist \
"At which time, UTC, do you want to apply OS patches on the selected days?" 22 75 13 \
"12:00" "" OFF \
"13:00" "" OFF \
@@ -668,7 +783,9 @@ whiptail_patch_schedule_select_hours() {
"20:00" "" OFF \
"21:00" "" OFF \
"22:00" "" OFF \
"23:00" "" OFF 3>&1 1>&2 2>&3 ))
"23:00" "" OFF 3>&1 1>&2 2>&3 )
PATCHSCHEDULEHOURS+=("${second_half[@]}")
local exitstatus=$?
whiptail_check_exitstatus $exitstatus
@@ -676,6 +793,8 @@ whiptail_patch_schedule_select_hours() {
whiptail_rule_setup() {
[ -z "$QUIET" ] && return
# Get pulled pork info
RULESETUP=$(whiptail --title "Security Onion Setup" --radiolist \
"Which IDS ruleset would you like to use?\n\nThis master server is responsible for downloading the IDS ruleset from the Internet.\n\nSensors then pull a copy of this ruleset from the master server.\n\nIf you select a commercial ruleset, it is your responsibility to purchase enough licenses for all of your sensors in compliance with your vendor's policies." 20 75 4 \
@@ -692,6 +811,8 @@ whiptail_rule_setup() {
whiptail_sensor_config() {
[ -z "$QUIET" ] && return
NSMSETUP=$(whiptail --title "Security Onion Setup" --radiolist \
"What type of configuration would you like to use?:" 20 75 4 \
"BASIC" "Install NSM components with recommended settings" ON \
@@ -704,6 +825,8 @@ whiptail_sensor_config() {
whiptail_set_hostname() {
[ -z "$QUIET" ] && return
HOSTNAME=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the Hostname you would like to set." 10 75 $HOSTNAME 3>&1 1>&2 2>&3)
@@ -721,6 +844,9 @@ whiptail_set_hostname() {
}
whiptail_set_redirect() {
[ -z "$QUIET" ] && return
REDIRECTINFO=$(whiptail --title "Security Onion Setup" --radiolist \
"Choose the access method for the web interface:" 20 75 4 \
"IP" "Use IP to access the web interface" ON \
@@ -731,6 +857,9 @@ whiptail_set_redirect() {
}
whiptail_set_redirect_host() {
[ -z "$QUIET" ] && return
REDIRECTHOST=$(whiptail --title "Security Onion Setup" --inputbox \
"Enter the Hostname or IP you would like to use for the web interface." 10 75 $HOSTNAME 3>&1 1>&2 2>&3)
local exitstatus=$?
@@ -738,12 +867,17 @@ whiptail_set_redirect_host() {
}
whiptail_set_redirect_info() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "The following selection refers to accessing the web interface. \n
For security reasons, we use strict cookie enforcement." 10 75
}
whiptail_setup_complete() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Finished installing this as an $INSTALLTYPE. Press Enter to reboot." 8 75
install_cleanup >> $SETUPLOG 2>&1
@@ -751,6 +885,8 @@ whiptail_setup_complete() {
whiptail_setup_failed() {
[ -z "$QUIET" ] && return
whiptail --title "Security Onion Setup" --msgbox "Install had a problem. Please see $SETUPLOG for details. Press Enter to reboot." 8 75
install_cleanup >> $SETUPLOG 2>&1
@@ -758,6 +894,8 @@ whiptail_setup_failed() {
whiptail_shard_count() {
[ -z "$QUIET" ] && return
SHARDCOUNT=$(whiptail --title "Security Onion Setup" --inputbox \
"\nEnter ES Shard Count: \n \n(Default value is pre-populated)" 10 75 125 3>&1 1>&2 2>&3)
@@ -768,7 +906,9 @@ whiptail_shard_count() {
whiptail_suricata_pins() {
FILTEREDCORES=$(echo ${LISTCORES[@]} ${BROPINS[@]} | tr -d '"' | tr ' ' '\n' | sort | uniq -u | awk '{print $1 " \"" "core" "\""}')
[ -z "$QUIET" ] && return
FILTEREDCORES=$(echo "${LISTCORES[@]}" "${BROPINS[@]}" | tr -d '"' | tr ' ' '\n' | sort | uniq -u | awk '{print $1 " \"" "core" "\""}')
SURIPINS=$(whiptail --noitem --title "Pin Suricata CPUS" --checklist "Please Select $LBPROCS cores to pin Suricata to:" 20 75 12 ${FILTEREDCORES[@]} 3>&1 1>&2 2>&3 )
local exitstatus=$?
@@ -778,6 +918,8 @@ whiptail_suricata_pins() {
whiptail_master_updates() {
[ -z "$QUIET" ] && return
MASTERUPDATES=$(whiptail --title "Security Onion Setup" --radiolist \
"How would you like to download updates for your grid?:" 20 75 4 \
"MASTER" "Master node is proxy for OS/Docker updates." ON \
@@ -790,6 +932,8 @@ whiptail_master_updates() {
whiptail_node_updates() {
[ -z "$QUIET" ] && return
NODEUPDATES=$(whiptail --title "Security Onion Setup" --radiolist \
"How would you like to download updates for this node?:" 20 75 4 \
"MASTER" "Download OS/Docker updates from the Master." ON \
@@ -802,6 +946,8 @@ whiptail_node_updates() {
whiptail_you_sure() {
[ -z "$QUIET" ] && return
echo "whiptail_you_sure called" >> $SETUPLOG 2>&1
whiptail --title "Security Onion Setup" --yesno "Are you sure you want to install Security Onion over the internet?" 8 75