Skip to content

Commit dd8f9fc

Browse files
Chore/config updates (hestiacp#4477)
* Add max connections per host for Exim, increase global limit * Add xferlog to logrotate * VSFTPD TLS 1.2 ciphers only * Run NPM Format * Apply changes to upgrade script --------- Co-authored-by: Jaap Marcus <9754650+jaapmarcus@users.noreply.github.com>
1 parent 7026957 commit dd8f9fc

File tree

7 files changed

+29
-2
lines changed

7 files changed

+29
-2
lines changed

install/deb/exim/exim4.conf.4.94.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ smtp_active_hostname = ${lookup dnsdb{>: defer_never,ptr=$interface_address}{${l
1414
add_environment = <; PATH=/bin:/usr/bin
1515
keep_environment =
1616
disable_ipv6 = true
17+
smtp_accept_max = 100
18+
smtp_accept_max_per_host = 20
1719

1820
smtputf8_advertise_hosts =
1921
domainlist local_domains = dsearch;/etc/exim4/domains/

install/deb/exim/exim4.conf.4.95.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ smtp_active_hostname = ${lookup dnsdb{>: defer_never,ptr=$interface_address}{${l
1414
add_environment = <; PATH=/bin:/usr/bin
1515
keep_environment =
1616
disable_ipv6 = true
17+
smtp_accept_max = 100
18+
smtp_accept_max_per_host = 20
1719

1820
SRS_SECRET = ${readfile{/etc/exim4/srs.conf}}
1921

install/deb/exim/exim4.conf.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ smtp_active_hostname = ${lookup dnsdb{>: defer_never,ptr=$interface_address}{${l
1414
add_environment = <; PATH=/bin:/usr/bin
1515
keep_environment =
1616
disable_ipv6 = true
17+
smtp_accept_max = 100
18+
smtp_accept_max_per_host = 20
1719

1820
smtputf8_advertise_hosts =
1921
domainlist local_domains = dsearch;/etc/exim4/domains/

install/deb/vsftpd/vsftpd.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
listen=YES
12
anonymous_enable=NO
23
local_enable=YES
34
write_enable=YES
@@ -10,7 +11,6 @@ connect_from_port_20=YES
1011
xferlog_std_format=YES
1112
dual_log_enable=YES
1213
chroot_local_user=YES
13-
listen=YES
1414
pam_service_name=vsftpd
1515
ftpd_banner=Welcome! Please note that all activity is logged.
1616
userlist_enable=NO
@@ -33,7 +33,7 @@ utf8_filesystem=YES
3333
ssl_enable=YES
3434
allow_anon_ssl=NO
3535
require_ssl_reuse=NO
36-
ssl_ciphers=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA256
36+
ssl_ciphers=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305
3737
ssl_sslv2=NO
3838
ssl_sslv3=NO
3939
ssl_tlsv1=NO

install/hst-install-debian.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,6 +1700,9 @@ if [ "$vsftpd" = 'yes' ]; then
17001700
touch /var/log/xferlog
17011701
chown root:adm /var/log/xferlog
17021702
chmod 640 /var/log/xferlog
1703+
if [ -s /etc/logrotate.d/vsftpd ] && ! grep -Fq "/var/log/xferlog" /etc/logrotate.d/vsftpd; then
1704+
sed -i 's|/var/log/vsftpd.log|/var/log/vsftpd.log /var/log/xferlog|g' /etc/logrotate.d/vsftpd
1705+
fi
17031706
update-rc.d vsftpd defaults > /dev/null 2>&1
17041707
systemctl start vsftpd >> $LOG
17051708
check_result $? "vsftpd start failed"

install/hst-install-ubuntu.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,9 @@ if [ "$vsftpd" = 'yes' ]; then
17241724
touch /var/log/xferlog
17251725
chown root:adm /var/log/xferlog
17261726
chmod 640 /var/log/xferlog
1727+
if [ -s /etc/logrotate.d/vsftpd ] && ! grep -Fq "/var/log/xferlog" /etc/logrotate.d/vsftpd; then
1728+
sed -i 's|/var/log/vsftpd.log|/var/log/vsftpd.log /var/log/xferlog|g' /etc/logrotate.d/vsftpd
1729+
fi
17271730
update-rc.d vsftpd defaults > /dev/null 2>&1
17281731
systemctl start vsftpd >> $LOG
17291732
check_result $? "vsftpd start failed"

install/upgrade/versions/1.9.0.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,20 @@ for package in $packages; do
8080
done
8181
done
8282

83+
# Add xferlog to vsftpd logrotate
84+
if [ -s /etc/logrotate.d/vsftpd ] && ! grep -Fq "/var/log/xferlog" /etc/logrotate.d/vsftpd; then
85+
sed -i 's|/var/log/vsftpd.log|/var/log/vsftpd.log /var/log/xferlog|g' /etc/logrotate.d/vsftpd
86+
fi
87+
88+
# Use only TLS 1.2 cipher suites for vsftpd
89+
if [ -s /etc/vsftpd.conf ]; then
90+
sed -i "s/ssl_ciphers.*/ssl_ciphers=ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305/g" /etc/vsftpd.conf
91+
fi
92+
93+
# Increase max connections and limit number of connections per host for Exim
94+
if [ -s /etc/exim4/exim4.conf.template ] && ! grep -Fq "smtp_accept_max" /etc/exim4/exim4.conf.template; then
95+
sed -i '/disable_ipv6 = true/a\smtp_accept_max = 100\nsmtp_accept_max_per_host = 20' /etc/exim4/exim4.conf.template
96+
fi
97+
8398
$BIN/v-add-user-notification 'admin' 'Hestia security has been upgraded' ' A new user "hestiaweb" has been created and is used for login. Make sure other Hestia packages are updated as well otherwise the system may not work as expected.'
8499
add_upgrade_message 'Security has been upgraded, A new user "hestiaweb" has been created and is used for login. Make sure other Hestia packages are updated as well otherwise the system may not work as expected.'

0 commit comments

Comments
 (0)