Subversion Repositories configs

Rev

Rev 5 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5 - 1
# Fail2Ban action file for firewall-cmd/ipset
2
#
3
# This requires:
4
# ipset (package: ipset)
5
# firewall-cmd (package: firewalld)
6
#
7
# This is for ipset protocol 6 (and hopefully later) (ipset v6.14).
8
# Use ipset -V to see the protocol and version.
9
#
10
# IPset was a feature introduced in the linux kernel 2.6.39 and 3.0.0 kernels.
11
#
12
# If you are running on an older kernel you make need to patch in external
13
# modules.
14
 
15
[INCLUDES]
16
 
34 - 17
before = iptables-common.conf
5 - 18
 
19
[Definition]
20
 
21
actionstart = ipset create fail2ban-<name> hash:ip timeout <bantime>
22
              firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set fail2ban-<name> src -j <blocktype>
23
 
24
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -p <protocol> -m multiport --dports <port> -m set --match-set fail2ban-<name> src -j <blocktype>
25
             ipset flush fail2ban-<name>
26
             ipset destroy fail2ban-<name>
27
 
28
actionban = ipset add fail2ban-<name> <ip> timeout <bantime> -exist
29
 
30
actionunban = ipset del fail2ban-<name> <ip> -exist
31
 
32
[Init]
33
 
34
# Option:  chain
35
# Notes    specifies the iptables chain to which the fail2ban rules should be
36
#          added
37
# Values:  [ STRING ]
38
#
39
chain = INPUT_direct
40
 
41
# Option: bantime
42
# Notes:  specifies the bantime in seconds (handled internally rather than by fail2ban)
43
# Values:  [ NUM ]  Default: 600
44
 
45
bantime = 600
46
 
47
 
48
# DEV NOTES:
49
#
50
# Author: Edgar Hoch and Daniel Black
51
# firewallcmd-new / iptables-ipset-proto6 combined for maximium goodness