Add block_ports variable
This commit is contained in:
parent
a0d41ed859
commit
1fcd29028d
|
@ -79,6 +79,7 @@ else
|
|||
echo "blocklist=\"/etc/blockauth/blocklist.list\"" >> /etc/blockauth/blockauth.conf
|
||||
echo "filelog=\"/etc/blockauth/blockauth.log\"" >> /etc/blockauth/blockauth.conf
|
||||
echo "max_ip_blocklist=\"12500\"" >> /etc/blockauth/blockauth.conf
|
||||
echo "block_ports=\"22,80,443\"" >> /etc/blockauth/blockauth.conf
|
||||
fi
|
||||
|
||||
# Check integrity of configuration file
|
||||
|
@ -97,6 +98,9 @@ fi
|
|||
if [ -z "${max_ip_blocklist}" ] ; then
|
||||
echo "max_ip_blocklist=\"12500\"" >> /etc/blockauth/blockauth.conf
|
||||
fi
|
||||
if [ -z "${block_ports}" ] ; then
|
||||
echo "block_ports=\"22,80,443\"" >> /etc/blockauth/blockauth.conf
|
||||
fi
|
||||
source /etc/blockauth/blockauth.conf
|
||||
|
||||
# Force edit configuration file
|
||||
|
@ -155,7 +159,7 @@ while [ ${blockauth} -eq 0 ] ; do
|
|||
if [ -z "${read_block_ip}" ] ; then
|
||||
echo "blockauth: blocking ip ${block_ip}"
|
||||
echo "blockauth: blocking ip ${block_ip}" >> ${filelog}
|
||||
iptables -A OUTPUT -p tcp -d ${block_ip} --sport 22 -j DROP
|
||||
iptables -A OUTPUT -p tcp -m multiport -d ${block_ip} --sports ${block_ports} -j DROP
|
||||
fi
|
||||
done
|
||||
# Reduce log
|
||||
|
|
Loading…
Reference in New Issue
Block a user