mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 01:32:47 +01:00
bpf for pcap
This commit is contained in:
4
salt/bpf/pcap.map.jinja
Normal file
4
salt/bpf/pcap.map.jinja
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
|
||||||
|
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
|
||||||
|
|
||||||
|
{% set PCAPBPF = BPFMERGED.pcap %}
|
||||||
@@ -2,12 +2,15 @@ bpf:
|
|||||||
pcap:
|
pcap:
|
||||||
description: List of BPF filters to apply to PCAP.
|
description: List of BPF filters to apply to PCAP.
|
||||||
multiline: True
|
multiline: True
|
||||||
|
forcedType: "[]string"
|
||||||
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
|
multiline: True
|
||||||
|
forcedType: "[]string"
|
||||||
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
|
multiline: True
|
||||||
|
forcedType: "[]string"
|
||||||
helpLink: bpf.html
|
helpLink: bpf.html
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||||
{% from "pcap/map.jinja" import STENOOPTIONS with context %}
|
{% from "pcap/map.jinja" import STENOOPTIONS with context %}
|
||||||
{% from "pcap/config.map.jinja" import PCAPMERGED with context %}
|
{% from "pcap/config.map.jinja" import PCAPMERGED with context %}
|
||||||
{% set INTERFACE = salt['pillar.get']('sensor:interface', 'bond0') %}
|
{% from 'bpf/pcap.map.jinja' import PCAPBPF %}
|
||||||
{% set BPF_STENO = salt['pillar.get']('bpf:pcap', None) %}
|
|
||||||
{% set BPF_COMPILED = "" %}
|
{% set BPF_COMPILED = "" %}
|
||||||
|
|
||||||
# PCAP Section
|
# PCAP Section
|
||||||
@@ -33,8 +33,8 @@ stenoconfdir:
|
|||||||
- group: 939
|
- group: 939
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
|
|
||||||
{% if BPF_STENO %}
|
{% if PCAPBPF %}
|
||||||
{% set BPF_CALC = salt['cmd.script']('/usr/sbin/so-bpf-compile', INTERFACE + ' ' + BPF_STENO|join(" "),cwd='/root') %}
|
{% set BPF_CALC = salt['cmd.script']('/usr/sbin/so-bpf-compile', GLOBALS.sensor.interface + ' ' + PCAPBPF|join(" "),cwd='/root') %}
|
||||||
{% if BPF_CALC['stderr'] == "" %}
|
{% if BPF_CALC['stderr'] == "" %}
|
||||||
{% set BPF_COMPILED = ",\\\"--filter=" + BPF_CALC['stdout'] + "\\\"" %}
|
{% set BPF_COMPILED = ",\\\"--filter=" + BPF_CALC['stdout'] + "\\\"" %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
Reference in New Issue
Block a user