mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
limit nodes that bind filebeat certs in so-logstash
This commit is contained in:
@@ -15,34 +15,34 @@
|
||||
{% from 'allowed_states.map.jinja' import allowed_states %}
|
||||
{% if sls in allowed_states %}
|
||||
|
||||
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
|
||||
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
||||
{% set MANAGER = salt['grains.get']('master') %}
|
||||
{% set MANAGERIP = salt['pillar.get']('global:managerip') %}
|
||||
{% set VERSION = salt['pillar.get']('global:soversion', 'HH1.2.2') %}
|
||||
{% set IMAGEREPO = salt['pillar.get']('global:imagerepo') %}
|
||||
{% set MANAGER = salt['grains.get']('master') %}
|
||||
{% set MANAGERIP = salt['pillar.get']('global:managerip') %}
|
||||
|
||||
# Logstash Section - Decide which pillar to use
|
||||
{% set lsheap = salt['pillar.get']('logstash_settings:lsheap', '') %}
|
||||
{% if grains['role'] in ['so-eval','so-managersearch', 'so-manager', 'so-standalone'] %}
|
||||
# Logstash Section - Decide which pillar to use
|
||||
{% set lsheap = salt['pillar.get']('logstash_settings:lsheap', '') %}
|
||||
{% if grains['role'] in ['so-eval','so-managersearch', 'so-manager', 'so-standalone'] %}
|
||||
{% set freq = salt['pillar.get']('manager:freq', '0') %}
|
||||
{% set dstats = salt['pillar.get']('manager:domainstats', '0') %}
|
||||
{% set nodetype = salt['grains.get']('role', '') %}
|
||||
{% elif grains['role'] == 'so-helix' %}
|
||||
{% elif grains['role'] == 'so-helix' %}
|
||||
{% set freq = salt['pillar.get']('manager:freq', '0') %}
|
||||
{% set dstats = salt['pillar.get']('manager:domainstats', '0') %}
|
||||
{% set nodetype = salt['grains.get']('role', '') %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% set PIPELINES = salt['pillar.get']('logstash:pipelines', {}) %}
|
||||
{% set DOCKER_OPTIONS = salt['pillar.get']('logstash:docker_options', {}) %}
|
||||
{% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %}
|
||||
{% set PIPELINES = salt['pillar.get']('logstash:pipelines', {}) %}
|
||||
{% set DOCKER_OPTIONS = salt['pillar.get']('logstash:docker_options', {}) %}
|
||||
{% set TEMPLATES = salt['pillar.get']('elasticsearch:templates', {}) %}
|
||||
|
||||
{% if grains.role in ['so-heavynode'] %}
|
||||
{% if grains.role in ['so-heavynode'] %}
|
||||
{% set EXTRAHOSTHOSTNAME = salt['grains.get']('host') %}
|
||||
{% set EXTRAHOSTIP = salt['pillar.get']('sensor:mainip') %}
|
||||
{% else %}
|
||||
{% else %}
|
||||
{% set EXTRAHOSTHOSTNAME = MANAGER %}
|
||||
{% set EXTRAHOSTIP = MANAGERIP %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
include:
|
||||
- ssl
|
||||
@@ -74,7 +74,7 @@ lspipelinedir:
|
||||
- user: 931
|
||||
- group: 939
|
||||
|
||||
{% for PL in PIPELINES %}
|
||||
{% for PL in PIPELINES %}
|
||||
{% for CONFIGFILE in PIPELINES[PL].config %}
|
||||
ls_pipeline_{{PL}}_{{CONFIGFILE.split('.')[0] | replace("/","_") }}:
|
||||
file.managed:
|
||||
@@ -102,7 +102,7 @@ ls_pipeline_{{PL}}:
|
||||
{% endfor %}
|
||||
- clean: True
|
||||
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
lspipelinesyml:
|
||||
file.managed:
|
||||
@@ -158,9 +158,9 @@ so-logstash:
|
||||
- environment:
|
||||
- LS_JAVA_OPTS=-Xms{{ lsheap }} -Xmx{{ lsheap }}
|
||||
- port_bindings:
|
||||
{% for BINDING in DOCKER_OPTIONS.port_bindings %}
|
||||
{% for BINDING in DOCKER_OPTIONS.port_bindings %}
|
||||
- {{ BINDING }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
- binds:
|
||||
- /opt/so/conf/elasticsearch/templates/:/templates/:ro
|
||||
- /opt/so/conf/logstash/etc/:/usr/share/logstash/config/:ro
|
||||
@@ -170,8 +170,10 @@ so-logstash:
|
||||
- /nsm/logstash:/usr/share/logstash/data:rw
|
||||
- /opt/so/log/logstash:/var/log/logstash:rw
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||
{% if grains['role'] in ['so-manager', 'so-eval', 'so-helix', 'so-managersearch', 'so-standalone', 'so-import', 'so-heavynode'] %}
|
||||
- /etc/pki/filebeat.crt:/usr/share/logstash/filebeat.crt:ro
|
||||
- /etc/pki/filebeat.p8:/usr/share/logstash/filebeat.key:ro
|
||||
{% endif %}
|
||||
- /opt/so/conf/logstash/etc/certs:/usr/share/logstash/certs:ro
|
||||
{% if grains['role'] == 'so-heavynode' %}
|
||||
- /etc/ssl/certs/intca.crt:/usr/share/filebeat/ca.crt:ro
|
||||
@@ -190,22 +192,24 @@ so-logstash:
|
||||
{%- endif %}
|
||||
- watch:
|
||||
- file: lsetcsync
|
||||
{% for PL in PIPELINES %}
|
||||
{% for PL in PIPELINES %}
|
||||
- file: ls_pipeline_{{PL}}
|
||||
{% for CONFIGFILE in PIPELINES[PL].config %}
|
||||
- file: ls_pipeline_{{PL}}_{{CONFIGFILE.split('.')[0] | replace("/","_") }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% for TEMPLATE in TEMPLATES %}
|
||||
{% endfor %}
|
||||
{% for TEMPLATE in TEMPLATES %}
|
||||
- file: es_template_{{TEMPLATE.split('.')[0] | replace("/","_") }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
- require:
|
||||
{% if grains['role'] in ['so-manager', 'so-eval', 'so-helix', 'so-managersearch', 'so-standalone', 'so-import', 'so-heavynode'] %}
|
||||
- x509: etc_filebeat_crt
|
||||
{% if grains['role'] == 'so-heavynode' %}
|
||||
{% endif %}
|
||||
{% if grains['role'] == 'so-heavynode' %}
|
||||
- x509: trusttheca
|
||||
{% else %}
|
||||
{% else %}
|
||||
- x509: pki_public_ca_crt
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
- file: cacertz
|
||||
- file: capemz
|
||||
|
||||
|
||||
Reference in New Issue
Block a user