Skip to content

Commit c4024a7

Browse files
committed
firewall configs
1 parent feb32cc commit c4024a7

File tree

11 files changed

+165
-1
lines changed

11 files changed

+165
-1
lines changed
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+
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/debian/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 = false
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

install/debian/firewall/ports.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PROTOCOL='TCP' PORT='20'
2+
PROTOCOL='TCP' PORT='21'
3+
PROTOCOL='TCP' PORT='22'
4+
PROTOCOL='TCP' PORT='25'
5+
PROTOCOL='UDP' PORT='53'
6+
PROTOCOL='TCP' PORT='80'
7+
PROTOCOL='TCP' PORT='443'
8+
PROTOCOL='TCP' PORT='110'
9+
PROTOCOL='UDP' PORT='123'
10+
PROTOCOL='TCP' PORT='143'
11+
PROTOCOL='TCP' PORT='3306'
12+
PROTOCOL='TCP' PORT='5432'
13+
PROTOCOL='TCP' PORT='8083'

install/debian/firewall/rules.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
RULE='1' ACTION='ACCEPT' PROTOCOL='ICMP' PORT='0' IP='0.0.0.0/0' COMMENT='PING' SUSPENDED='no' TIME='17:13:48' DATE='2014-09-16'
2+
RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='8083' IP='0.0.0.0/0' COMMENT='VESTA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
3+
RULE='3' ACTION='ACCEPT' PROTOCOL='TCP' PORT='3306,5432' IP='0.0.0.0/0' COMMENT='DB' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
4+
RULE='4' ACTION='ACCEPT' PROTOCOL='TCP' PORT='143,993' IP='0.0.0.0/0' COMMENT='IMAP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
5+
RULE='5' ACTION='ACCEPT' PROTOCOL='TCP' PORT='110,995' IP='0.0.0.0/0' COMMENT='POP3' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
6+
RULE='6' ACTION='ACCEPT' PROTOCOL='TCP' PORT='25,465,587,2525' IP='0.0.0.0/0' COMMENT='SMTP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
7+
RULE='7' ACTION='ACCEPT' PROTOCOL='UDP' PORT='53' IP='0.0.0.0/0' COMMENT='DNS' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
8+
RULE='8' ACTION='ACCEPT' PROTOCOL='TCP' PORT='21' IP='0.0.0.0/0' COMMENT='FTP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
9+
RULE='9' ACTION='ACCEPT' PROTOCOL='TCP' PORT='80,443' IP='0.0.0.0/0' COMMENT='WEB' SUSPENDED='no' TIME='17:04:27' DATE='2014-09-24'
10+
RULE='10' ACTION='ACCEPT' PROTOCOL='TCP' PORT='22' IP='0.0.0.0/0' COMMENT='SSH' SUSPENDED='no' TIME='17:14:41' DATE='2014-09-16'

install/rhel/fail2ban.jail.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ action = vesta[name=MAIL]
2525
logpath = /var/log/dovecot.log
2626

2727
[mysqld-iptables]
28-
enabled = true
28+
enabled = false
2929
filter = mysqld-auth
3030
action = vesta[name=DB]
3131
logpath = /var/log/mysqld.log
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+
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/ubuntu/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 = false
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

install/ubuntu/firewall/ports.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
PROTOCOL='TCP' PORT='20'
2+
PROTOCOL='TCP' PORT='21'
3+
PROTOCOL='TCP' PORT='22'
4+
PROTOCOL='TCP' PORT='25'
5+
PROTOCOL='UDP' PORT='53'
6+
PROTOCOL='TCP' PORT='80'
7+
PROTOCOL='TCP' PORT='443'
8+
PROTOCOL='TCP' PORT='110'
9+
PROTOCOL='UDP' PORT='123'
10+
PROTOCOL='TCP' PORT='143'
11+
PROTOCOL='TCP' PORT='3306'
12+
PROTOCOL='TCP' PORT='5432'
13+
PROTOCOL='TCP' PORT='8083'

0 commit comments

Comments
 (0)