diff --git a/src/opnsense/service/templates/OPNsense/IDS/newsyslog.conf b/src/opnsense/service/templates/OPNsense/IDS/newsyslog.conf index 463726bf2..c498ae12c 100644 --- a/src/opnsense/service/templates/OPNsense/IDS/newsyslog.conf +++ b/src/opnsense/service/templates/OPNsense/IDS/newsyslog.conf @@ -1,5 +1,5 @@ # logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] -{% if helpers.exists('OPNsense.IDS.general') and OPNsense.IDS.general.enabled|default("0") == "1" %} +{% if not helpers.empty('OPNsense.IDS.general.enabled') %} /var/log/suricata/stats.log root:wheel 640 7 * $D0 B /var/run/suricata.pid 1 /var/log/suricata/eve.json root:wheel 640 {{ OPNsense.IDS.general.AlertSaveLogs|default("4") }} 500000 ${{ OPNsense.IDS.general.AlertLogrotate|default("W0D23") diff --git a/src/opnsense/service/templates/OPNsense/IDS/rc.conf.d b/src/opnsense/service/templates/OPNsense/IDS/rc.conf.d index c14f14338..9f44ceb98 100644 --- a/src/opnsense/service/templates/OPNsense/IDS/rc.conf.d +++ b/src/opnsense/service/templates/OPNsense/IDS/rc.conf.d @@ -1,6 +1,6 @@ {# Macro import #} {% from 'OPNsense/Macros/interface.macro' import physical_interface %} -{% if helpers.exists('OPNsense.IDS.general') and OPNsense.IDS.general.enabled|default("0") == "1" %} +{% if not helpers.empty('OPNsense.IDS.general.enabled') %} suricata_var_script="/usr/local/opnsense/scripts/suricata/setup.sh" suricata_enable="YES" {% if OPNsense.IDS.general.ips|default("0") == "1" %} diff --git a/src/opnsense/service/templates/OPNsense/IDS/suricata.yaml b/src/opnsense/service/templates/OPNsense/IDS/suricata.yaml index e1d50438a..d90892409 100644 --- a/src/opnsense/service/templates/OPNsense/IDS/suricata.yaml +++ b/src/opnsense/service/templates/OPNsense/IDS/suricata.yaml @@ -98,7 +98,7 @@ outputs: ## Error, Warning, Notice, Info, Debug types: - alert: -{% if helpers.exists('OPNsense.IDS.general.LogPayload') and OPNsense.IDS.general.LogPayload|default('0') == '1' %} +{% if not helpers.empty('OPNsense.IDS.general.LogPayload') %} payload: yes payload-buffer-size: 100kb payload-printable: yes @@ -239,7 +239,7 @@ outputs: # a line based alerts log similar to fast.log into syslog - syslog: - enabled: {% if helpers.exists('OPNsense.IDS.general.syslog') and OPNsense.IDS.general.syslog|default('0') == '0' %}no{% else %}yes{% endif %} + enabled: {% if helpers.empty('OPNsense.IDS.general.syslog') %}no{% else %}yes{% endif %} # reported identity to syslog. If ommited the program name (usually # suricata) will be used. @@ -327,7 +327,7 @@ netmap: - interface: default threads: auto copy-mode: ips - disable-promisc: {% if helpers.exists('OPNsense.IDS.general.promisc') and OPNsense.IDS.general.promisc|default('0') == '0' %}yes{% else %}no{% endif %} # promiscuous mode + disable-promisc: {% if helpers.empty('OPNsense.IDS.general.promisc') %}yes{% else %}no{% endif %} # promiscuous mode checksum-checks: auto {% if helpers.exists('OPNsense.IDS.general.interfaces') %} @@ -758,7 +758,7 @@ logging: pcap: - interface: default - promisc: {% if helpers.exists('OPNsense.IDS.general.promisc') and OPNsense.IDS.general.promisc|default('0') == '1' %}yes{% else %}no{% endif %} # promiscuous mode + promisc: {% if not helpers.empty('OPNsense.IDS.general.promisc') %}yes{% else %}no{% endif %} # promiscuous mode pcap-file: # Possible values are: