]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
suricata: Always count the whitelisted packets
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 21 Sep 2024 10:39:32 +0000 (12:39 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Sep 2024 08:44:48 +0000 (08:44 +0000)
Even if there are no rules, if this does not exist, collectd will be
unhappy and we cannot generate the graph.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/suricata

index a80a32f782ef6244e598d6541797b935e0fe632c..86836ee8c2c6015c9a2015c0ae33420a2195c47a 100644 (file)
@@ -129,13 +129,13 @@ generate_fw_rules() {
                        iptables -w -t mangle -A IPS -s "${network}" -j MARK --set-mark "$(( IPS_WHITELISTED_MARK ))/$(( IPS_WHITELISTED_MASK ))"
                        iptables -w -t mangle -A IPS -d "${network}" -j MARK --set-mark "$(( IPS_WHITELISTED_MARK ))/$(( IPS_WHITELISTED_MASK ))"
                done < "/var/ipfire/suricata/ignored"
-
-               # Count and skip the whitelisted packets
-               iptables -w -t mangle -A IPS \
-                       -m comment --comment "WHITELISTED" \
-                       -m mark --mark "$(( IPS_WHITELISTED_MARK ))/$(( IPS_WHITELISTED_MASK ))" -j RETURN
        fi
 
+       # Count and skip the whitelisted packets
+       iptables -w -t mangle -A IPS \
+               -m comment --comment "WHITELISTED" \
+               -m mark --mark "$(( IPS_WHITELISTED_MARK ))/$(( IPS_WHITELISTED_MASK ))" -j RETURN
+
        # Send packets to suricata
        iptables -w -t mangle -A IPS -m comment --comment "SCANNED" -j NFQUEUE "${NFQ_OPTIONS[@]}"