From 1871d48f7f1fe38686024804f0cde9c93ff75f27 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Thu, 31 Aug 2023 20:42:00 -0400 Subject: [PATCH 1/7] remove unnecesary OTHER submenu --- setup/so-whiptail | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/setup/so-whiptail b/setup/so-whiptail index 8fd3b5fdd..9622ad44a 100755 --- a/setup/so-whiptail +++ b/setup/so-whiptail @@ -563,7 +563,7 @@ whiptail_install_type() { "EVAL" "Evaluation mode (not for production) " \ "STANDALONE" "Standalone production install " \ "DISTRIBUTED" "Distributed install submenu " \ - "OTHER" "Other install types" \ + "DESKTOP" "Install Security Onion Desktop" \ 3>&1 1>&2 2>&3 ) elif [[ "$OSVER" == "focal" ]]; then @@ -584,8 +584,6 @@ whiptail_install_type() { else whiptail_install_type_dist_existing fi - elif [[ $install_type == "OTHER" ]]; then - whiptail_install_type_other fi export install_type @@ -691,21 +689,6 @@ whiptail_install_type_dist_existing() { whiptail_check_exitstatus $exitstatus } - -whiptail_install_type_other() { - - [ -n "$TESTING" ] && return - - install_type=$(whiptail --title "$whiptail_title" --menu \ - "Choose node type:" 10 65 2 \ - "DESKTOP" "Install Security Onion Desktop " 3>&1 1>&2 2>&3) - - local exitstatus=$? - whiptail_check_exitstatus $exitstatus - - export install_type -} - whiptail_invalid_input() { # TODO: This should accept a list of arguments to specify what general pattern the input should follow [ -n "$TESTING" ] && return From 546c562ef0ad9779c41adacc03378e515d826c50 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 1 Sep 2023 10:31:02 -0400 Subject: [PATCH 2/7] expose standard relay timeout in config UI; up default to 45s to accommodate sluggish pillar.get calls --- salt/soc/defaults.yaml | 1 + salt/soc/soc_soc.yaml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/salt/soc/defaults.yaml b/salt/soc/defaults.yaml index 05543cd19..6d8ed5bfd 100644 --- a/salt/soc/defaults.yaml +++ b/salt/soc/defaults.yaml @@ -1012,6 +1012,7 @@ soc: verifyCert: false salt: queueDir: /opt/sensoroni/queue + timeoutMs: 45000 longRelayTimeoutMs: 120000 sostatus: refreshIntervalMs: 30000 diff --git a/salt/soc/soc_soc.yaml b/salt/soc/soc_soc.yaml index e94144069..291f564ed 100644 --- a/salt/soc/soc_soc.yaml +++ b/salt/soc/soc_soc.yaml @@ -116,6 +116,10 @@ soc: description: Duration (in milliseconds) to wait for a response from the Salt API when executing tasks known for being long running before giving up and showing an error on the SOC UI. global: True advanced: True + relayTimeoutMs: + description: Duration (in milliseconds) to wait for a response from the Salt API when executing common grid management tasks before giving up and showing an error on the SOC UI. + global: True + advanced: True client: enableReverseLookup: description: Set to true to enable reverse DNS lookups for IP addresses in the SOC UI. From 8093e5ce7c44612225a27515aef4fed0dfbac468 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 1 Sep 2023 13:01:17 -0400 Subject: [PATCH 3/7] use IP to avoid host issues --- salt/common/tools/sbin/so-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/common/tools/sbin/so-test b/salt/common/tools/sbin/so-test index 7286a35a8..1758a44bb 100755 --- a/salt/common/tools/sbin/so-test +++ b/salt/common/tools/sbin/so-test @@ -11,4 +11,4 @@ set -e so-tcpreplay /opt/samples/* 2> /dev/null # Ingest sample pfsense log entry -echo "<134>$(date '+%b %d %H:%M:%S') filterlog[31624]: 84,,,1567509287,igb0.244,match,pass,in,4,0x0,,64,0,0,DF,6,tcp,64,192.168.1.1,10.10.10.10,56320,443,0,S,3333585167,,65535,,mss;nop;wscale;nop;nop;TS;sackOK;eol" | nc -uv -w1 localhost 514 > /dev/null 2>&1 +echo "<134>$(date '+%b %d %H:%M:%S') filterlog[31624]: 84,,,1567509287,igb0.244,match,pass,in,4,0x0,,64,0,0,DF,6,tcp,64,192.168.1.1,10.10.10.10,56320,443,0,S,3333585167,,65535,,mss;nop;wscale;nop;nop;TS;sackOK;eol" | nc -uv -w1 127.0.0.1 514 > /dev/null 2>&1 From 335aaa55944ae951153c07b59d3ea2e53aa6c6be Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 1 Sep 2023 15:30:53 -0400 Subject: [PATCH 4/7] add additional test modes --- setup/so-setup | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/setup/so-setup b/setup/so-setup index a9c7776c3..99a7c672e 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -183,9 +183,26 @@ if [ -n "$test_profile" ]; then install_type=SEARCHNODE HOSTNAME=search MSRVIP_OFFSET=-1 - else + elif [[ "$test_profile" =~ "-managersearch" ]]; then + install_type=MANAGERSEARCH + elif [[ "$test_profile" =~ "-heavynode" ]]; then + install_type=HEAVYNODE + HOSTNAME=sensor + MSRVIP_OFFSET=-1 + elif [[ "$test_profile" =~ "-desktop" ]]; then + install_type=DESKTOP + MSRVIP_OFFSET=-3 + is_desktop_grid=true + fi + + if [[ -z "$HOSTNAME" ]]; then HOSTNAME=manager fi + + if [[ "$install_type" =~ "DESKTOP" ]]; then + is_desktop=true + hostname=desktop + fi info "Activating test profile; profile=$test_profile; install_type=$install_type" From 863db14b61b4d691ce38f7d28c2a47dc4fcf9b7b Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 1 Sep 2023 16:27:02 -0400 Subject: [PATCH 5/7] add additional test modes --- setup/so-setup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/so-setup b/setup/so-setup index 99a7c672e..ce13af06b 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -201,7 +201,7 @@ if [ -n "$test_profile" ]; then if [[ "$install_type" =~ "DESKTOP" ]]; then is_desktop=true - hostname=desktop + HOSTNAME=desktop fi info "Activating test profile; profile=$test_profile; install_type=$install_type" From a11259c6832ce3331f55e62e704caaf6a6624cdb Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 1 Sep 2023 17:08:27 -0400 Subject: [PATCH 6/7] add additional test modes --- setup/so-setup | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/so-setup b/setup/so-setup index ce13af06b..c6ff27198 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -174,6 +174,7 @@ if [ -n "$test_profile" ]; then # The below settings are hardcoded purely for automated testing purposes. TESTING=true + is_desktop_grid=false if [[ "$test_profile" =~ "-sensor" ]]; then install_type=SENSOR From 6efdf1b9d0444ddb9f39127589c7cbba66d4af83 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Fri, 1 Sep 2023 17:24:12 -0400 Subject: [PATCH 7/7] add additional test modes --- setup/so-functions | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 4f973d147..efa6c800f 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -101,8 +101,10 @@ desktop_salt_local() { Press the Enter key to reboot. EOM - whiptail --title "$whiptail_title" --msgbox "$message" 12 75 - reboot + if [[ -z "$TESTING" ]]; then + whiptail --title "$whiptail_title" --msgbox "$message" 12 75 + reboot + fi exit 0 }