Skip to content

Commit 27dabfb

Browse files
committed
firewall trigger
1 parent e498d87 commit 27dabfb

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed

install/rhel/firewall/banlist.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

install/rhel/firewall/chains.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

install/rhel/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/rhel/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'

src/deb/vesta/postinst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,10 @@ if [ -x "/usr/local/vesta/upd/add_sudo.sh" ]; then
2525
/usr/local/vesta/upd/add_sudo.sh
2626
fi
2727

28+
# Run Firewall trigger
29+
if [ -x "/usr/local/vesta/upd/add_firewall.sh" ]; then
30+
/usr/local/vesta/upd/add_firewall.sh
31+
fi
32+
2833

2934
exit 0

src/rpm/specs/vesta.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ if [ $1 -ge 2 ]; then
4646
if [ -e /usr/local/vesta/upd/add_sudo.sh ]; then
4747
/usr/local/vesta/upd/add_sudo.sh
4848
fi
49+
if [ -e /usr/local/vesta/upd/add_firewall.sh ]; then
50+
/usr/local/vesta/upd/add_firewall.sh
51+
fi
4952

5053
%files
5154
%{_vestadir}

upd/add_firewall.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
source /etc/profile.d/vesta.sh
4+
if [ ! -e "$VESTA/data/firewall" ]; then
5+
mkdir -p $VESTA/data/firewall
6+
chmod 770 $VESTA/data/firewall
7+
8+
cp $VESTA/install/rhel/firewall/* \
9+
$VESTA/data/firewall/
10+
chmod 660 $VESTA/data/firewall/*
11+
12+
source $VESTA/conf/vesta.conf
13+
if [ -z "$FIREWALL_SYSTEM" ]; then
14+
echo "FIREWALL_SYSTEM='iptables'" \
15+
>> $VESTA/conf/vesta.conf
16+
fi
17+
fi

0 commit comments

Comments
 (0)