summaryrefslogtreecommitdiff
path: root/data/templates/ids
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-04-10 20:38:27 +0200
committerChristian Poessinger <christian@poessinger.com>2022-04-10 20:55:35 +0200
commita7ccf0a9543f96eec7824926d4789281a68b876a (patch)
tree6326345f000f17dfd4f564080d2adb58b3462ce0 /data/templates/ids
parent264f86db9b7a965f6f3f096f70ea5f4f317ebebd (diff)
downloadvyos-1x-a7ccf0a9543f96eec7824926d4789281a68b876a.tar.gz
vyos-1x-a7ccf0a9543f96eec7824926d4789281a68b876a.zip
ids: T4333: bugfix - threshold loop
Diffstat (limited to 'data/templates/ids')
-rw-r--r--data/templates/ids/fastnetmon.tmpl22
1 files changed, 11 insertions, 11 deletions
diff --git a/data/templates/ids/fastnetmon.tmpl b/data/templates/ids/fastnetmon.tmpl
index 9d52be90a..b6bef9a68 100644
--- a/data/templates/ids/fastnetmon.tmpl
+++ b/data/templates/ids/fastnetmon.tmpl
@@ -25,27 +25,27 @@ unban_only_if_attack_finished = on
# For each subnet, list track speed in bps and pps for both directions
enable_subnet_counters = off
-{% if mode is vyos_defined('mirror')%}
+{% if mode.mirror is vyos_defined %}
mirror_afpacket = on
{% endif %}
-{% if direction is vyos_defined %}
-process_incoming_traffic = {{ 'on' if 'in' in direction else 'off '}}
-process_outgoing_traffic = {{ 'on' if 'out' in direction else 'off '}}
-{% endif %}
+process_incoming_traffic = {{ 'on' if direction is vyos_defined and 'in' in direction else 'off '}}
+process_outgoing_traffic = {{ 'on' if direction is vyos_defined and 'out' in direction else 'off '}}
-{% for thr, thr_value in threshold.items() %}
-{% if thr is vyos_defined('fps') %}
+{% if threshold is vyos_defined %}
+{% for thr, thr_value in threshold.items() %}
+{% if thr is vyos_defined('fps') %}
ban_for_flows = on
threshold_flows = {{ thr_value }}
-{% elif thr is vyos_defined('mbps') %}
+{% elif thr is vyos_defined('mbps') %}
ban_for_bandwidth = on
threshold_mbps = {{ thr_value }}
-{% elif thr is vyos_defined('pps') %}
+{% elif thr is vyos_defined('pps') %}
ban_for_pps = on
threshold_pps = {{ thr_value }}
-{% endif %}
-{% endfor %}
+{% endif %}
+{% endfor %}
+{% endif %}
{% if listen_interface is vyos_defined %}
interfaces = {{ listen_interface | join(',') }}