From 9405990a2e148e310b8f52bbd54c545d6c6fc847 Mon Sep 17 00:00:00 2001 From: m0duspwnens Date: Tue, 12 Jan 2021 09:50:08 -0500 Subject: [PATCH] remote quotes --- setup/so-functions | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 52c8b19c9..94f6b394d 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -467,6 +467,8 @@ configure_minion() { printf '%s\n'\ "use_superseded:"\ " - module.run"\ + "log_level: info"\ + "log_level_logfile: info"\ "log_file: /opt/so/log/salt/minion" >> "$minion_config" { @@ -554,7 +556,7 @@ check_requirements() { } compare_versions() { - manager_ver=$("$sshcmd" -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) + manager_ver=$($sshcmd -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) if [[ $manager_ver == "" ]]; then rm /root/install_opt @@ -975,7 +977,7 @@ download_repo_tarball() { mkdir -p /root/manager_setup/securityonion { local manager_ver - manager_ver=$("$sshcmd" -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) + manager_ver=$($sshcmd -i /root/.ssh/so.key soremote@"$MSRV" cat /etc/soversion) $scpcmd -i /root/.ssh/so.key soremote@"$MSRV":/opt/so/repo/"$manager_ver".tar.gz /root/manager_setup } >> "$setup_log" 2>&1 @@ -1968,6 +1970,8 @@ set_progress_str() { echo -e "$percentage_str" + info "Progressing ($percentage%): $progress_bar_text" + printf '%s\n' \ '----'\ "$percentage% - ${progress_bar_text^^}"\ @@ -1978,9 +1982,9 @@ set_ssh_cmds() { local automated=$1 if [ $automated == yes ]; then - sshcmd='sshpass -p "automation" ssh -o StrictHostKeyChecking=no' - sshcopyidcmd='sshpass -p "automation" ssh-copy-id -o StrictHostKeyChecking=no' - scpcmd='sshpass -p "automation" scp -o StrictHostKeyChecking=no' + sshcmd='sshpass -p "$SOREMOTEPASS1" ssh -o StrictHostKeyChecking=no' + sshcopyidcmd='sshpass -p "$SOREMOTEPASS1" ssh-copy-id -o StrictHostKeyChecking=no' + scpcmd='sshpass -p "$SOREMOTEPASS1" scp -o StrictHostKeyChecking=no' else sshcmd='ssh' sshcopyidcmd='ssh-copy-id' @@ -2212,6 +2216,13 @@ mark_version() { echo "$SOVERSION" > /etc/soversion } +update_sudoers_for_testing() { + if [ -n "$TESTING" ]; then + info "Ensuring $INSTALLUSERNAME has password-less sudo access for automated testing purposes." + sed -i "s/^$INSTALLUSERNAME ALL=(ALL) ALL/$INSTALLUSERNAME ALL=(ALL) NOPASSWD: ALL/" /etc/sudoers + fi +} + update_sudoers() { if ! grep -qE '^soremote\ ALL=\(ALL\)\ NOPASSWD:(\/usr\/bin\/salt\-key|\/opt\/so\/saltstack)' /etc/sudoers; then