mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Allow multiple Custom Fleet FQDN
This commit is contained in:
@@ -2,7 +2,8 @@ elasticfleet:
|
|||||||
enabled: False
|
enabled: False
|
||||||
config:
|
config:
|
||||||
server:
|
server:
|
||||||
custom_fqdn: ''
|
custom_fqdn:
|
||||||
|
- ''
|
||||||
enable_auto_configuration: True
|
enable_auto_configuration: True
|
||||||
endpoints_enrollment: ''
|
endpoints_enrollment: ''
|
||||||
es_token: ''
|
es_token: ''
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ elasticfleet:
|
|||||||
config:
|
config:
|
||||||
server:
|
server:
|
||||||
custom_fqdn:
|
custom_fqdn:
|
||||||
description: Custom FQDN for Agents to connect to.
|
description: Custom FQDN for Agents to connect to. One per line.
|
||||||
global: True
|
global: True
|
||||||
helpLink: elastic-fleet.html
|
helpLink: elastic-fleet.html
|
||||||
advanced: True
|
advanced: True
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
# 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.
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% set CUSTOMFQDN = salt['pillar.get']('elasticfleet:config:server:custom_fqdn') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
@@ -41,10 +40,15 @@ else
|
|||||||
NEW_LIST=("{{ GLOBALS.url_base }}:5055" "{{ GLOBALS.hostname }}:5055")
|
NEW_LIST=("{{ GLOBALS.url_base }}:5055" "{{ GLOBALS.hostname }}:5055")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{% if CUSTOMFQDN != "" %}
|
# Query for FQDN entries & add them to the list
|
||||||
# Add Custom Hostname to list
|
CUSTOMFQDNLIST=$( salt-call --out=json pillar.get elasticfleet:config:server:custom_fqdn | jq -r '.local | .[]')
|
||||||
NEW_LIST+=("{{ CUSTOMFQDN }}:5055")
|
if [ -n "$CUSTOMFQDNLIST" ]; then
|
||||||
{% endif %}
|
readarray -t CUSTOMFQDN <<< $CUSTOMFQDNLIST
|
||||||
|
for CUSTOMNAME in "${CUSTOMFQDN[@]}"
|
||||||
|
do
|
||||||
|
NEW_LIST+=("$CUSTOMNAME:5055")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Query for the current Grid Nodes that are running Logstash
|
# Query for the current Grid Nodes that are running Logstash
|
||||||
LOGSTASHNODES=$(salt-call --out=json pillar.get logstash:nodes | jq '.local')
|
LOGSTASHNODES=$(salt-call --out=json pillar.get logstash:nodes | jq '.local')
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
# or more contributor license agreements. Licensed under the Elastic License 2.0; you may not use
|
# 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.
|
# this file except in compliance with the Elastic License 2.0.
|
||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% set CUSTOMFQDN = salt['pillar.get']('elasticfleet:config:server:custom_fqdn') %}
|
|
||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
@@ -41,10 +40,15 @@ else
|
|||||||
NEW_LIST=("https://{{ GLOBALS.url_base }}:8220" "https://{{ GLOBALS.hostname }}:8220")
|
NEW_LIST=("https://{{ GLOBALS.url_base }}:8220" "https://{{ GLOBALS.hostname }}:8220")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{% if CUSTOMFQDN != "" %}
|
# Query for FQDN entries & add them to the list
|
||||||
# Add Custom Hostname to list
|
CUSTOMFQDNLIST=$( salt-call --out=json pillar.get elasticfleet:config:server:custom_fqdn | jq -r '.local | .[]')
|
||||||
NEW_LIST+=("https://{{ CUSTOMFQDN }}:8220")
|
if [ -n "$CUSTOMFQDNLIST" ]; then
|
||||||
{% endif %}
|
readarray -t CUSTOMFQDN <<< $CUSTOMFQDNLIST
|
||||||
|
for CUSTOMNAME in "${CUSTOMFQDN[@]}"
|
||||||
|
do
|
||||||
|
NEW_LIST+=("https://$CUSTOMNAME:8220")
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Query for the current Grid Nodes that are running Logstash (which includes Fleet Nodes)
|
# Query for the current Grid Nodes that are running Logstash (which includes Fleet Nodes)
|
||||||
LOGSTASHNODES=$(salt-call --out=json pillar.get logstash:nodes | jq '.local')
|
LOGSTASHNODES=$(salt-call --out=json pillar.get logstash:nodes | jq '.local')
|
||||||
@@ -71,5 +75,5 @@ else
|
|||||||
printf "\nHashes don't match - update needed.\n"
|
printf "\nHashes don't match - update needed.\n"
|
||||||
printf "Current List: $CURRENT_LIST\nNew List: $NEW_LIST_JSON\n"
|
printf "Current List: $CURRENT_LIST\nNew List: $NEW_LIST_JSON\n"
|
||||||
update_fleet_urls
|
update_fleet_urls
|
||||||
/sbin/so-elastic-agent-gen-installers &
|
/sbin/so-elastic-agent-gen-installers >> /opt/so/log/elasticfleet/so-elastic-agent-gen-installers.log &
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user