4 |
- |
1 |
# Fail2Ban configuration file
|
|
|
2 |
#
|
|
|
3 |
# Author: Daniel Black
|
|
|
4 |
#
|
|
|
5 |
# This is for ipset protocol 6 (and hopefully later) (ipset v6.14).
|
|
|
6 |
# Use ipset -V to see the protocol and version. Version 4 should use
|
|
|
7 |
# iptables-ipset-proto4.conf.
|
|
|
8 |
#
|
|
|
9 |
# This requires the program ipset which is normally in package called ipset.
|
|
|
10 |
#
|
|
|
11 |
# IPset was a feature introduced in the linux kernel 2.6.39 and 3.0.0 kernels.
|
|
|
12 |
#
|
|
|
13 |
# If you are running on an older kernel you make need to patch in external
|
|
|
14 |
# modules which probably won't be protocol version 6.
|
|
|
15 |
|
|
|
16 |
[INCLUDES]
|
|
|
17 |
|
|
|
18 |
before = iptables-blocktype.conf
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
[Definition]
|
|
|
22 |
|
|
|
23 |
# Option: actionstart
|
|
|
24 |
# Notes.: command executed once at the start of Fail2Ban.
|
|
|
25 |
# Values: CMD
|
|
|
26 |
#
|
|
|
27 |
actionstart = ipset create fail2ban-<name> hash:ip timeout <bantime>
|
|
|
28 |
iptables -I INPUT -m set --match-set fail2ban-<name> src -j <blocktype>
|
|
|
29 |
|
|
|
30 |
# Option: actionstop
|
|
|
31 |
# Notes.: command executed once at the end of Fail2Ban
|
|
|
32 |
# Values: CMD
|
|
|
33 |
#
|
|
|
34 |
actionstop = iptables -D INPUT -m set --match-set fail2ban-<name> src -j <blocktype>
|
|
|
35 |
ipset flush fail2ban-<name>
|
|
|
36 |
ipset destroy fail2ban-<name>
|
|
|
37 |
|
|
|
38 |
# Option: actionban
|
|
|
39 |
# Notes.: command executed when banning an IP. Take care that the
|
|
|
40 |
# command is executed with Fail2Ban user rights.
|
|
|
41 |
# Tags: See jail.conf(5) man page
|
|
|
42 |
# Values: CMD
|
|
|
43 |
#
|
|
|
44 |
actionban = ipset add fail2ban-<name> <ip> timeout <bantime> -exist
|
|
|
45 |
|
|
|
46 |
# Option: actionunban
|
|
|
47 |
# Notes.: command executed when unbanning an IP. Take care that the
|
|
|
48 |
# command is executed with Fail2Ban user rights.
|
|
|
49 |
# Tags: See jail.conf(5) man page
|
|
|
50 |
# Values: CMD
|
|
|
51 |
#
|
|
|
52 |
actionunban = ipset del fail2ban-<name> <ip> -exist
|
|
|
53 |
|
|
|
54 |
[Init]
|
|
|
55 |
|
|
|
56 |
# Default name of the ipset
|
|
|
57 |
#
|
|
|
58 |
name = default
|
|
|
59 |
|
|
|
60 |
# Option: bantime
|
|
|
61 |
# Notes: specifies the bantime in seconds (handled internally rather than by fail2ban)
|
|
|
62 |
# Values: [ NUM ] Default: 600
|
|
|
63 |
|
|
|
64 |
bantime = 600
|