selinux允许和types定位

我正在运行6.2

最近我注意到Apache启用了selinux

# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=Permissive # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted 

我注意到这些错误是在dmesg上发生的

 type=1400 audit(1354453732.704:9056368): avc: denied { name_connect } for pid=39006 comm="httpd" dest=11211 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:memcache_port_t:s0 tclass=tcp_socket type=1400 audit(1354453735.777:9056369): avc: denied { name_connect } for pid=39046 comm="httpd" dest=6379 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:port_t:s0 tclass=tcp_socket 

我然后启用

  /usr/sbin/setsebool httpd_can_network_connect=1 

这就阻止了错误,并且网页也开始工作。

我的问题是,如果selinux是在宽容模式将selinuxtype =有针对性强制执行任何政策?

如果不是如何解决与Apache的问题作为selinux已经在宽容模式?

在许可模式下,SElinux将logging可能会导致在执行模式下拒绝访问的项目,但实际上并不会拒绝这些操作。 所以不行,它不会执行宽松模式下的政策,但会咨询这些政策。 如果你在强制执行模式下,你将不能启动/使用httpd,直到你发出setsebool命令,因为它和networking连接之间的链接已经被SELinux阻止了。

正如John已经回答的那样,SELinux只logging错误,而不是阻塞服务。

在将SElinux部署到生产环境之前,我们使用SElinux进行testing,并希望了解可能出错的情况。

虽然您也可以在生产环境中testing相同的产品,并且不断修复策略,直到您确定所有事情都已到位,然后再将模式更改为有针对性。