Skip to content

Commit 0f5963e

Browse files
committed
Hardening MySQL configuration, prevent local infile.
Closes hestiacp#663
1 parent 318384b commit 0f5963e

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ All notable changes to this project will be documented in this file.
6060
- Added robots.txt for roundcube webmail to prevent search bot crawling.
6161
- Re-Enable force ssl function on let's encrypt certification renew.
6262
- Added official postgresql repository to be up to date.
63+
- Hardening MySQL configuration, prevent local infile.
6364

6465
## [1.0.6] - 2019-09-24 - Hotfix
6566
### Bugfixes

install/deb/mysql/my-large.cnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ lc-messages-dir=/usr/share/mysql
1717
log_error=/var/log/mysql/error.log
1818

1919
symbolic-links=0
20+
local-infile=0
2021

2122
skip-external-locking
2223
key_buffer_size = 256M

install/deb/mysql/my-medium.cnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ lc-messages-dir=/usr/share/mysql
1717
log_error=/var/log/mysql/error.log
1818

1919
symbolic-links=0
20+
local-infile=0
2021

2122
skip-external-locking
2223
key_buffer_size = 16M

install/deb/mysql/my-small.cnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ lc-messages-dir=/usr/share/mysql
1717
log_error=/var/log/mysql/error.log
1818

1919
symbolic-links=0
20+
local-infile=0
2021

2122
skip-external-locking
2223
key_buffer_size = 16K

install/upgrade/versions/latest.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,13 @@ if [ -e "/etc/postgresql" ]; then
140140
wget --quiet https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /tmp/psql_signing.key
141141
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add /tmp/psql_signing.key > /dev/null 2>&1
142142
rm /tmp/psql_signing.key
143-
fi
143+
fi
144+
145+
# Hardening MySQL configuration, prevent local infile.
146+
if [ -e "/etc/mysql/my.cnf" ]; then
147+
mysql_local_infile_check=$(grep local-infile /etc/mysql/my.cnf)
148+
if [ -z "$mysql_local_infile_check" ]; then
149+
echo "(*) Hardening MySQL configuration..."
150+
sed -i '/symbolic-links\=0/a\local-infile=0' /etc/mysql/my.cnf
151+
fi
152+
fi

0 commit comments

Comments
 (0)