Skip to content

Commit b79338b

Browse files
committed
Fail2ban RHEL configuration
1 parent cf3ed3e commit b79338b

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

install/rhel/fail2ban.action.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Fail2Ban configuration file for vesta
2+
3+
[Definition]
4+
5+
actionstart = /usr/local/vesta/bin/v-add-firewall-chain <name>
6+
actionstop = /usr/local/vesta/bin/v-delete-firewall-chain <name>
7+
actioncheck = iptables -n -L INPUT | grep -q 'fail2ban-<name>[ \t]'
8+
actionban = /usr/local/vesta/bin/v-add-firewall-ban <ip> <name>
9+
actionunban = /usr/local/vesta/bin/v-delete-firewall-ban <ip> <name>
10+

install/rhel/fail2ban.filter.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Fail2Ban filter for unsuccesfull Vesta authentication attempts
2+
#
3+
4+
[INCLUDES]
5+
before = common.conf
6+
7+
[Definition]
8+
failregex = .* <HOST> failed to login
9+
ignoreregex =
10+

install/rhel/fail2ban.jail.conf

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[ssh-iptables]
2+
enabled = true
3+
filter = sshd
4+
action = vesta[name=SSH]
5+
logpath = /var/log/secure
6+
maxretry = 5
7+
8+
[vsftpd-iptables]
9+
enabled = false
10+
filter = vsftpd
11+
action = vesta[name=FTP]
12+
logpath = /var/log/vsftpd.log
13+
maxretry = 5
14+
15+
[exim-iptables]
16+
enabled = true
17+
filter = exim
18+
action = vesta[name=MAIL]
19+
logpath = /var/log/exim/main.log
20+
21+
[dovecot-iptables]
22+
enabled = true
23+
filter = dovecot
24+
action = vesta[name=MAIL]
25+
logpath = /var/log/dovecot.log
26+
27+
[mysqld-iptables]
28+
enabled = true
29+
filter = mysqld-auth
30+
action = vesta[name=DB]
31+
logpath = /var/log/mysqld.log
32+
maxretry = 5
33+
34+
[vesta-iptables]
35+
enabled = true
36+
filter = vesta
37+
action = vesta[name=VESTA]
38+
logpath = /var/log/vesta/auth.log
39+
maxretry = 5

0 commit comments

Comments
 (0)