mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #1680 from Security-Onion-Solutions/feature/setup-fixes
Feature/setup fixes
This commit is contained in:
@@ -1003,15 +1003,6 @@ get_redirect() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
got_root() {
|
|
||||||
# Make sure you are root
|
|
||||||
uid="$(id -u)"
|
|
||||||
if [ "$uid" -ne 0 ]; then
|
|
||||||
echo "This script must be run using sudo!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
get_minion_type() {
|
get_minion_type() {
|
||||||
local minion_type
|
local minion_type
|
||||||
case "$install_type" in
|
case "$install_type" in
|
||||||
|
|||||||
@@ -15,7 +15,15 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Make sure you are root before doing anything
|
||||||
|
uid="$(id -u)"
|
||||||
|
if [ "$uid" -ne 0 ]; then
|
||||||
|
echo "This script must be run using sudo!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
cd "$(dirname "$0")" || exit 255
|
cd "$(dirname "$0")" || exit 255
|
||||||
|
|
||||||
source ./so-functions
|
source ./so-functions
|
||||||
source ./so-common-functions
|
source ./so-common-functions
|
||||||
source ./so-whiptail
|
source ./so-whiptail
|
||||||
@@ -108,8 +116,6 @@ esac
|
|||||||
# Allow execution of SO tools during setup
|
# Allow execution of SO tools during setup
|
||||||
export PATH=$PATH:../salt/common/tools/sbin
|
export PATH=$PATH:../salt/common/tools/sbin
|
||||||
|
|
||||||
got_root
|
|
||||||
|
|
||||||
detect_os && detect_cloud
|
detect_os && detect_cloud
|
||||||
set_network_dev_status_list
|
set_network_dev_status_list
|
||||||
|
|
||||||
@@ -185,6 +191,10 @@ elif [ "$install_type" = 'HELIXSENSOR' ]; then
|
|||||||
is_helix=true
|
is_helix=true
|
||||||
elif [ "$install_type" = 'IMPORT' ]; then
|
elif [ "$install_type" = 'IMPORT' ]; then
|
||||||
is_import=true
|
is_import=true
|
||||||
|
elif [ "$install_type" = 'ANALYST' ]; then
|
||||||
|
cd .. || exit 255
|
||||||
|
./so-analyst-install
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Say yes to the dress if its an ISO install
|
# Say yes to the dress if its an ISO install
|
||||||
|
|||||||
@@ -560,11 +560,12 @@ whiptail_install_type() {
|
|||||||
|
|
||||||
# What kind of install are we doing?
|
# What kind of install are we doing?
|
||||||
install_type=$(whiptail --title "Security Onion Setup" --radiolist \
|
install_type=$(whiptail --title "Security Onion Setup" --radiolist \
|
||||||
"Choose install type:" 10 65 4 \
|
"Choose install type:" 12 65 5 \
|
||||||
"EVAL" "Evaluation mode (not for production) " ON \
|
"EVAL" "Evaluation mode (not for production) " ON \
|
||||||
"STANDALONE" "Standalone production install " OFF \
|
"STANDALONE" "Standalone production install " OFF \
|
||||||
"DISTRIBUTED" "Distributed install submenu " OFF \
|
"DISTRIBUTED" "Distributed install submenu " OFF \
|
||||||
"IMPORT" "Standalone to import PCAP or log files " OFF \
|
"IMPORT" "Standalone to import PCAP or log files " OFF \
|
||||||
|
"OTHER" "Other install types" OFF \
|
||||||
3>&1 1>&2 2>&3
|
3>&1 1>&2 2>&3
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -572,6 +573,18 @@ whiptail_install_type() {
|
|||||||
whiptail_check_exitstatus $exitstatus
|
whiptail_check_exitstatus $exitstatus
|
||||||
|
|
||||||
if [[ $install_type == "DISTRIBUTED" ]]; then
|
if [[ $install_type == "DISTRIBUTED" ]]; then
|
||||||
|
whiptail_install_type_dist
|
||||||
|
elif [[ $install_type == "OTHER" ]]; then
|
||||||
|
whiptail_install_type_other
|
||||||
|
fi
|
||||||
|
|
||||||
|
export install_type
|
||||||
|
}
|
||||||
|
|
||||||
|
whiptail_install_type_dist() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
install_type=$(whiptail --title "Security Onion Setup" --radiolist \
|
install_type=$(whiptail --title "Security Onion Setup" --radiolist \
|
||||||
"Choose distributed node type:" 13 60 6 \
|
"Choose distributed node type:" 13 60 6 \
|
||||||
"MANAGER" "Start a new grid " ON \
|
"MANAGER" "Start a new grid " ON \
|
||||||
@@ -586,7 +599,23 @@ whiptail_install_type() {
|
|||||||
# "WAZUH" "Stand Alone Wazuh Server" OFF \ # TODO
|
# "WAZUH" "Stand Alone Wazuh Server" OFF \ # TODO
|
||||||
# "STRELKA" "Stand Alone Strelka Node" OFF \ # TODO
|
# "STRELKA" "Stand Alone Strelka Node" OFF \ # TODO
|
||||||
)
|
)
|
||||||
fi
|
|
||||||
|
local exitstatus=$?
|
||||||
|
whiptail_check_exitstatus $exitstatus
|
||||||
|
|
||||||
|
export install_type
|
||||||
|
}
|
||||||
|
|
||||||
|
whiptail_install_type_other() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
|
install_type=$(whiptail --title "Security Onion Setup" --radiolist \
|
||||||
|
"Choose distributed node type:" 9 65 2 \
|
||||||
|
"ANALYST" "Quit setup and run so-analyst-install " ON \
|
||||||
|
"HELIXSENSOR" "Create a Helix sensor " OFF \
|
||||||
|
3>&1 1>&2 2>&3
|
||||||
|
)
|
||||||
|
|
||||||
local exitstatus=$?
|
local exitstatus=$?
|
||||||
whiptail_check_exitstatus $exitstatus
|
whiptail_check_exitstatus $exitstatus
|
||||||
|
|||||||
Reference in New Issue
Block a user