mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Fix some installs
This commit is contained in:
@@ -26,7 +26,7 @@ if [ -f "$pillar_file" ]; then
|
||||
echo "## _______________________________ ##"
|
||||
echo "## ##"
|
||||
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 "## the system. ##"
|
||||
echo "## A system reboot will be required ##"
|
||||
@@ -42,7 +42,7 @@ if [ -f "$pillar_file" ]; then
|
||||
done
|
||||
|
||||
if [[ $INSTALL == "no" ]]; then
|
||||
echo "Exiting analyst node installation."
|
||||
echo "Exiting desktop node installation."
|
||||
exit 0
|
||||
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."
|
||||
if salt-call state.apply desktop -linfo queue=True; then # make sure the state ran successfully
|
||||
echo ""
|
||||
echo "Analyst desktop has been installed!"
|
||||
echo "Desktop desktop has been installed!"
|
||||
echo "Press ENTER to reboot or Ctrl-C to cancel."
|
||||
read pause
|
||||
|
||||
|
||||
@@ -65,13 +65,13 @@ done
|
||||
# Let's see what OS we are dealing with here
|
||||
detect_os
|
||||
|
||||
# Check to see if this is the setup type of "analyst".
|
||||
is_analyst=
|
||||
if [ "$setup_type" = 'analyst' ]; then
|
||||
is_analyst=true
|
||||
# Check to see if this is the setup type of "desktop".
|
||||
is_desktop=
|
||||
if [ "$setup_type" = 'desktop' ]; then
|
||||
is_desktop=true
|
||||
# Check to see if this is an ISO. Usually this dir on exists on ISO installs.
|
||||
if [ -d /root/SecurityOnion ]; then
|
||||
is_analyst_iso=true
|
||||
is_desktop_iso=true
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -86,19 +86,19 @@ if [[ "$setup_type" == 'iso' ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check to see if this is an analyst install. If it is let's run things differently
|
||||
if [[ $is_analyst ]]; then
|
||||
title "This is an analyst workstation install"
|
||||
# Check to see if this is an desktop install. If it is let's run things differently
|
||||
if [[ $is_desktop ]]; then
|
||||
title "This is an desktop workstation install"
|
||||
|
||||
# Make sure it's CentOS or Rocky Linux
|
||||
if [[ ! $is_centos ]]; then
|
||||
info "Analyst Workstation is only supported on CentOS 7 or Rocky Linux 8"
|
||||
if [[ ! $is_rocky ]]; then
|
||||
info "Security Onion Desktop is only supported on Rocky Linux 9"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! whiptail_analyst_install; then
|
||||
if [[ $is_analyst_iso ]]; then
|
||||
if whiptail_analyst_nongrid_iso; then
|
||||
if ! whiptail_desktop_install; then
|
||||
if [[ $is_desktop_iso ]]; then
|
||||
if whiptail_desktop_nongrid_iso; then
|
||||
# Remove setup from auto launching
|
||||
parse_install_username
|
||||
sed -i '$ d' /home/$INSTALLUSERNAME/.bash_profile >> "$setup_log" 2>&1
|
||||
@@ -111,13 +111,13 @@ if [[ $is_analyst ]]; then
|
||||
exit 0
|
||||
fi
|
||||
else
|
||||
if whiptail_analyst_nongrid_network; then
|
||||
if whiptail_desktop_nongrid_network; then
|
||||
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 ""
|
||||
analyst_salt_local
|
||||
desktop_salt_local
|
||||
else
|
||||
# Abort!
|
||||
exit 0
|
||||
@@ -231,11 +231,11 @@ fi
|
||||
|
||||
# Make sure the setup type is suppoted.
|
||||
case "$setup_type" in
|
||||
iso | network | analyst) # Accepted values
|
||||
iso | network | desktop) # Accepted values
|
||||
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
|
||||
;;
|
||||
esac
|
||||
@@ -277,11 +277,11 @@ if ! [[ -f $install_opt_file ]]; then
|
||||
info "User cancelled setup."
|
||||
whiptail_cancel
|
||||
fi
|
||||
# If this is an analyst install lets streamline the process.
|
||||
if [[ $is_analyst ]]; then
|
||||
# If this is an desktop install lets streamline the process.
|
||||
if [[ $is_desktop ]]; then
|
||||
# Prompt for hostname
|
||||
collect_hostname
|
||||
if [[ $is_analyst_iso ]]; then
|
||||
if [[ $is_desktop_iso ]]; then
|
||||
# Prompt Network Setup
|
||||
whiptail_management_nic
|
||||
whiptail_dhcp_or_static
|
||||
@@ -294,7 +294,7 @@ if ! [[ -f $install_opt_file ]]; then
|
||||
fi
|
||||
|
||||
fi
|
||||
if [[ ! $is_analyst_iso ]]; then
|
||||
if [[ ! $is_desktop_iso ]]; then
|
||||
# This should be a network install
|
||||
whiptail_network_notice
|
||||
# Warn about the dangers of DHCP
|
||||
@@ -326,7 +326,7 @@ if ! [[ -f $install_opt_file ]]; then
|
||||
true
|
||||
fi
|
||||
fi
|
||||
if [[ ! $is_analyst ]]; then
|
||||
if [[ ! $is_desktop ]]; then
|
||||
whiptail_install_type
|
||||
fi
|
||||
else
|
||||
|
||||
@@ -27,15 +27,15 @@ whiptail_airgap() {
|
||||
fi
|
||||
}
|
||||
|
||||
whiptail_analyst_install() {
|
||||
whiptail_desktop_install() {
|
||||
|
||||
[ -n "$TESTING" ] && return
|
||||
|
||||
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
|
||||
whiptail --title "$whiptail_title" \
|
||||
@@ -43,13 +43,13 @@ whiptail_analyst_install() {
|
||||
|
||||
}
|
||||
|
||||
whiptail_analyst_nongrid_iso() {
|
||||
whiptail_desktop_nongrid_iso() {
|
||||
|
||||
[ -n "$TESTING" ] && return
|
||||
|
||||
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?
|
||||
|
||||
@@ -61,13 +61,13 @@ whiptail_analyst_nongrid_iso() {
|
||||
|
||||
}
|
||||
|
||||
whiptail_analyst_nongrid_network() {
|
||||
whiptail_desktop_nongrid_network() {
|
||||
|
||||
[ -n "$TESTING" ] && return
|
||||
|
||||
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?
|
||||
|
||||
@@ -651,9 +651,9 @@ whiptail_install_type_dist_existing() {
|
||||
is_import=true
|
||||
elif [ "$install_type" = 'RECEIVER' ]; then
|
||||
is_receiver=true
|
||||
elif [ "$install_type" = 'ANALYST' ]; then
|
||||
if [ "$setup_type" != 'analyst' ]; then
|
||||
exec bash so-setup analyst
|
||||
elif [ "$install_type" = 'DESKTOP' ]; then
|
||||
if [ "$setup_type" != 'desktop' ]; then
|
||||
exec bash so-setup desktop
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -668,10 +668,7 @@ whiptail_install_type_other() {
|
||||
|
||||
install_type=$(whiptail --title "$whiptail_title" --menu \
|
||||
"Choose node type:" 10 65 2 \
|
||||
"ANALYST" "Setup will run 'so-setup analyst' " \
|
||||
"HELIXSENSOR" "Create a Helix sensor " \
|
||||
3>&1 1>&2 2>&3
|
||||
)
|
||||
"DESKTOP" "Setup will run 'so-setup desktop' " 3>&1 1>&2 2>&3)
|
||||
|
||||
local exitstatus=$?
|
||||
whiptail_check_exitstatus $exitstatus
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
|
||||
cd "$(dirname "$0")/setup" || exit 255
|
||||
|
||||
./so-setup analyst "$@"
|
||||
./so-setup desktop "$@"
|
||||
Reference in New Issue
Block a user