|
|
|
@ -17,10 +17,9 @@ actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -m state
|
|
|
|
|
firewall-cmd --direct --remove-rules ipv4 filter f2b-<name>
|
|
|
|
|
firewall-cmd --direct --remove-chain ipv4 filter f2b-<name>
|
|
|
|
|
|
|
|
|
|
# Note: uses regular expression whitespaces '\s' & end of line '$'
|
|
|
|
|
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | grep -q '\sf2b-apache-modsecurity$'
|
|
|
|
|
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-apache-modsecurity$'
|
|
|
|
|
|
|
|
|
|
actioncheck = firewall-cmd --direct --get-chains ipv4 filter | grep -q '\sf2b-<name>$'
|
|
|
|
|
actioncheck = firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-<name>$'
|
|
|
|
|
|
|
|
|
|
actionban = firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 0 -s <ip> -j <blocktype>
|
|
|
|
|
|
|
|
|
@ -59,6 +58,6 @@ protocol = tcp
|
|
|
|
|
# $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -m state --state NEW -p tcp -m multiport --dports 80,443 -j f2b-apache-modsecurity
|
|
|
|
|
# success
|
|
|
|
|
# actioncheck:
|
|
|
|
|
# $ firewall-cmd --direct --get-chains ipv4 filter f2b-apache-modsecurity | grep -q '\sf2b-apache-modsecurity$'
|
|
|
|
|
# $ firewall-cmd --direct --get-chains ipv4 filter f2b-apache-modsecurity | sed -e 's, ,\n,g' | grep -q '^f2b-apache-modsecurity$'
|
|
|
|
|
# f2b-apache-modsecurity
|
|
|
|
|
|
|
|
|
|