34 |
- |
1 |
# Fail2Ban configuration file
|
|
|
2 |
#
|
|
|
3 |
# Author: Donald Yandt
|
|
|
4 |
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
[INCLUDES]
|
|
|
8 |
|
87 |
- |
9 |
before = iptables-common.conf
|
34 |
- |
10 |
|
|
|
11 |
[Definition]
|
|
|
12 |
|
|
|
13 |
actionstart = firewall-cmd --direct --add-chain ipv4 filter f2b-<name>
|
|
|
14 |
firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 1000 -j RETURN
|
|
|
15 |
firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -j f2b-<name>
|
|
|
16 |
|
|
|
17 |
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -j f2b-<name>
|
|
|
18 |
firewall-cmd --direct --remove-rules ipv4 filter f2b-<name>
|
|
|
19 |
firewall-cmd --direct --remove-chain ipv4 filter f2b-<name>
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
# Example actioncheck: firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-recidive$'
|
|
|
23 |
|
|
|
24 |
actioncheck = firewall-cmd --direct --get-chains ipv4 filter | sed -e 's, ,\n,g' | grep -q '^f2b-<name>$'
|
|
|
25 |
|
|
|
26 |
actionban = firewall-cmd --direct --add-rule ipv4 filter f2b-<name> 0 -s <ip> -j <blocktype>
|
|
|
27 |
|
|
|
28 |
actionunban = firewall-cmd --direct --remove-rule ipv4 filter f2b-<name> 0 -s <ip> -j <blocktype>
|
|
|
29 |
|
|
|
30 |
[Init]
|
|
|
31 |
|
|
|
32 |
# Default name of the chain
|
|
|
33 |
#
|
|
|
34 |
name = default
|
|
|
35 |
|
|
|
36 |
chain = INPUT_direct
|
|
|
37 |
|
|
|
38 |
# DEV NOTES:
|
|
|
39 |
#
|
|
|
40 |
# Author: Donald Yandt
|
|
|
41 |
# Uses "FirewallD" instead of the "iptables daemon".
|
|
|
42 |
#
|
|
|
43 |
#
|
|
|
44 |
# Output:
|
|
|
45 |
|
|
|
46 |
# actionstart:
|
|
|
47 |
# $ firewall-cmd --direct --add-chain ipv4 filter f2b-recidive
|
|
|
48 |
# success
|
|
|
49 |
# $ firewall-cmd --direct --add-rule ipv4 filter f2b-recidive 1000 -j RETURN
|
|
|
50 |
# success
|
|
|
51 |
# $ sudo firewall-cmd --direct --add-rule ipv4 filter INPUT_direct 0 -j f2b-recidive
|
|
|
52 |
# success
|
|
|
53 |
|