Fix some installs

This commit is contained in:
Mike Reeves
2023-06-26 16:01:58 -04:00
parent b6986d5c61
commit 740723ecd6
4 changed files with 38 additions and 41 deletions

View File

@@ -26,7 +26,7 @@ if [ -f "$pillar_file" ]; then
echo "## _______________________________ ##" echo "## _______________________________ ##"
echo "## ##" echo "## ##"
echo "## Installing the Security Onion ##" echo "## Installing the Security Onion ##"
echo "## analyst node on this device will ##" echo "## Desktop node on this device will ##"
echo "## make permanent changes to ##" echo "## make permanent changes to ##"
echo "## the system. ##" echo "## the system. ##"
echo "## A system reboot will be required ##" echo "## A system reboot will be required ##"
@@ -42,7 +42,7 @@ if [ -f "$pillar_file" ]; then
done done
if [[ $INSTALL == "no" ]]; then if [[ $INSTALL == "no" ]]; then
echo "Exiting analyst node installation." echo "Exiting desktop node installation."
exit 0 exit 0
fi fi
@@ -55,7 +55,7 @@ if [ -f "$pillar_file" ]; then
echo "Applying the desktop state. This could take some time since there are many packages that need to be installed." echo "Applying the desktop state. This could take some time since there are many packages that need to be installed."
if salt-call state.apply desktop -linfo queue=True; then # make sure the state ran successfully if salt-call state.apply desktop -linfo queue=True; then # make sure the state ran successfully
echo "" echo ""
echo "Analyst desktop has been installed!" echo "Desktop desktop has been installed!"
echo "Press ENTER to reboot or Ctrl-C to cancel." echo "Press ENTER to reboot or Ctrl-C to cancel."
read pause read pause

View File

@@ -65,13 +65,13 @@ done
# Let's see what OS we are dealing with here # Let's see what OS we are dealing with here
detect_os detect_os
# Check to see if this is the setup type of "analyst". # Check to see if this is the setup type of "desktop".
is_analyst= is_desktop=
if [ "$setup_type" = 'analyst' ]; then if [ "$setup_type" = 'desktop' ]; then
is_analyst=true is_desktop=true
# Check to see if this is an ISO. Usually this dir on exists on ISO installs. # Check to see if this is an ISO. Usually this dir on exists on ISO installs.
if [ -d /root/SecurityOnion ]; then if [ -d /root/SecurityOnion ]; then
is_analyst_iso=true is_desktop_iso=true
fi fi
fi fi
@@ -86,19 +86,19 @@ if [[ "$setup_type" == 'iso' ]]; then
fi fi
fi fi
# Check to see if this is an analyst install. If it is let's run things differently # Check to see if this is an desktop install. If it is let's run things differently
if [[ $is_analyst ]]; then if [[ $is_desktop ]]; then
title "This is an analyst workstation install" title "This is an desktop workstation install"
# Make sure it's CentOS or Rocky Linux # Make sure it's CentOS or Rocky Linux
if [[ ! $is_centos ]]; then if [[ ! $is_rocky ]]; then
info "Analyst Workstation is only supported on CentOS 7 or Rocky Linux 8" info "Security Onion Desktop is only supported on Rocky Linux 9"
exit 1 exit 1
fi fi
if ! whiptail_analyst_install; then if ! whiptail_desktop_install; then
if [[ $is_analyst_iso ]]; then if [[ $is_desktop_iso ]]; then
if whiptail_analyst_nongrid_iso; then if whiptail_desktop_nongrid_iso; then
# Remove setup from auto launching # Remove setup from auto launching
parse_install_username parse_install_username
sed -i '$ d' /home/$INSTALLUSERNAME/.bash_profile >> "$setup_log" 2>&1 sed -i '$ d' /home/$INSTALLUSERNAME/.bash_profile >> "$setup_log" 2>&1
@@ -111,13 +111,13 @@ if [[ $is_analyst ]]; then
exit 0 exit 0
fi fi
else else
if whiptail_analyst_nongrid_network; then if whiptail_desktop_nongrid_network; then
info "" info ""
info "" info ""
info "Kicking off the automated setup of the analyst workstation. This can take a while depending on your network connection." info "Kicking off the automated setup of the Security Onion Desktop. This can take a while depending on your network connection."
info "" info ""
info "" info ""
analyst_salt_local desktop_salt_local
else else
# Abort! # Abort!
exit 0 exit 0
@@ -231,11 +231,11 @@ fi
# Make sure the setup type is suppoted. # Make sure the setup type is suppoted.
case "$setup_type" in case "$setup_type" in
iso | network | analyst) # Accepted values iso | network | desktop) # Accepted values
info "Beginning Security Onion $setup_type install" info "Beginning Security Onion $setup_type install"
;; ;;
*) *)
error "Invalid install type, must be 'iso', 'network' or 'analyst'." error "Invalid install type, must be 'iso', 'network' or 'desktop'."
fail_setup fail_setup
;; ;;
esac esac
@@ -277,11 +277,11 @@ if ! [[ -f $install_opt_file ]]; then
info "User cancelled setup." info "User cancelled setup."
whiptail_cancel whiptail_cancel
fi fi
# If this is an analyst install lets streamline the process. # If this is an desktop install lets streamline the process.
if [[ $is_analyst ]]; then if [[ $is_desktop ]]; then
# Prompt for hostname # Prompt for hostname
collect_hostname collect_hostname
if [[ $is_analyst_iso ]]; then if [[ $is_desktop_iso ]]; then
# Prompt Network Setup # Prompt Network Setup
whiptail_management_nic whiptail_management_nic
whiptail_dhcp_or_static whiptail_dhcp_or_static
@@ -294,7 +294,7 @@ if ! [[ -f $install_opt_file ]]; then
fi fi
fi fi
if [[ ! $is_analyst_iso ]]; then if [[ ! $is_desktop_iso ]]; then
# This should be a network install # This should be a network install
whiptail_network_notice whiptail_network_notice
# Warn about the dangers of DHCP # Warn about the dangers of DHCP
@@ -326,7 +326,7 @@ if ! [[ -f $install_opt_file ]]; then
true true
fi fi
fi fi
if [[ ! $is_analyst ]]; then if [[ ! $is_desktop ]]; then
whiptail_install_type whiptail_install_type
fi fi
else else

