我第一次安装了nagios内核和插件,无法让它与SElinux一起工作。审计日志中的错误是,
type=AVC msg=audit(1441480084.865:710): avc: denied { execute } for
pid=5444 comm="httpd" name="statusjson.cgi" dev="dm-1" ino=135240040
scontext=system_u:system_r:httpd_t:s0
tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=file系统:Scientific Linux 7 Nagios:4.1.1
我是按照这里的指示
setenforce 0)时工作
(对于任何试图了解如何获取错误日志的人,SELinux策略在默认情况下似乎没有对httpd消息进行审计。我重新构建了SELinux策略,以便根据这篇文章启用所有审计消息
#semodule --disable_dontaudit --build并查看日志
#sealert -a /var/log/audit/audit.log > auditlog.log另外,听从海警的建议对我没有用)
发布于 2015-09-05 20:27:50
因此,将CGI脚本上的安全上下文更改为httpd_sys_script_exec_t似乎有效。虽然我不确定这是否是理想的解决办法。
chcon -R -t httpd_sys_script_exec_t /usr/local/nagios/sbin更多信息:https://fedoraproject.org/wiki/SELinux/apache
请注意,chcon只暂时更改上下文;如果重新标记文件系统或运行restorecon,则上下文将恢复为默认类型。要运行永久更改上下文,请运行:
semanage fcontext -a -t httpd_sys_script_exec_t /usr/local/nagios/sbin
restorecon -v /usr/local/nagios/sbinhttps://serverfault.com/questions/720352
复制相似问题