mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-09 02:32:46 +01:00
fix formatting
This commit is contained in:
138
setup/so-setup
138
setup/so-setup
@@ -74,15 +74,15 @@ detect_os
|
|||||||
is_analyst=
|
is_analyst=
|
||||||
if [ "$setup_type" = 'analyst' ]; then
|
if [ "$setup_type" = 'analyst' ]; then
|
||||||
is_analyst=true
|
is_analyst=true
|
||||||
# Check to see if this is an ISO
|
# Check to see if this is an ISO
|
||||||
if [ -d /root/SecurityOnion ]; then
|
if [ -d /root/SecurityOnion ]; then
|
||||||
is_analyst_iso=true
|
is_analyst_iso=true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$setup_type" == 'iso' ]]; then
|
if [[ "$setup_type" == 'iso' ]]; then
|
||||||
if [[ $is_centos ]]; then
|
if [[ $is_centos ]]; then
|
||||||
is_iso=true
|
is_iso=true
|
||||||
else
|
else
|
||||||
echo "Only use 'so-setup iso' for an ISO install on CentOS. Please run 'so-setup network' instead."
|
echo "Only use 'so-setup iso' for an ISO install on CentOS. Please run 'so-setup network' instead."
|
||||||
exit 1
|
exit 1
|
||||||
@@ -93,17 +93,17 @@ fi
|
|||||||
|
|
||||||
if [[ $is_analyst ]]; then
|
if [[ $is_analyst ]]; then
|
||||||
|
|
||||||
# Make sure it's CentOS
|
# Make sure it's CentOS
|
||||||
if [[ ! $is_centos ]]; then
|
if [[ ! $is_centos ]]; then
|
||||||
echo "Analyst Workstation is only supported on CentOS 7"
|
echo "Analyst Workstation is only supported on CentOS 7"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! whiptail_analyst_install; then
|
if ! whiptail_analyst_install; then
|
||||||
# Lets make this a standalone
|
# Lets make this a standalone
|
||||||
echo "Enabling graphical interface and setting it to load at boot"
|
echo "Enabling graphical interface and setting it to load at boot"
|
||||||
systemctl set-default graphical.target
|
systemctl set-default graphical.target
|
||||||
startx
|
startx
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -234,37 +234,37 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
echo "User cancelled setup." | tee -a "$setup_log"
|
echo "User cancelled setup." | tee -a "$setup_log"
|
||||||
whiptail_cancel
|
whiptail_cancel
|
||||||
fi
|
fi
|
||||||
if [[ $is_analyst ]]; then
|
if [[ $is_analyst ]]; then
|
||||||
collect_hostname
|
collect_hostname
|
||||||
if [[ $is_analyst_iso ]]; then
|
if [[ $is_analyst_iso ]]; then
|
||||||
# Prompt Network Setup
|
# Prompt Network Setup
|
||||||
whiptail_management_nic
|
whiptail_management_nic
|
||||||
whiptail_dhcp_or_static
|
whiptail_dhcp_or_static
|
||||||
|
|
||||||
if [ "$address_type" != 'DHCP' ]; then
|
if [ "$address_type" != 'DHCP' ]; then
|
||||||
collect_int_ip_mask
|
collect_int_ip_mask
|
||||||
collect_gateway
|
collect_gateway
|
||||||
collect_dns
|
collect_dns
|
||||||
collect_dns_domain
|
collect_dns_domain
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [[ ! $is_analyst_iso ]]; then
|
if [[ ! $is_analyst_iso ]]; then
|
||||||
# This should be a network install
|
# This should be a network install
|
||||||
whiptail_network_notice
|
whiptail_network_notice
|
||||||
whiptail_dhcp_warn
|
whiptail_dhcp_warn
|
||||||
whiptail_management_nic
|
whiptail_management_nic
|
||||||
fi
|
fi
|
||||||
whiptail_network_init_notice
|
whiptail_network_init_notice
|
||||||
network_init
|
network_init
|
||||||
printf '%s\n' \
|
printf '%s\n' \
|
||||||
"MNIC=$MNIC" \
|
"MNIC=$MNIC" \
|
||||||
"HOSTNAME=$HOSTNAME" > "$net_init_file"
|
"HOSTNAME=$HOSTNAME" > "$net_init_file"
|
||||||
set_main_ip >> $setup_log 2>&1
|
set_main_ip >> $setup_log 2>&1
|
||||||
compare_main_nic_ip
|
compare_main_nic_ip
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $setup_type == 'iso' ]] && [ "$automated" == no ]; then
|
if [[ $setup_type == 'iso' ]] && [ "$automated" == no ]; then
|
||||||
whiptail_first_menu_iso
|
whiptail_first_menu_iso
|
||||||
if [[ $option == "CONFIGURENETWORK" ]]; then
|
if [[ $option == "CONFIGURENETWORK" ]]; then
|
||||||
@@ -283,7 +283,7 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
whiptail_install_type
|
whiptail_install_type
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
source $install_opt_file
|
source $install_opt_file
|
||||||
@@ -462,10 +462,10 @@ detect_cloud
|
|||||||
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
|
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
|
||||||
|
|
||||||
if [[ $is_analyst ]]; then
|
if [[ $is_analyst ]]; then
|
||||||
MINION_ID=$(echo "${short_name}_workstation" | tr '[:upper:]' '[:lower:]')
|
MINION_ID=$(echo "${short_name}_workstation" | tr '[:upper:]' '[:lower:]')
|
||||||
fi
|
fi
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
|
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
|
||||||
fi
|
fi
|
||||||
export MINION_ID
|
export MINION_ID
|
||||||
|
|
||||||
@@ -749,10 +749,10 @@ echo "1" > /root/accept_changes
|
|||||||
info "Disabling fastestmirror"
|
info "Disabling fastestmirror"
|
||||||
[[ $is_centos ]] && disable_fastestmirror
|
[[ $is_centos ]] && disable_fastestmirror
|
||||||
if [[ ! $is_airgap ]]; then
|
if [[ ! $is_airgap ]]; then
|
||||||
securityonion_repo >> $setup_log 2>&1
|
securityonion_repo >> $setup_log 2>&1
|
||||||
update_packages >> $setup_log 2>&1
|
update_packages >> $setup_log 2>&1
|
||||||
else
|
else
|
||||||
airgap_repo >> $setup_log 2>&1
|
airgap_repo >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_sensor || $is_helix || $is_import ]]; then
|
if [[ $is_sensor || $is_helix || $is_import ]]; then
|
||||||
@@ -773,8 +773,8 @@ echo "1" > /root/accept_changes
|
|||||||
saltify 2>> $setup_log
|
saltify 2>> $setup_log
|
||||||
|
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
set_progress_str 6 'Installing Docker and dependencies'
|
set_progress_str 6 'Installing Docker and dependencies'
|
||||||
docker_install >> $setup_log 2>&1
|
docker_install >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 7 'Generating patch pillar'
|
set_progress_str 7 'Generating patch pillar'
|
||||||
@@ -783,9 +783,9 @@ echo "1" > /root/accept_changes
|
|||||||
set_progress_str 8 'Initializing Salt minion'
|
set_progress_str 8 'Initializing Salt minion'
|
||||||
configure_minion "$minion_type" >> $setup_log 2>&1
|
configure_minion "$minion_type" >> $setup_log 2>&1
|
||||||
|
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
check_sos_appliance >> $setup_log 2>&1
|
check_sos_appliance >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
update_sudoers_for_testing >> $setup_log 2>&1
|
update_sudoers_for_testing >> $setup_log 2>&1
|
||||||
|
|
||||||
@@ -864,10 +864,10 @@ echo "1" > /root/accept_changes
|
|||||||
generate_ca >> $setup_log 2>&1
|
generate_ca >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
set_progress_str 24 'Generating SSL'
|
set_progress_str 24 'Generating SSL'
|
||||||
generate_ssl >> $setup_log 2>&1
|
generate_ssl >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_manager || $is_helix || $is_import ]]; then
|
if [[ $is_manager || $is_helix || $is_import ]]; then
|
||||||
set_progress_str 25 'Configuring firewall'
|
set_progress_str 25 'Configuring firewall'
|
||||||
@@ -894,20 +894,20 @@ echo "1" > /root/accept_changes
|
|||||||
echo "Finished so-elastic-auth..." >> $setup_log 2>&1
|
echo "Finished so-elastic-auth..." >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
set_progress_str 61 "$(print_salt_state_apply 'firewall')"
|
set_progress_str 61 "$(print_salt_state_apply 'firewall')"
|
||||||
salt-call state.apply -l info firewall >> $setup_log 2>&1
|
salt-call state.apply -l info firewall >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_centos ]]; then
|
if [[ $is_centos ]]; then
|
||||||
set_progress_str 61 'Installing Yum utilities'
|
set_progress_str 61 'Installing Yum utilities'
|
||||||
salt-call state.apply -l info yum.packages >> $setup_log 2>&1
|
salt-call state.apply -l info yum.packages >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
set_progress_str 62 "$(print_salt_state_apply 'common')"
|
set_progress_str 62 "$(print_salt_state_apply 'common')"
|
||||||
salt-call state.apply -l info common >> $setup_log 2>&1
|
salt-call state.apply -l info common >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $is_helix && ! $is_receiver && ! $is_idh && ! $is_analyst ]]; then
|
if [[ ! $is_helix && ! $is_receiver && ! $is_idh && ! $is_analyst ]]; then
|
||||||
set_progress_str 62 "$(print_salt_state_apply 'nginx')"
|
set_progress_str 62 "$(print_salt_state_apply 'nginx')"
|
||||||
@@ -1052,12 +1052,12 @@ echo "1" > /root/accept_changes
|
|||||||
salt-call state.apply -l info filebeat >> $setup_log 2>&1
|
salt-call state.apply -l info filebeat >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $is_analyst ]]; then
|
if [[ ! $is_analyst ]]; then
|
||||||
set_progress_str 85 'Applying finishing touches'
|
set_progress_str 85 'Applying finishing touches'
|
||||||
filter_unused_nics >> $setup_log 2>&1
|
filter_unused_nics >> $setup_log 2>&1
|
||||||
network_setup >> $setup_log 2>&1
|
network_setup >> $setup_log 2>&1
|
||||||
so-ssh-harden >> $setup_log 2>&1
|
so-ssh-harden >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_manager || $is_import ]]; then
|
if [[ $is_manager || $is_import ]]; then
|
||||||
set_progress_str 87 'Adding user to SOC'
|
set_progress_str 87 'Adding user to SOC'
|
||||||
@@ -1111,9 +1111,9 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $ENDGAMEHOST ]]; then
|
if [[ -n $ENDGAMEHOST ]]; then
|
||||||
set_progress_str 99 'Configuring firewall for Endgame SMP'
|
set_progress_str 99 'Configuring firewall for Endgame SMP'
|
||||||
so-firewall --apply includehost endgame $ENDGAMEHOST >> $setup_log 2>&1
|
so-firewall --apply includehost endgame $ENDGAMEHOST >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
} | whiptail_gauge_post_setup "Running post-installation steps..."
|
} | whiptail_gauge_post_setup "Running post-installation steps..."
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user