mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Validate email and password for the webuser during install
This commit is contained in:
@@ -745,7 +745,8 @@ get_main_ip() {
|
||||
get_redirect() {
|
||||
whiptail_set_redirect_info
|
||||
whiptail_set_redirect
|
||||
if [ $REDIRECTINFO == 'OTHER' ]; then
|
||||
echo "REDIRECTINFO=$REDIRECTINFO"
|
||||
if [ "$REDIRECTINFO" == "OTHER" ]; then
|
||||
whiptail_set_redirect_host
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -29,6 +29,9 @@ else
|
||||
INSTALLMETHOD="network"
|
||||
fi
|
||||
|
||||
# Allow execution of SO tools during setup
|
||||
export PATH=$PATH:../salt/common/tools/sbin
|
||||
|
||||
# Global Variables
|
||||
HOSTNAME=$(cat /etc/hostname)
|
||||
TOTAL_MEM=`grep MemTotal /proc/meminfo | awk '{print $2}' | sed -r 's/.{3}$//'`
|
||||
@@ -141,7 +144,7 @@ if (whiptail_you_sure) ; then
|
||||
if [ $INSTALLTYPE == 'HELIXSENSOR' ]; then
|
||||
MASTERUPDATES=OPEN
|
||||
filter_unused_nics
|
||||
whiptail_bond_nics
|
||||
[[ $SKIP_BOND == no ]] && whiptail_bond_nics
|
||||
whiptail_helix_apikey
|
||||
whiptail_homenet_master
|
||||
RULESETUP=ETOPEN
|
||||
@@ -244,6 +247,32 @@ if (whiptail_you_sure) ; then
|
||||
|
||||
fi
|
||||
|
||||
function collect_webuser_inputs() {
|
||||
# Get a password for the web admin user
|
||||
VALIDUSER=no
|
||||
while [ $VALIDUSER != yes ]; do
|
||||
whiptail_create_web_user
|
||||
so-user valemail "$WEBUSER"
|
||||
if [ $? == 0 ]; then
|
||||
VALIDUSER=yes
|
||||
else
|
||||
whiptail_invalid_user_warning
|
||||
fi
|
||||
done
|
||||
|
||||
WPMATCH=no
|
||||
while [ $WPMATCH != yes ]; do
|
||||
whiptail_create_web_user_password1
|
||||
echo "$WEBPASSWD1" | so-user valpass
|
||||
if [ $? == 0 ]; then
|
||||
whiptail_create_web_user_password2
|
||||
check_web_pass
|
||||
else
|
||||
whiptail_invalid_pass_warning
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
####################
|
||||
## Master ##
|
||||
####################
|
||||
@@ -292,14 +321,7 @@ if (whiptail_you_sure) ; then
|
||||
check_soremote_pass
|
||||
done
|
||||
|
||||
# Get a password for the web admin user
|
||||
whiptail_create_web_user
|
||||
WPMATCH=no
|
||||
while [ $WPMATCH != yes ]; do
|
||||
whiptail_create_web_user_password1
|
||||
whiptail_create_web_user_password2
|
||||
check_web_pass
|
||||
done
|
||||
collect_webuser_inputs
|
||||
get_redirect
|
||||
# Last Chance to back out
|
||||
whiptail_make_changes
|
||||
@@ -446,7 +468,7 @@ if (whiptail_you_sure) ; then
|
||||
|
||||
if [ $INSTALLTYPE == 'SENSOR' ]; then
|
||||
filter_unused_nics
|
||||
whiptail_bond_nics
|
||||
[[ $SKIP_BOND == no ]] && whiptail_bond_nics
|
||||
whiptail_management_server
|
||||
whiptail_master_updates
|
||||
set_updates
|
||||
@@ -537,7 +559,7 @@ if (whiptail_you_sure) ; then
|
||||
if [ $INSTALLTYPE == 'EVAL' ]; then
|
||||
TYPE='eval'
|
||||
# Select which NICs are in the bond
|
||||
whiptail_bond_nics
|
||||
[[ $SKIP_BOND == no ]] && whiptail_bond_nics
|
||||
elif [ $INSTALLTYPE == 'MASTERSEARCH' ]; then
|
||||
TYPE='mastersearch'
|
||||
fi
|
||||
@@ -575,14 +597,7 @@ if (whiptail_you_sure) ; then
|
||||
check_soremote_pass
|
||||
done
|
||||
fi
|
||||
# Get a password for the web admin user
|
||||
whiptail_create_web_user
|
||||
WPMATCH=no
|
||||
while [ $WPMATCH != yes ]; do
|
||||
whiptail_create_web_user_password1
|
||||
whiptail_create_web_user_password2
|
||||
check_web_pass
|
||||
done
|
||||
collect_webuser_inputs
|
||||
get_redirect
|
||||
whiptail_make_changes
|
||||
set_hostname
|
||||
@@ -834,7 +849,7 @@ if (whiptail_you_sure) ; then
|
||||
if [ $INSTALLTYPE == 'HEAVYNODE' ]; then
|
||||
|
||||
filter_unused_nics
|
||||
whiptail_bond_nics
|
||||
[[ $SKIP_BOND == no ]] && whiptail_bond_nics
|
||||
whiptail_management_server
|
||||
whiptail_master_updates
|
||||
set_updates
|
||||
|
||||
@@ -163,8 +163,13 @@ whiptail_create_web_user() {
|
||||
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)
|
||||
|
||||
local exitstatus=$?
|
||||
whiptail_check_exitstatus $exitstatus
|
||||
}
|
||||
|
||||
whiptail_invalid_user_warning() {
|
||||
whiptail --title "Security Onion Setup" --msgbox "Please enter a valid email address." 8 75
|
||||
}
|
||||
|
||||
whiptail_create_web_user_password1() {
|
||||
|
||||
@@ -185,6 +190,9 @@ whiptail_create_web_user_password2() {
|
||||
|
||||
}
|
||||
|
||||
whiptail_invalid_pass_warning() {
|
||||
whiptail --title "Security Onion Setup" --msgbox "Please choose a more secure password." 8 75
|
||||
}
|
||||
|
||||
whiptail_cur_close_days() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user