mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Fleet setup fixes
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
{% set VERSION = salt['pillar.get']('static:soversion') %}
|
{% set VERSION = salt['pillar.get']('static:soversion') %}
|
||||||
{% set CUSTOM_FLEET_HOSTNAME = salt['pillar.get']('static:fleet_custom_hostname', None) %}
|
{% set CUSTOM_FLEET_HOSTNAME = salt['pillar.get']('static:fleet_custom_hostname', None) %}
|
||||||
|
|
||||||
{% if CUSTOM_FLEET_HOSTNAME != None && CUSTOM_FLEET_HOSTNAME != '' %}
|
{% if CUSTOM_FLEET_HOSTNAME != None and CUSTOM_FLEET_HOSTNAME != '' %}
|
||||||
{% set HOSTNAME = CUSTOM_FLEET_HOSTNAME %}
|
{% set HOSTNAME = CUSTOM_FLEET_HOSTNAME %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set HOSTNAME = grains.host %}
|
{% set HOSTNAME = grains.host %}
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import subprocess
|
|||||||
def run():
|
def run():
|
||||||
MINIONID = data['id']
|
MINIONID = data['id']
|
||||||
ACTION = data['data']['action']
|
ACTION = data['data']['action']
|
||||||
local_salt_dir = /opt/so/saltstack/local
|
LOCAL_SALT_DIR = "/opt/so/saltstack/local"
|
||||||
STATICFILE = local_salt_dir + '/pillar/static.sls'
|
STATICFILE = f"{LOCAL_SALT_DIR}/pillar/static.sls"
|
||||||
SECRETSFILE = local_salt_dir + '/pillar/secrets.sls'
|
SECRETSFILE = f"{LOCAL_SALT_DIR}/pillar/secrets.sls"
|
||||||
|
|
||||||
if MINIONID.split('_')[-1] in ['master','eval','fleet','mastersearch','standalone']:
|
if MINIONID.split('_')[-1] in ['master','eval','fleet','mastersearch','standalone']:
|
||||||
if ACTION == 'enablefleet':
|
if ACTION == 'enablefleet':
|
||||||
@@ -58,7 +58,7 @@ def run():
|
|||||||
PACKAGEVERSION += 1
|
PACKAGEVERSION += 1
|
||||||
|
|
||||||
# Run Docker container that will build the packages
|
# Run Docker container that will build the packages
|
||||||
gen_packages = subprocess.run(["docker", "run","--rm", "--mount", "type=bind,ssource=" + local_salt_dir + "/salt/fleet/packages,target=/output", \
|
gen_packages = subprocess.run(["docker", "run","--rm", "--mount", f"type=bind,source={LOCAL_SALT_DIR}/salt/fleet/packages,target=/output", \
|
||||||
"--mount", "type=bind,source=/etc/ssl/certs/intca.crt,target=/var/launcher/launcher.crt", f"{ MASTER }:5000/soshybridhunter/so-fleet-launcher:{ VERSION }", \
|
"--mount", "type=bind,source=/etc/ssl/certs/intca.crt,target=/var/launcher/launcher.crt", f"{ MASTER }:5000/soshybridhunter/so-fleet-launcher:{ VERSION }", \
|
||||||
f"{ESECRET}", f"{PACKAGEHOSTNAME}:8090", f"{PACKAGEVERSION}.1.1"], stdout=subprocess.PIPE, encoding='ascii')
|
f"{ESECRET}", f"{PACKAGEHOSTNAME}:8090", f"{PACKAGEVERSION}.1.1"], stdout=subprocess.PIPE, encoding='ascii')
|
||||||
|
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ if [[ $is_minion ]]; then
|
|||||||
copy_ssh_key >> $setup_log 2>&1
|
copy_ssh_key >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_fleet_standalone ]]; then
|
if [[ "$OSQUERY" = 1 ]]; then
|
||||||
host_pillar >> $setup_log 2>&1
|
host_pillar >> $setup_log 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user