From 18be2e2c29f0873228a636391caa11c6be653799 Mon Sep 17 00:00:00 2001 From: Chris Long Date: Fri, 20 Nov 2020 22:37:54 -0800 Subject: [PATCH] Fix issues 565 and 559 --- Vagrant/logger_bootstrap.sh | 4 +++- Vagrant/logger_variables.sh | 4 ++-- Vagrant/post_build_checks.ps1 | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Vagrant/logger_bootstrap.sh b/Vagrant/logger_bootstrap.sh index 7b3e5699f..31d68ba9f 100644 --- a/Vagrant/logger_bootstrap.sh +++ b/Vagrant/logger_bootstrap.sh @@ -11,7 +11,9 @@ sed -i 's/nameserver 127.0.0.53/nameserver 8.8.8.8/g' /etc/resolv.conf && chattr # Source variables from logger_variables.sh # shellcheck disable=SC1091 -source ./logger_variables.sh +source /vagrant/logger_variables.sh 2>/dev/null || \ +source /home/vagrant/logger_variables.sh 2>/dev/null || \ +echo "Unable to locate logger_variables.sh" if [ -z "$MAXMIND_LICENSE" ]; then echo "Note: You have not entered a MaxMind API key in logger_variables.sh, so the ASNgen Splunk app may not work correctly." diff --git a/Vagrant/logger_variables.sh b/Vagrant/logger_variables.sh index 54cc08efd..bf2778df8 100644 --- a/Vagrant/logger_variables.sh +++ b/Vagrant/logger_variables.sh @@ -2,10 +2,10 @@ # Get a free Maxmind license here: https://www.maxmind.com/en/geolite2/signup # Required for the ASNgen app to work: https://splunkbase.splunk.com/app/3531/ -MAXMIND_LICENSE="" +export MAXMIND_LICENSE="" # Get a free Splunk Dev Trial License here: http://dev.splunk.com/page/developer_license_sign_up # To base64 encode on MacOS: cat Splunk.License | base64 | tr -d '\n' | pbcopy # Then, simply paste below: -BASE64_ENCODED_SPLUNK_LICENSE="" +export BASE64_ENCODED_SPLUNK_LICENSE="" diff --git a/Vagrant/post_build_checks.ps1 b/Vagrant/post_build_checks.ps1 index c75638db9..247bce85e 100644 --- a/Vagrant/post_build_checks.ps1 +++ b/Vagrant/post_build_checks.ps1 @@ -10,6 +10,7 @@ function download { $wc = New-Object System.Net.WebClient try { $result = $wc.DownloadString($URL) + if ($result -like "*$PatternToMatch*") { return $true } else { @@ -40,7 +41,7 @@ function post_build_checks { Write-Host '' Write-Host '[*] Verifying that Fleet is reachable...' - $FLEET_CHECK = download -URL 'https://192.168.38.105:8412' -PatternToMatch 'Kolide Fleet' + $FLEET_CHECK = download -URL 'https://192.168.38.105:8412' -PatternToMatch 'Fleet for osquery' if ($FLEET_CHECK -eq $false) { Write-Host '[!] Fleet was unreachable and may not have installed correctly.' -ForegroundColor red } @@ -60,7 +61,7 @@ function post_build_checks { Write-Host '' Write-Host '[*] Verifying that Velociraptor is reachable...' - $VELOCIRAPTOR_CHECK = download -URL 'https://192.168.38.105:9999' -PatternToMatch 'app.html' + $VELOCIRAPTOR_CHECK = download -URL 'https://192.168.38.105:9999' -SuccessOn401 if ($VELOCIRAPTOR_CHECK -eq $false) { Write-Host '[!] Velociraptor was unreachable and may not have installed correctly.' -ForegroundColor red }