BREAKING: config-files should be owned by mysql-user #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
According to CIS-recommendations, mysql logfiles and the datadir belong to the user
mysql.We do this exactly like this, however the config-files under
/etc/mysql/*are checked that they belong to userroot.I know that having least privileges is a good idea and I'm in favor of this.
However I propose to let the config-files belong to user
mysql, too, because:640), so only the user that runs mysql has access to these files.rootbut then forks to usermysql. There it makes sense thatrootis the owner of the config. However in operating systems with systemd, the process is directly started as usermysql. This means that the process cannot read its config-files if they belong toroot. (see: https://mariadb.com/kb/en/systemd/)The mysql-docs state to this topic (https://dev.mysql.com/doc/mysql-secure-deployment-guide/8.0/en/secure-deployment-post-install.html#secure-deployment-startup-options):
While the config-file belongs to root here, it is readable by everyone.
Signed-off-by: Sebastian Gumprich [email protected]