issue 10050 and issue 10062

This commit is contained in:
m0duspwnens
2023-03-29 17:21:40 -04:00
parent ebdd74a420
commit 1be86cdf8e
6 changed files with 23 additions and 14 deletions

View File

@@ -1,8 +1,17 @@
{% from 'vars/sensor.map.jinja' import ROLE_GLOBALS %} {% from 'vars/sensor.map.jinja' import ROLE_GLOBALS %}
{% import_yaml 'zeek/defaults.yaml' as zeek_defaults with context %} {% import_yaml 'zeek/defaults.yaml' as zeek_defaults with context %}
{% set zeek_pillar = salt['pillar.get']('zeek', []) %} {% set ZEEKMERGED = salt['pillar.get']('zeek', zeek_defaults.zeek, merge=True) %}
{% set ZEEKMERGED = salt['defaults.merge'](zeek_defaults, zeek_pillar, in_place=False) %} {% do ZEEKMERGED.config.node.update({'interface': ROLE_GLOBALS.sensor.interface}) %}
{% do ZEEKMERGED.zeek.config.node.update({'interface': ROLE_GLOBALS.sensor.interface}) %}
{% if ZEEKMERGED.config.local.load is defined %}
{% set LOCALLOAD = ZEEKMERGED.config.local.pop('load') %}
{% do ZEEKMERGED.config.local.update({'@load': LOCALLOAD}) %}
{% endif %}
{% if ZEEKMERGED.config.local['load-sigs'] is defined %}
{% set LOCALLOADSIGS = ZEEKMERGED.config.local.pop('load-sigs') %}
{% do ZEEKMERGED.config.local.update({'@load-sigs': LOCALLOADSIGS}) %}
{% endif %}
{% set ZEEKOPTIONS = {} %} {% set ZEEKOPTIONS = {} %}
{% set ENABLED = salt['pillar.get']('zeek:enabled', True) %} {% set ENABLED = salt['pillar.get']('zeek:enabled', True) %}

View File

@@ -22,7 +22,7 @@ zeek:
CfgDir: /opt/zeek/etc CfgDir: /opt/zeek/etc
CompressLogs: 1 CompressLogs: 1
local: local:
'@load': load:
- misc/loaded-scripts - misc/loaded-scripts
- tuning/defaults - tuning/defaults
- misc/capture-loss - misc/capture-loss
@@ -68,7 +68,7 @@ zeek:
- zeek-plugin-profinet - zeek-plugin-profinet
- zeek-spicy-wireguard - zeek-spicy-wireguard
- zeek-spicy-stun - zeek-spicy-stun
'@load-sigs': load-sigs:
- frameworks/signatures/detect-windows-shells - frameworks/signatures/detect-windows-shells
redef: redef:
- LogAscii::use_json = T; - LogAscii::use_json = T;

View File

@@ -78,7 +78,7 @@ zeekpolicysync:
- group: 939 - group: 939
- template: jinja - template: jinja
- defaults: - defaults:
FILE_EXTRACTION: {{ ZEEKMERGED.zeek.file_extraction }} FILE_EXTRACTION: {{ ZEEKMERGED.file_extraction }}
# Ensure the zeek spool tree (and state.db) ownership is correct # Ensure the zeek spool tree (and state.db) ownership is correct
zeekspoolownership: zeekspoolownership:
@@ -109,7 +109,7 @@ zeekctlcfg:
- group: 939 - group: 939
- template: jinja - template: jinja
- defaults: - defaults:
ZEEKCTL: {{ ZEEKMERGED.zeek.config.zeekctl | tojson }} ZEEKCTL: {{ ZEEKMERGED.config.zeekctl | tojson }}
# Sync node.cfg # Sync node.cfg
nodecfg: nodecfg:
@@ -120,7 +120,7 @@ nodecfg:
- group: 939 - group: 939
- template: jinja - template: jinja
- defaults: - defaults:
NODE: {{ ZEEKMERGED.zeek.config.node }} NODE: {{ ZEEKMERGED.config.node }}
networkscfg: networkscfg:
file.managed: file.managed:
@@ -130,7 +130,7 @@ networkscfg:
- group: 939 - group: 939
- template: jinja - template: jinja
- defaults: - defaults:
NETWORKS: {{ ZEEKMERGED.zeek.config.networks }} NETWORKS: {{ ZEEKMERGED.config.networks }}
#zeekcleanscript: #zeekcleanscript:
# file.managed: # file.managed:
@@ -198,7 +198,7 @@ localzeek:
- group: 939 - group: 939
- template: jinja - template: jinja
- defaults: - defaults:
LOCAL: {{ ZEEKMERGED.zeek.config.local | tojson }} LOCAL: {{ ZEEKMERGED.config.local | tojson }}
so-zeek: so-zeek:
docker_container.{{ ZEEKOPTIONS.status }}: docker_container.{{ ZEEKOPTIONS.status }}:

View File

@@ -5,10 +5,10 @@ zeek:
helpLink: zeek.html helpLink: zeek.html
config: config:
local: local:
'@load': load:
description: List of Zeek policies to load description: List of Zeek policies to load
helpLink: zeek.html helpLink: zeek.html
'@load-sigs': load-sigs:
description: List of Zeek signatures to load description: List of Zeek signatures to load
helpLink: zeek.html helpLink: zeek.html
node: node: