selinux-policy-targeted-3.5.13-40.fc10.noarch mysql init script calls another script /usr/bin/mysqld_safe which in turn starts /usr/libexec/mysqld. mysqld is running in proper domain, but mysqld_safe is not. either /usr/bin/mysqld_safe has to be labeled as mysqld_exec_t or, which I think is a proper way, as mysqld_initrc_exec_t, but a transition from mysqld_initrc_exec_t to mysqld_initrc_exec_t is allowed. # ps -efZ|grep mysql unconfined_u:system_r:initrc_t root 1079 1 0 12:03 pts/0 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/mysql/data --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --user=mysql unconfined_u:system_r:mysqld_t mysql 1126 1079 0 12:03 pts/0 00:00:01 /usr/libexec/mysqld --basedir=/usr --datadir=/var/mysql/data --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --socket=/var/lib/mysql/mysql.sock
Miroslav, I think it should be labeled mysqld_exec_t, and you will need to add can_exec(mysqld_t, mysqld_exec_t)
I thought the idea is "the least privileges". In this case we would grant permissions to a simple shell script to modify database files, which it shouldn't have. Isn't it?
I tried it and in this case also need to add: corecmd_exec_bin(mysqld_t) and also capabilities are appeared: allow mysqld_t self:capability { fowner chown }; Question is if we want the same domain for mysqld_safe and mysqld ?
Ok I guess we should have a new domain. Vadym, you can take least privileges too far, generating additional domains does not always generate a great deal more security, and greatly increases complexity. If two apps have basically the same defition they should have run in the same domain, and in the past we have grown too many domains. The best example of this is the handling of spam. We grew the number of different domains to handle spam mail with every new mail handler that showed up. Problem was each needed to interact with every other and policy was always broken. fowner and chown are two capabilities I would rather not give to mysqld, so I guess the best case is to generate a new domain. We have a goal of not having any initrc_t domains running.
Fixed in selinux-policy-3.5.13-45.fc10
This message is a reminder that Fedora 10 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 10. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '10'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 10's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 10 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping