mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
(ids) generate rc config from template
This commit is contained in:
parent
c464367a96
commit
cd35fb4110
@ -1,3 +1,20 @@
|
||||
{% set addFlags=[] %}
|
||||
{% if helpers.exists('OPNsense.IDS.general') and OPNsense.IDS.general.enabled|default("0") == "1" %}
|
||||
suricata_enable="YES"
|
||||
suricata_interface="em0"
|
||||
suricata_flags="-D -i em1 --pidfile /var/run/suricata_em1.pid"
|
||||
{% for intfName in OPNsense.IDS.general.interfaces.split(',') %}
|
||||
{% if loop.index == 1 %}
|
||||
{# enable first interface #}
|
||||
suricata_interface="{{helpers.getNodeByTag('interfaces.'+intfName).if}}"
|
||||
{% else %}
|
||||
{# store additional interfaces to addFlags #}
|
||||
{% do addFlags.append(helpers.getNodeByTag('interfaces.'+intfName).if) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{# append additional interfaces #}
|
||||
suricata_flags="{%
|
||||
for intf in addFlags
|
||||
%} -D -i {{ intf }} --pidfile /var/run/suricata_{{ intf }}.pid {% endfor
|
||||
%} "
|
||||
{% else %}
|
||||
suricata_enable="NO"
|
||||
{% endif %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user