您的位置:首页 > 运维架构 > Linux

Linux基础备忘_07: SELinux之利用te来调通bugzilla

2017-04-07 15:39 351 查看
问题由bugzilla无法使用mysql引起,mysql.sock(13)是permission deny,关闭selinux则OK。

但是奇怪的是audit.log中并无AVC信息,即使已经semodule -DB.

audit.log的问题已解决:注意一下audit.log的权限,service auditd才能正确启动

AVC信息是:

type=AVC msg=audit(1491554195.794:3271): avc:  denied  { connectto } for  pid=25432 comm="index.cgi" path="/var/lib/mysql/mysql.sock" scontext=system_u:system_r:        httpd_sys_script_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c102
4000
3
tclass=unix_stream_socket

试图用以下方法解决:

1)getsebool on若干以httpd,mysql为关键字的变量,无效。另:无关键字sock的变量

2)te加入semodule的方式:

grep httpd_sys_script_t audit.log | audit2allow -m httpd > httpd.te

checkmodule -M -m -o httpd.mod httpd.te

semodule_package -m httpd.mod -o httpd.pp

semodule -i httpd.pp

此时解决了mysql.sock(13),但又出现了新的deny,需要重新加入allow,其中也有可能不再是httpd_sys_script_t

关于更详细的te,参考http://serverfault.com/questions/321301/how-do-i-view-the-contents-of-a-selinux-policy-package
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: