php72-fpm 的 selinux 权限

selinux permissions for php72-fpm

php72

的 selinux 权限

我在 audit.log

中得到了这些
type=AVC msg=audit(1556103659.046:16944): avc:  denied  { execute } for  pid=30415 comm="php-fpm" path="/opt/remi/php72/root/usr/lib64/php/modules/amazon-elasticache-cluster-client.so" dev="xvda1" ino=11870411 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file permissive=1
type=SYSCALL msg=audit(1556103659.046:16944): arch=c000003e syscall=9 success=yes exit=140351971074048 a0=0 a1=259860 a2=5 a3=802 items=0 ppid=1 pid=30415 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="php-fpm" exe="/opt/remi/php72/root/usr/sbin/php-fpm" subj=system_u:system_r:httpd_t:s0 key=(null)

允许 php-fpm 访问 amazon-elasticache-cluster-client.so

的正确方法是什么

我认为当模块从用户目录(因此使用其 selinux 上下文)移动而不是被复制时会发生这种情况。

恢复默认上下文应该可以修复此 AVC

restorecon -R /opt/remi/php72/root/usr/lib64/php/modules