]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
suricata: Add rule to skip IPS if a packet has the bypass bit set
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Oct 2021 10:10:19 +0000 (10:10 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Tue, 19 Oct 2021 11:34:43 +0000 (11:34 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Tested-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
src/initscripts/system/suricata

index 5ccea9391443a3e92abb85254189189ed14310de..2577621b8f0617e5b01c8bd60ddd8361c3d2572e 100644 (file)
@@ -134,6 +134,12 @@ function generate_fw_rules {
        # Flush the firewall chains.
        flush_fw_chain
 
+       # Skip anything that has the bypass bit set
+       local chain
+       for chain in "${IPS_INPUT_CHAIN}" "${IPS_FORWARD_CHAIN}" "${IPS_OUTPUT_CHAIN}"; do
+               iptables -w -A "${chain}" -m mark --mark "${BYPASS_MARK}/${BYPASS_MASK}" -j RETURN
+       done
+
        # Check if the array of enabled_ips_zones contains any elements.
        if [[ ${enabled_ips_zones[@]} ]]; then
                # Loop through the array and create firewall rules.