Commit bb2be712 authored by Ad Schellevis's avatar Ad Schellevis

(ids) template for user defined rules

parent f53146b3
......@@ -4,11 +4,17 @@
# User defined rules
#
# -- SSL fingerprint rules
{% if helpers.exists('OPNsense.IDS.rules.fingerprint') %}
{% for rule in helpers.toList('OPNsense.IDS.rules.fingerprint') %}
# -- User defined rules
{% if helpers.exists('OPNsense.IDS.userDefinedRules.rule') %}
{% for rule in helpers.toList('OPNsense.IDS.userDefinedRules.rule') %}
{% if rule.enabled|default('0') == '1' %}
{{rule.action}} tls any any -> any any (msg:"{{rule.description.replace('"','\"')}}"; tls.fingerprint:"{{rule.fingerprint.lower()}}"; sid:{{4294967295 - loop.index}}; rev:1;)
{{rule.action}} tls any any -> any any (msg:"{{rule.description.replace('"','\"')}}"; {%
if rule.fingerprint|default('') != "" %} tls.fingerprint:"{{rule.fingerprint.lower()}}";{% endif
%}{%
if rule.geoip|default('') != ""%} geoip:{% if rule.geoip_direction|default('') != '' %}{{rule.geoip_direction}},{% endif %}{{rule.geoip}} ;{% endif
%} sid:{{
4294967295 - loop.index
}}; rev:1;)
{% endif %}
{% endfor %}
{% endif %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment