Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
# Fail2Ban configuration file
2
#
3
# Author: Edgar Hoch
4
# Copied from iptables-new.conf and modified for use with firewalld by Edgar Hoch.
5
#  It uses "firewall-cmd" instead of "iptables".
6
#
7
# Because of the --remove-rules in stop this action requires firewalld-0.3.8+
8
 
9
[INCLUDES]
10
 
11
before = iptables-blocktype.conf
12
 
13
[Definition]
14
 
15
actionstart = firewall-cmd --direct --add-chain ipv4 filter fail2ban-<name>
16
              firewall-cmd --direct --add-rule ipv4 filter fail2ban-<name> 1000 -j RETURN
17
              firewall-cmd --direct --add-rule ipv4 filter <chain> 0 -m state --state NEW -p <protocol> --dport <port> -j fail2ban-<name>
18
 
19
actionstop = firewall-cmd --direct --remove-rule ipv4 filter <chain> 0 -m state --state NEW -p <protocol> --dport <port> -j fail2ban-<name>
20
             firewall-cmd --direct --remove-rules ipv4 filter fail2ban-<name>
21
             firewall-cmd --direct --remove-chain ipv4 filter fail2ban-<name>
22
 
23
actioncheck = firewall-cmd --direct --get-chains ipv4 filter | grep -Eq 'fail2ban-<name>$|fail2ban-<name> '
24
 
25
actionban = firewall-cmd --direct --add-rule ipv4 filter fail2ban-<name> 0 -s <ip> -j <blocktype>
26
 
27
actionunban = firewall-cmd --direct --remove-rule ipv4 filter fail2ban-<name> 0 -s <ip> -j <blocktype>
28
 
29
[Init]
30
 
31
# Default name of the chain
32
#
33
name = default
34
 
35
# Option:  port
36
# Notes.:  specifies port to monitor
37
# Values:  [ NUM | STRING ]
38
#
39
port = ssh
40
 
41
# Option:  protocol
42
# Notes.:  internally used by config reader for interpolations.
43
# Values:  [ tcp | udp | icmp | all ]
44
#
45
protocol = tcp
46
 
47
# Option:  chain
48
# Notes    specifies the iptables chain to which the fail2ban rules should be
49
#          added
50
# Values:  [ STRING ]
51
#
52
chain = INPUT_direct