SELinux – 允许多个服务访问相同的/ home / dir

我目前已经启用了SELinux,并且已经能够configurationApache来允许通过chcon命令访问/ home / src / web,授予“httpd_sys_content_t”types。 但是现在我正在尝试从同一目录提供rsyslogd.conf文件,但每次启动rsyslogd时,都会在我的审计日志中看到一条logging,说明rsyslogd被拒绝访问。 我的问题是,是否有可能授予两个应用程序访问同一目录的能力,同时仍然保持SELinux启用?

/ home / src上的当前perms:

 drwxr-xr-x. src src unconfined_u:object_r:httpd_sys_content_t:s0 src 

审核日志消息:

 type=AVC msg=audit(1349113476.272:1154): avc: denied { search } for pid=9975 comm="rsyslogd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:home_root_t:s0 tclass=dir type=SYSCALL msg=audit(1349113476.272:1154): arch=c000003e syscall=2 success=no exit=-13 a0=7f9ef0c027f5 a1=0 a2=1b6 a3=0 items=0 ppid=9974 pid=9975 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=30 comm="rsyslogd" exe="/sbin/rsyslogd" subj=unconfined_u:system_r:syslogd_t:s0 key=(null) 

– 编辑 –

遇到这个post ,这是我想要完成的。 但是,当我查看允许的sebool params列表时,唯一与系统日志相关的是:syslogd_disable_trans(SELinux服务保护),好像我可以在/home/src/ dir中维护当前的SELinuxtypes,但是将bool设置为syslogd_disable_trans为false。 我想知道是否有更好的方法?

由于我还在学习SELinux,我试图不实现自定义的SELinux策略包,但在这种情况下,我似乎没有select。 所以我遵循这个post的原始答案,并能够得到rsyslog与/ home / src / web发挥很好。

types强制有助于防止进程访问供其他进程使用的文件。 例如,默认情况下,Samba无法读取标记为httpd_sys_content_ttypes的文件,这些文件将供Apache HTTP Server使用。 如果所需文件标有public_content_t或public_content_rw_ttypes,则可以在Apache HTTP Server,FTP,rsync和Samba之间共享文件。

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-Configuration_examples-Sharing_files_between_services.html