mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 10:12:53 +01:00
Fleet standalone fixes
This commit is contained in:
@@ -246,6 +246,10 @@ check_soremote_pass() {
|
|||||||
check_pass_match "$SOREMOTEPASS1" "$SOREMOTEPASS2" "SCMATCH"
|
check_pass_match "$SOREMOTEPASS1" "$SOREMOTEPASS2" "SCMATCH"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_fleet_node_pass() {
|
||||||
|
check_pass_match "$FLEETNODEPASSWD1" "$FLEETNODEPASSWD2" "fpMATCH"
|
||||||
|
}
|
||||||
|
|
||||||
check_web_pass() {
|
check_web_pass() {
|
||||||
check_pass_match "$WEBPASSWD1" "$WEBPASSWD2" "WPMATCH"
|
check_pass_match "$WEBPASSWD1" "$WEBPASSWD2" "WPMATCH"
|
||||||
}
|
}
|
||||||
@@ -283,6 +287,30 @@ collect_adminuser_inputs() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
collect_fleetuser_inputs() {
|
||||||
|
# Get a username & password for the Fleet admin user
|
||||||
|
local valid_user=no
|
||||||
|
while [[ $valid_user != yes ]]; do
|
||||||
|
whiptail_create_fleet_node_user
|
||||||
|
if so-user valemail "$FLEETNODEUSER" >> "$setup_log" 2>&1; then
|
||||||
|
valid_user=yes
|
||||||
|
else
|
||||||
|
whiptail_invalid_user_warning
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
FPMATCH=no
|
||||||
|
while [[ $FPMATCH != yes ]]; do
|
||||||
|
whiptail_create_fleet_node_user_password1
|
||||||
|
if echo "$FLEETNODEPASSWD1" | so-user valpass >> "$setup_log" 2>&1; then
|
||||||
|
whiptail_create_fleet_node_user_password2
|
||||||
|
check_fleet_node_pass
|
||||||
|
else
|
||||||
|
whiptail_invalid_pass_warning
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
collect_webuser_inputs() {
|
collect_webuser_inputs() {
|
||||||
# Get a password for the web admin user
|
# Get a password for the web admin user
|
||||||
|
|||||||
@@ -482,8 +482,15 @@ fi
|
|||||||
set_progress_str 73 "$(print_salt_state_apply 'redis')"
|
set_progress_str 73 "$(print_salt_state_apply 'redis')"
|
||||||
salt-call state.apply -l info redis >> $setup_log 2>&1
|
salt-call state.apply -l info redis >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 74 "$(print_salt_state_apply 'so-fleet-setup')"
|
if [ "$install_type" = 'FLEET' ]; then
|
||||||
so-fleet-setup $WEBUSER $WEBPASSWD1 >> $setup_log 2>&1
|
collect_fleetuser_inputs
|
||||||
|
set_progress_str 74 "$(print_salt_state_apply 'so-fleet-setup')"
|
||||||
|
so-fleet-setup $FLEETNODEUSER $FLEETNODEPASSWD1 >> $setup_log 2>&1
|
||||||
|
else
|
||||||
|
set_progress_str 74 "$(print_salt_state_apply 'so-fleet-setup')"
|
||||||
|
so-fleet-setup $WEBUSER $WEBPASSWD1 >> $setup_log 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$WAZUH" = 1 ]]; then
|
if [[ "$WAZUH" = 1 ]]; then
|
||||||
|
|||||||
@@ -165,6 +165,38 @@ whiptail_create_admin_user_password2() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
whiptail_create_fleet_node_user() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
|
FLEETNODEUSER=$(whiptail --title "Security Onion Install" --inputbox \
|
||||||
|
"Please enter an email as the username for the Fleet admin user." 10 60 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
whiptail_create_fleet_node_user_password1() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
|
FLEETNODEPASS1=$(whiptail --title "Security Onion Install" --passwordbox \
|
||||||
|
"Enter a password for $FLEETNODEUSER" 10 60 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
local exitstatus=$?
|
||||||
|
whiptail_check_exitstatus $exitstatus
|
||||||
|
}
|
||||||
|
|
||||||
|
whiptail_create_fleet_node_user_password2() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
|
FLEETNODEPASS2=$(whiptail --title "Security Onion Install" --passwordbox \
|
||||||
|
"Re-enter a password for $FLEETNODEUSER" 10 60 3>&1 1>&2 2>&3)
|
||||||
|
|
||||||
|
local exitstatus=$?
|
||||||
|
whiptail_check_exitstatus $exitstatus
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
whiptail_create_soremote_user() {
|
whiptail_create_soremote_user() {
|
||||||
|
|
||||||
[ -n "$TESTING" ] && return
|
[ -n "$TESTING" ] && return
|
||||||
|
|||||||
Reference in New Issue
Block a user