View File

@@ -27,15 +27,15 @@ whiptail_airgap() {
fi fi
} }
whiptail_analyst_install() { whiptail_desktop_install() {
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return
read -r -d '' message <<- EOM read -r -d '' message <<- EOM
Welcome to the Security Onion Analyst Workstation install! Welcome to the Security Onion Desktop install!
Would you like to join this workstation to an existing grid? Would you like to join this desktop to an existing grid?
EOM EOM
whiptail --title "$whiptail_title" \ whiptail --title "$whiptail_title" \
@@ -43,13 +43,13 @@ whiptail_analyst_install() {
} }
whiptail_analyst_nongrid_iso() { whiptail_desktop_nongrid_iso() {
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return
read -r -d '' message <<- EOM read -r -d '' message <<- EOM
You have selected this Analyst workstation to be independent. You have selected this Security Onion Desktop to be independent.
Would you still like to have the graphical interface loaded at boot? Would you still like to have the graphical interface loaded at boot?
@@ -61,13 +61,13 @@ whiptail_analyst_nongrid_iso() {
} }
whiptail_analyst_nongrid_network() { whiptail_desktop_nongrid_network() {
[ -n "$TESTING" ] && return [ -n "$TESTING" ] && return
read -r -d '' message <<- EOM read -r -d '' message <<- EOM
You have selected this Analyst workstation to be independent. You have selected this Security Onion Desktop to be independent.
Would you still like to install and load the graphical interface? Would you still like to install and load the graphical interface?
@@ -651,9 +651,9 @@ whiptail_install_type_dist_existing() {
is_import=true is_import=true
elif [ "$install_type" = 'RECEIVER' ]; then elif [ "$install_type" = 'RECEIVER' ]; then
is_receiver=true is_receiver=true
elif [ "$install_type" = 'ANALYST' ]; then elif [ "$install_type" = 'DESKTOP' ]; then
if [ "$setup_type" != 'analyst' ]; then if [ "$setup_type" != 'desktop' ]; then
exec bash so-setup analyst exec bash so-setup desktop
fi fi
fi fi
@@ -668,10 +668,7 @@ whiptail_install_type_other() {
install_type=$(whiptail --title "$whiptail_title" --menu \ install_type=$(whiptail --title "$whiptail_title" --menu \
"Choose node type:" 10 65 2 \ "Choose node type:" 10 65 2 \
"ANALYST" "Setup will run 'so-setup analyst' " \ "DESKTOP" "Setup will run 'so-setup desktop' " 3>&1 1>&2 2>&3)
"HELIXSENSOR" "Create a Helix sensor " \
3>&1 1>&2 2>&3
)
local exitstatus=$? local exitstatus=$?
whiptail_check_exitstatus $exitstatus whiptail_check_exitstatus $exitstatus

View File

@@ -8,4 +8,4 @@
cd "$(dirname "$0")/setup" || exit 255 cd "$(dirname "$0")/setup" || exit 255
./so-setup analyst "$@" ./so-setup desktop "$@"