| Line 3... |
Line 3... |
| 3 |
# Author: Donald Yandt
|
3 |
# Author: Donald Yandt
|
| 4 |
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
|
4 |
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
|
| 5 |
|
5 |
|
| 6 |
[INCLUDES]
|
6 |
[INCLUDES]
|
| 7 |
|
7 |
|
| 8 |
before = iptables-blocktype.conf
|
8 |
before = iptables-common.conf
|
| 9 |
|
9 |
|
| 10 |
[Definition]
|
10 |
[Definition]
|
| 11 |
|
11 |
|
| 12 |
actionstart = firewall-cmd --direct --add-chain ipv4 filter f2b-<name>
|
12 |
actionstart = firewall-cmd --direct --add-chain ipv4 filter f2b-<name>
|
| 13 |
firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 1000 -j RETURN
|
13 |
firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 1000 -j RETURN
|
| 14 |
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -m state --state NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
|
14 |
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -m conntrack --ctstate NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
|
| 15 |
|
15 |
|
| 16 |
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -m state --state NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
|
16 |
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -m conntrack --ctstate NEW -p <protocol> -m multiport --dports <port> -j f2b-<name>
|
| 17 |
firewall-cmd --direct --remove-rules ipv4 filter f2b-<name>
|
17 |
firewall-cmd --direct --remove-rules ipv4 filter f2b-<name>
|
| 18 |
firewall-cmd --direct --remove-chain ipv4 filter f2b-<name>
|
18 |
firewall-cmd --direct --remove-chain ipv4 filter f2b-<name>
|
| 19 |
|
19 |
|
| 20 |
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-apache-modsecurity$'
|
20 |
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-apache-modsecurity$'
|
| 21 |
|
21 |
|