mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
[fix] Redirect stdout + stderr for every command in so-setup
This commit is contained in:
@@ -250,25 +250,25 @@ if [[ "$setup_type" == 'iso' ]]; then
|
|||||||
disable_onion_user
|
disable_onion_user
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_hostname 2>> "$setup_log"
|
set_hostname >> $setup_log 2>&1
|
||||||
set_version 2>> "$setup_log"
|
set_version >> $setup_log 2>&1
|
||||||
clear_master 2>> "$setup_log"
|
clear_master >> $setup_log 2>&1
|
||||||
|
|
||||||
if [[ $is_master ]]; then
|
if [[ $is_master ]]; then
|
||||||
generate_passwords 2>> "$setup_log"
|
generate_passwords >> $setup_log 2>&1
|
||||||
secrets_pillar 2>> "$setup_log"
|
secrets_pillar >> $setup_log 2>&1
|
||||||
add_socore_user_master 2>> "$setup_log"
|
add_socore_user_master >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_master && ! $is_eval ]]; then
|
if [[ $is_master && ! $is_eval ]]; then
|
||||||
add_soremote_user_master 2>> "$setup_log"
|
add_soremote_user_master >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_main_ip 2>> "$setup_log"
|
set_main_ip >> $setup_log 2>&1
|
||||||
|
|
||||||
if [[ $is_minion ]]; then
|
if [[ $is_minion ]]; then
|
||||||
set_updates 2>> "$setup_log"
|
set_updates >> $setup_log 2>&1
|
||||||
copy_ssh_key 2>> "$setup_log"
|
copy_ssh_key >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Begin install
|
# Begin install
|
||||||
@@ -286,58 +286,58 @@ fi
|
|||||||
|
|
||||||
if [[ $is_minion ]]; then
|
if [[ $is_minion ]]; then
|
||||||
set_progress_str 3 'Configuring firewall'
|
set_progress_str 3 'Configuring firewall'
|
||||||
set_initial_firewall_policy 2>> "$setup_log"
|
set_initial_firewall_policy >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 4 'Installing Salt and dependencies'
|
set_progress_str 4 'Installing Salt and dependencies'
|
||||||
saltify 2>> "$setup_log"
|
saltify >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 7 'Installing Docker and dependencies'
|
set_progress_str 7 'Installing Docker and dependencies'
|
||||||
docker_install 2>> "$setup_log"
|
docker_install >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 8 'Generating patch pillar'
|
set_progress_str 8 'Generating patch pillar'
|
||||||
patch_pillar 2>> "$setup_log"
|
patch_pillar >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 9 'Initializing Salt minion'
|
set_progress_str 9 'Initializing Salt minion'
|
||||||
configure_minion "$minion_type" 2>> "$setup_log"
|
configure_minion "$minion_type" >> $setup_log 2>&1
|
||||||
|
|
||||||
|
|
||||||
if [[ $is_master || $is_helix ]]; then
|
if [[ $is_master || $is_helix ]]; then
|
||||||
set_progress_str 10 'Configuring Salt master'
|
set_progress_str 10 'Configuring Salt master'
|
||||||
copy_master_config 2>> "$setup_log"
|
copy_master_config >> $setup_log 2>&1
|
||||||
setup_salt_master_dirs 2>> "$setup_log"
|
setup_salt_master_dirs >> $setup_log 2>&1
|
||||||
firewall_generate_templates 2>> "$setup_log"
|
firewall_generate_templates >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 11 'Updating sudoers file for soremote user'
|
set_progress_str 11 'Updating sudoers file for soremote user'
|
||||||
update_sudoers 2>> "$setup_log"
|
update_sudoers >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 12 'Generating master static pillar'
|
set_progress_str 12 'Generating master static pillar'
|
||||||
master_static 2>> "$setup_log"
|
master_static >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 13 'Generating master pillar'
|
set_progress_str 13 'Generating master pillar'
|
||||||
master_pillar 2>> "$setup_log"
|
master_pillar >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
set_progress_str 16 'Running first Salt checkin'
|
set_progress_str 16 'Running first Salt checkin'
|
||||||
salt_firstcheckin 2>> "$setup_log"
|
salt_firstcheckin >> $setup_log 2>&1
|
||||||
|
|
||||||
if [[ $is_helix ]]; then
|
if [[ $is_helix ]]; then
|
||||||
set_progress_str 17 'Generating the FireEye pillar'
|
set_progress_str 17 'Generating the FireEye pillar'
|
||||||
fireeye_pillar 2>> "$setup_log"
|
fireeye_pillar >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_node ]]; then
|
if [[ $is_node ]]; then
|
||||||
set_progress_str 18 'Setting node type'
|
set_progress_str 18 'Setting node type'
|
||||||
set_node_type 2>> "$setup_log"
|
set_node_type >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 19 'Generating search node pillar'
|
set_progress_str 19 'Generating search node pillar'
|
||||||
node_pillar 2>> "$setup_log"
|
node_pillar >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_minion ]]; then
|
if [[ $is_minion ]]; then
|
||||||
set_progress_str 20 'Accepting Salt key on master'
|
set_progress_str 20 'Accepting Salt key on master'
|
||||||
accept_salt_key_remote 2>> "$setup_log"
|
accept_salt_key_remote >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_master ]]; then
|
if [[ $is_master ]]; then
|
||||||
@@ -346,15 +346,15 @@ fi
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 21 'Copying minion pillars to master'
|
set_progress_str 21 'Copying minion pillars to master'
|
||||||
copy_minion_tmp_files 2>> "$setup_log"
|
copy_minion_tmp_files >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 22 'Generating CA and checking in'
|
set_progress_str 22 'Generating CA and checking in'
|
||||||
salt_checkin 2>> "$setup_log"
|
salt_checkin >> $setup_log 2>&1
|
||||||
|
|
||||||
|
|
||||||
if [[ $is_master || $is_helix ]]; then
|
if [[ $is_master || $is_helix ]]; then
|
||||||
set_progress_str 25 'Configuring firewall'
|
set_progress_str 25 'Configuring firewall'
|
||||||
set_initial_firewall_policy 2>> "$setup_log"
|
set_initial_firewall_policy >> $setup_log 2>&1
|
||||||
|
|
||||||
if [[ "$setup_type" == 'iso' ]]; then
|
if [[ "$setup_type" == 'iso' ]]; then
|
||||||
set_progress_str 26 'Copying containers from iso'
|
set_progress_str 26 'Copying containers from iso'
|
||||||
@@ -363,7 +363,7 @@ fi
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
salt-call state.apply -l info registry >> "$setup_log" 2>&1
|
salt-call state.apply -l info registry >> "$setup_log" 2>&1
|
||||||
docker_seed_registry 2>> "$setup_log" # ~ 60% when finished
|
docker_seed_registry >> $setup_log 2>&1 # ~ 60% when finished
|
||||||
|
|
||||||
set_progress_str 61 "$(print_salt_state_apply 'master')"
|
set_progress_str 61 "$(print_salt_state_apply 'master')"
|
||||||
salt-call state.apply -l info master >> $setup_log 2>&1
|
salt-call state.apply -l info master >> $setup_log 2>&1
|
||||||
@@ -461,19 +461,19 @@ fi
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 85 'Applying finishing touches'
|
set_progress_str 85 'Applying finishing touches'
|
||||||
filter_unused_nics 2>> "$setup_log"
|
filter_unused_nics >> $setup_log 2>&1
|
||||||
network_setup 2>> "$setup_log"
|
network_setup >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 86 'Updating packages'
|
set_progress_str 86 'Updating packages'
|
||||||
update_packages 2>> "$setup_log"
|
update_packages >> $setup_log 2>&1
|
||||||
|
|
||||||
if [[ $is_master ]]; then
|
if [[ $is_master ]]; then
|
||||||
set_progress_str 87 'Adding user to SOC'
|
set_progress_str 87 'Adding user to SOC'
|
||||||
add_web_user 2>> "$setup_log"
|
add_web_user >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 90 'Enabling checkin at boot'
|
set_progress_str 90 'Enabling checkin at boot'
|
||||||
checkin_at_boot 2>> "$setup_log"
|
checkin_at_boot >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 95 'Verifying setup'
|
set_progress_str 95 'Verifying setup'
|
||||||
salt-call -l info state.highstate >> $setup_log 2>&1
|
salt-call -l info state.highstate >> $setup_log 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user