Skip to content

Commit

Permalink
Merge pull request #12561 from Security-Onion-Solutions/jppnocap
Browse files Browse the repository at this point in the history
transitional pcap
  • Loading branch information
m0duspwnens authored Mar 11, 2024
2 parents 8c54a19 + ba32b3e commit b7f058a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
17 changes: 10 additions & 7 deletions salt/bpf/pcap.map.jinja
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
{% import 'bpf/macros.jinja' as MACROS %}

{{ MACROS.remove_comments(BPFMERGED, 'pcap') }}

{% set PCAPBPF = BPFMERGED.pcap %}
{% from 'vars/globals.map.jinja' import GLOBALS %}
{% if GLOBALS.pcap_engine == "TRANSITION" %}
{% set PCAPBPF = ["ip and host 255.255.255.1 and port 1"] %}
{% else %}
{% import_yaml 'bpf/defaults.yaml' as BPFDEFAULTS %}
{% set BPFMERGED = salt['pillar.get']('bpf', BPFDEFAULTS.bpf, merge=True) %}
{% import 'bpf/macros.jinja' as MACROS %}
{{ MACROS.remove_comments(BPFMERGED, 'pcap') }}
{% set PCAPBPF = BPFMERGED.pcap %}
{% endif %}
6 changes: 3 additions & 3 deletions salt/global/soc_global.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ global:
regexFailureMessage: You must enter either ZEEK or SURICATA.
global: True
pcapengine:
description: Which engine to use for generating pcap. Options are STENO and SURICATA.
regex: ^(STENO|SURICATA)$
regexFailureMessage: You must enter either STENO or SURICATA.
description: Which engine to use for generating pcap. Options are STENO, SURICATA or TRANSITION.
regex: ^(STENO|SURICATA|TRANSITION)$
regexFailureMessage: You must enter either STENO, SURICATA or TRANSITION.
global: True
ids:
description: Which IDS engine to use. Currently only Suricata is supported.
Expand Down
2 changes: 1 addition & 1 deletion salt/suricata/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% set surimeta_filestore_index = [] %}

{# before we change outputs back to list, enable pcap-log if suricata is the pcapengine #}
{% if GLOBALS.pcap_engine == "SURICATA" %}
{% if GLOBALS.pcap_engine in ["SURICATA", "TRANSITION"] %}
{% do SURICATAMERGED.config.outputs['pcap-log'].update({'enabled': 'yes'}) %}
{# move the items in suricata.pcap into suricata.config.outputs.pcap-log. these items were placed under suricata.config for ease of access in SOC #}
{% do SURICATAMERGED.config.outputs['pcap-log'].update({'compression': SURICATAMERGED.pcap.compression}) %}
Expand Down
2 changes: 1 addition & 1 deletion salt/suricata/pcap.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ suripcapdir:
- mode: 775
- makedirs: True
{% if GLOBALS.pcap_engine == "SURICATA" %}
{% if GLOBALS.pcap_engine in ["SURICATA", "TRANSITION"] %}
{# there should only be 1 interface in af-packet so we can just reference the first list item #}
{% for i in range(1, SURICATAMERGED.config['af-packet'][0].threads + 1) %}
Expand Down
2 changes: 1 addition & 1 deletion salt/telegraf/scripts/oldpcap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://securityonion.net/license; you may not use this file except in compliance with the
# Elastic License 2.0.

{%- if GLOBALS.pcap_engine == "SURICATA" %}
{%- if GLOBALS.pcap_engine in ["SURICATA", "TRANSITION"] %}
PCAPLOC=/host/nsm/suripcap
{%- else %}
PCAPLOC=/host/nsm/pcap
Expand Down

0 comments on commit b7f058a

Please sign in to comment.