mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 02:02:50 +01:00
Reorder airgap prompt and add additional logic
Setup should now only ask the user whether to setup as airgap on manager-type installs. For all distributed minions setup will now inherit the airgap boolean from the manager.
This commit is contained in:
@@ -265,14 +265,6 @@ if [[ $is_manager || $is_import ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [[ -f $install_opt_file ]]; then
|
if ! [[ -f $install_opt_file ]]; then
|
||||||
# Check if this is an airgap install
|
|
||||||
if [[ ( $is_manager || $is_import || $is_minion ) && $is_iso ]]; then
|
|
||||||
whiptail_airgap
|
|
||||||
if [[ "$INTERWEBS" == 'AIRGAP' ]]; then
|
|
||||||
is_airgap=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $is_manager && $is_sensor ]]; then
|
if [[ $is_manager && $is_sensor ]]; then
|
||||||
check_requirements "standalone"
|
check_requirements "standalone"
|
||||||
elif [[ $is_fleet_standalone ]]; then
|
elif [[ $is_fleet_standalone ]]; then
|
||||||
@@ -312,6 +304,33 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
add_mngr_ip_to_hosts
|
add_mngr_ip_to_hosts
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $is_minion ]] && ! (compare_versions); then
|
||||||
|
info "Installer version mismatch, downloading correct version from manager"
|
||||||
|
printf '%s\n' \
|
||||||
|
"install_type=$install_type" \
|
||||||
|
"MNIC=$MNIC" \
|
||||||
|
"HOSTNAME=$HOSTNAME" \
|
||||||
|
"MSRV=$MSRV" \
|
||||||
|
"MSRVIP=$MSRVIP" \
|
||||||
|
"NODE_DESCRIPTION=\"$NODE_DESCRIPTION\"" > "$install_opt_file"
|
||||||
|
download_repo_tarball
|
||||||
|
exec bash /root/manager_setup/securityonion/setup/so-setup "${original_args[@]}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
rm -rf $install_opt_file >> "$setup_log" 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if this is an airgap install
|
||||||
|
if [[ ( $is_manager || $is_import) && $is_iso ]]; then
|
||||||
|
whiptail_airgap
|
||||||
|
if [[ "$INTERWEBS" == 'AIRGAP' ]]; then
|
||||||
|
is_airgap=true
|
||||||
|
fi
|
||||||
|
el [[ $is_minion ]]
|
||||||
|
airgap_mngr_str=$($sshcmd -i /root/.ssh/so.key soremote@"$MSRV" cat /opt/so/saltstack/local/pillar/global.sls | grep airgap: | awk '{print $2}') >> $setup_log 2>&1
|
||||||
|
[[ $airgap_mngr_str == "True" ]] && is_airgap=true >> $setup_log 2>&1
|
||||||
|
fi
|
||||||
|
|
||||||
reset_proxy
|
reset_proxy
|
||||||
if [[ -z $is_airgap ]]; then
|
if [[ -z $is_airgap ]]; then
|
||||||
collect_net_method
|
collect_net_method
|
||||||
@@ -323,25 +342,6 @@ if ! [[ -f $install_opt_file ]]; then
|
|||||||
copy_ssh_key >> $setup_log 2>&1
|
copy_ssh_key >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_minion ]] && ! (compare_versions); then
|
|
||||||
info "Installer version mismatch, downloading correct version from manager"
|
|
||||||
printf '%s\n' \
|
|
||||||
"install_type=$install_type" \
|
|
||||||
"MNIC=$MNIC" \
|
|
||||||
"HOSTNAME=$HOSTNAME" \
|
|
||||||
"MSRV=$MSRV" \
|
|
||||||
"MSRVIP=$MSRVIP" \
|
|
||||||
"is_airgap=$is_airgap" \
|
|
||||||
"NODE_DESCRIPTION=\"$NODE_DESCRIPTION\"" > "$install_opt_file"
|
|
||||||
[[ -n $so_proxy ]] && echo "so_proxy=$so_proxy" >> "$install_opt_file"
|
|
||||||
download_repo_tarball
|
|
||||||
exec bash /root/manager_setup/securityonion/setup/so-setup "${original_args[@]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
else
|
|
||||||
rm -rf $install_opt_file >> "$setup_log" 2>&1
|
|
||||||
fi
|
|
||||||
|
|
||||||
percentage=0
|
percentage=0
|
||||||
{
|
{
|
||||||
installer_progress_loop & # Run progress bar to 98 in ~8 minutes while waiting for package installs
|
installer_progress_loop & # Run progress bar to 98 in ~8 minutes while waiting for package installs
|
||||||
|
|||||||
Reference in New Issue
Block a user