move zeek bpf from zeek pillar to bpf pillar

This commit is contained in:
m0duspwnens
2023-03-20 15:28:33 -04:00
parent 460f84d80f
commit 903ad530fe
7 changed files with 21 additions and 8 deletions

View File

@@ -19,6 +19,8 @@ base:
'*_eval or *_heavynode or *_sensor or *_standalone or *_import': '*_eval or *_heavynode or *_sensor or *_standalone or *_import':
- match: compound - match: compound
- zeek - zeek
- bpf.soc_bpf
- bpf.adv_bpf
'*_managersearch or *_heavynode': '*_managersearch or *_heavynode':
- match: compound - match: compound

View File

@@ -1,4 +1,5 @@
bpf: bpf:
pcap: [] pcap: []
suricata: [] suricata: []
zeek: [] zeek:
- ip or not ip

View File

@@ -1,10 +1,13 @@
bpf: bpf:
pcap: pcap:
description: List of BPF filters to apply to PCAP. description: List of BPF filters to apply to PCAP.
multiline: True
helpLink: bpf.html helpLink: bpf.html
suricata: suricata:
description: List of BPF filters to apply to Suricata. description: List of BPF filters to apply to Suricata.
multiline: True
helpLink: bpf.html helpLink: bpf.html
zeek: zeek:
description: List of BPF filters to apply to Zeek. description: List of BPF filters to apply to Zeek.
multiline: True
helpLink: bpf.html helpLink: bpf.html

4
salt/bpf/zeek.map.jinja Normal file
View File

@@ -0,0 +1,4 @@
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
{% set ZEEKBPF = BPFMERGED.zeek %}

View File

@@ -1,12 +1,14 @@
{% from 'vars/elasticsearch.map.jinja' import ELASTICSEARCH_GLOBALS %} {% from 'vars/elasticsearch.map.jinja' import ELASTICSEARCH_GLOBALS %}
{% from 'vars/logstash.map.jinja' import LOGSTASH_GLOBALS %} {% from 'vars/logstash.map.jinja' import LOGSTASH_GLOBALS %}
{% from 'vars/sensor.map.jinja' import SENSOR_GLOBALS %}
{% set ROLE_GLOBALS = {} %} {% set ROLE_GLOBALS = {} %}
{% set STANDALONE_GLOBALS = {% set STANDALONE_GLOBALS =
[ [
ELASTICSEARCH_GLOBALS, ELASTICSEARCH_GLOBALS,
LOGSTASH_GLOBALS LOGSTASH_GLOBALS,
SENSOR_GLOBALS
] ]
%} %}

View File

@@ -102,4 +102,3 @@ zeek:
- application/vnd.ms-powerpoint.presentation.macroenabled.12: doc - application/vnd.ms-powerpoint.presentation.macroenabled.12: doc
- application/vnd.ms-powerpoint.slideshow.macroenabled.12: doc - application/vnd.ms-powerpoint.slideshow.macroenabled.12: doc
- application/vnd.openxmlformats-officedocument: doc - application/vnd.openxmlformats-officedocument: doc
bpf: []

View File

@@ -10,6 +10,8 @@
{% from "zeek/config.map.jinja" import ZEEKOPTIONS with context %} {% from "zeek/config.map.jinja" import ZEEKOPTIONS with context %}
{% from "zeek/config.map.jinja" import ZEEKMERGED with context %} {% from "zeek/config.map.jinja" import ZEEKMERGED with context %}
{% from 'bpf/zeek.map.jinja' import ZEEKBPF %}
{% set BPF_STATUS = 0 %} {% set BPF_STATUS = 0 %}
# Zeek Salt State # Zeek Salt State
@@ -162,8 +164,8 @@ zeekpacketlosscron:
- dayweek: '*' - dayweek: '*'
# BPF compilation and configuration # BPF compilation and configuration
{% if ZEEKMERGED.zeek.bpf %} {% if ZEEKBPF %}
{% set BPF_CALC = salt['cmd.script']('/usr/sbin/so-bpf-compile', GLOBALS.sensor.interface + ' ' + ZEEKMERGED.zeek.bpf|join(" "),cwd='/root') %} {% set BPF_CALC = salt['cmd.script']('/usr/sbin/so-bpf-compile', GLOBALS.sensor.interface + ' ' + ZEEKBPF|join(" "),cwd='/root') %}
{% if BPF_CALC['stderr'] == "" %} {% if BPF_CALC['stderr'] == "" %}
{% set BPF_STATUS = 1 %} {% set BPF_STATUS = 1 %}
{% else %} {% else %}
@@ -181,7 +183,7 @@ zeekbpf:
- user: 940 - user: 940
- group: 940 - group: 940
{% if BPF_STATUS %} {% if BPF_STATUS %}
- contents: {{ ZEEKMERGED.bpf }} - contents: {{ ZEEKBPF }}
{% else %} {% else %}
- contents: - contents:
- "ip or not ip" - "ip or not ip"