From 636505ef98edc335b76db1088e8256c411ad48b1 Mon Sep 17 00:00:00 2001 From: Mike Reeves Date: Tue, 28 Mar 2023 11:18:56 -0400 Subject: [PATCH 1/6] Add license and common --- .../tools/sbin/so-elasticsearch-cluster-settings | 8 +++++++- salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines | 6 +++--- .../elasticsearch/tools/sbin/so-elasticsearch-roles-load | 6 ++++-- .../tools/sbin/so-elasticsearch-templates-load | 9 ++++++--- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings b/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings index 0cdec181e..2142372f2 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings @@ -1,4 +1,10 @@ -#!/bin/bash +#/bin/bash +# Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one +# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at +# https://securityonion.net/license; you may not use this file except in compliance with the +# Elastic License 2.0. + +. /usr/sbin/so-common ELASTICSEARCH_PORT=9200 diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines b/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines index 04cd86c23..b5b765b94 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines @@ -1,10 +1,10 @@ -#!/bin/bash -# +#/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one -# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at +# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the # Elastic License 2.0. +. /usr/sbin/so-common RETURN_CODE=0 diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load b/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load index 130e0f762..18e37e587 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load @@ -1,9 +1,11 @@ -#!/bin/bash +#/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one -# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at +# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the # Elastic License 2.0. +. /usr/sbin/so-common + default_conf_dir=/opt/so/conf ELASTICSEARCH_HOST="{{ GLOBALS.node_ip }}" ELASTICSEARCH_PORT=9200 diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load b/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load index a10d07e13..0530b1a73 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load @@ -1,7 +1,10 @@ -#!/bin/bash +#/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one -# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use -# this file except in compliance with the Elastic License 2.0. +# or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at +# https://securityonion.net/license; you may not use this file except in compliance with the +# Elastic License 2.0. + +. /usr/sbin/so-common default_conf_dir=/opt/so/conf ELASTICSEARCH_HOST="{{ GLOBALS.node_ip }}" From 492fe1fc8579f71ba4d0c3170941999cd91eba1b Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 28 Mar 2023 11:48:31 -0400 Subject: [PATCH 2/6] Ensure /usr/sbin is in path --- salt/common/tools/sbin/so-common | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/salt/common/tools/sbin/so-common b/salt/common/tools/sbin/so-common index 49b0d0527..2f436e86e 100755 --- a/salt/common/tools/sbin/so-common +++ b/salt/common/tools/sbin/so-common @@ -16,6 +16,11 @@ if [ -z $NOROOT ]; then fi fi +# Ensure /usr/sbin is in path +if ! echo "$PATH" | grep -q "/usr/sbin"; then + export PATH="$PATH:/usr/sbin" +fi + # Define a banner to separate sections banner="=========================================================================" From 5f49a120de21d23357bd247d735bcb65ebf1d44a Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 28 Mar 2023 11:56:51 -0400 Subject: [PATCH 3/6] Update so-elasticsearch-templates-load --- salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load b/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load index 0530b1a73..386026f0c 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-templates-load @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one # or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the From 60d770411ae9c0f0c2a0921a89da41e191e80477 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 28 Mar 2023 11:57:07 -0400 Subject: [PATCH 4/6] Update so-elasticsearch-roles-load --- salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load b/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load index 18e37e587..17265a7c4 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-roles-load @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one # or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the From 591129b98ceddb203feb43ec9284f2e84642e856 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 28 Mar 2023 11:57:22 -0400 Subject: [PATCH 5/6] Update so-elasticsearch-pipelines --- salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines b/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines index b5b765b94..7fdc6ff7b 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-pipelines @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one # or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the @@ -51,4 +51,4 @@ if [ ! -f /opt/so/state/espipelines.txt ]; then fi else exit $RETURN_CODE -fi \ No newline at end of file +fi From 4efe22efb38058c0c2df984d8d4dd00ae66c7be3 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Tue, 28 Mar 2023 11:57:41 -0400 Subject: [PATCH 6/6] Update so-elasticsearch-cluster-settings --- salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings b/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings index 2142372f2..83a997845 100755 --- a/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings +++ b/salt/elasticsearch/tools/sbin/so-elasticsearch-cluster-settings @@ -1,4 +1,4 @@ -#/bin/bash +#!/bin/bash # Copyright Security Onion Solutions LLC and/or licensed to Security Onion Solutions LLC under one # or more contributor license agreements. Licensed under the Elastic License 2.0 as shown at # https://securityonion.net/license; you may not use this file except in compliance with the