mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-09 02:32:46 +01:00
Merge pull request #8054 from Security-Onion-Solutions/dmz_receiver
Dmz receiver
This commit is contained in:
@@ -446,6 +446,13 @@ output.logstash:
|
|||||||
|
|
||||||
# The Logstash hosts
|
# The Logstash hosts
|
||||||
hosts:
|
hosts:
|
||||||
|
{# dont let filebeat send to a node designated as dmz #}
|
||||||
|
{% import_yaml 'logstash/dmz_nodes.yaml' as dmz_nodes -%}
|
||||||
|
{% if dmz_nodes.logstash.dmz_nodes -%}
|
||||||
|
{% set dmz_nodes = dmz_nodes.logstash.dmz_nodes -%}
|
||||||
|
{% else -%}
|
||||||
|
{% set dmz_nodes = [] -%}
|
||||||
|
{% endif -%}
|
||||||
{%- if grains.role in ['so-sensor', 'so-fleet', 'so-node', 'so-idh'] %}
|
{%- if grains.role in ['so-sensor', 'so-fleet', 'so-node', 'so-idh'] %}
|
||||||
{%- set LOGSTASH = namespace() %}
|
{%- set LOGSTASH = namespace() %}
|
||||||
{%- set LOGSTASH.count = 0 %}
|
{%- set LOGSTASH.count = 0 %}
|
||||||
@@ -454,8 +461,10 @@ output.logstash:
|
|||||||
{%- for node_type, node_details in node_data.items() | sort -%}
|
{%- for node_type, node_details in node_data.items() | sort -%}
|
||||||
{%- if node_type in ['manager', 'managersearch', 'standalone', 'receiver' ] %}
|
{%- if node_type in ['manager', 'managersearch', 'standalone', 'receiver' ] %}
|
||||||
{%- for hostname in node_data[node_type].keys() %}
|
{%- for hostname in node_data[node_type].keys() %}
|
||||||
|
{%- if hostname not in dmz_nodes %}
|
||||||
{%- set LOGSTASH.count = LOGSTASH.count + 1 %}
|
{%- set LOGSTASH.count = LOGSTASH.count + 1 %}
|
||||||
- "{{ hostname }}:5644" #{{ node_details[hostname].ip }}
|
- "{{ hostname }}:5644" #{{ node_details[hostname].ip }}
|
||||||
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if LOGSTASH.count > 1 %}
|
{%- if LOGSTASH.count > 1 %}
|
||||||
|
|||||||
9
salt/logstash/dmz_nodes.yaml
Normal file
9
salt/logstash/dmz_nodes.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Do not edit this file. Copy it to /opt/so/saltstack/local/salt/logstash/ and make changes there. It should be formatted as a list.
|
||||||
|
# logstash:
|
||||||
|
# dmz_nodes:
|
||||||
|
# - mydmznodehostname1
|
||||||
|
# - mydmznodehostname2
|
||||||
|
# - mydmznodehostname3
|
||||||
|
|
||||||
|
logstash:
|
||||||
|
dmz_nodes:
|
||||||
Reference in New Issue
Block a user