add zeekloglookup to translate zeeklogs to filebeat filesets

This commit is contained in:
m0duspwnens
2021-05-25 17:14:26 -04:00
parent 2eee6b45bc
commit dfaf40f583
3 changed files with 13 additions and 3 deletions

View File

@@ -23,7 +23,6 @@
{% from 'filebeat/map.jinja' import THIRDPARTY with context %}
{% from 'filebeat/map.jinja' import SO with context %}
filebeatetcdir:
file.directory:
- name: /opt/so/conf/filebeat/etc

View File

@@ -4,3 +4,7 @@
{% import_yaml 'filebeat/securityoniondefaults.yaml' as SODEFAULTS %}
{% set SO = SODEFAULTS.securityonion_filebeat %}
{#% set SO = salt['pillar.get']('filebeat:third_party_filebeat', default=SODEFAULTS.third_party_filebeat, merge=True) %#}
{% set ZEEKLOGLOOKUP = {
'conn': 'connection',
} %}

View File

@@ -1,4 +1,6 @@
{%- set ZEEKVER = salt['pillar.get']('global:mdengine', '') %}
{% from 'filebeat/map.jinja' import ZEEKLOGLOOKUP with context %}
securityonion_filebeat:
modules:
elasticsearch:
@@ -25,9 +27,14 @@ securityonion_filebeat:
{%- if ZEEKVER != 'SURICATA' %}
zeek:
{%- for LOGNAME in salt['pillar.get']('zeeklogs:enabled', '') %}
{{ LOGNAME }}:
{% if LOGNAME in ZEEKLOGLOOKUP.keys() %}
{% set FILESET = ZEEKLOGLOOKUP.get(LOGNAME) %}
{% else %}
{% set FILESET = LOGNAME %}
{% endif %}
{{ FILESET }}:
enabled: false
var.paths: ["/nsm/zeek/logs/current/{{ LOGNAME }}.log"]
{%- endfor %}
{%- endif %}
{%- endif %}
{%- endif %}