httpd, avc: 거부됨 { unix_read unix_write }

httpd, avc: 거부됨 { unix_read unix_write }

나는 selinux 개념을 처음 접했고 여기서 httpd가 {unix_read unix_write}를 수행하도록 만드는 방법에 대해 고민하고 있습니다. 다음은 감사 로그 메시지입니다.

type=IPC msg=audit(1624375715.312:4225): ouid=0 ogid=0 mode=0666 obj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
type=PROCTITLE msg=audit(1624375715.312:4225): proctitle=2F7573722F7362696E2F6874747064002D44464F524547524F554E44
type=AVC msg=audit(1624375724.580:4226): avc:  denied  { unix_read unix_write } for  pid=25626 comm="httpd" key=1392707921  scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=shm permissive=0
type=SYSCALL msg=audit(1624375724.580:4226): arch=c000003e syscall=29 success=no exit=-13 a0=53030951 a1=4338 a2=1b6 a3=6b items=0 ppid=25612 pid=25626 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)


[root@localhost build]# audit2allow  -w -a
type=AVC msg=audit(1624375724.580:4226): avc:  denied  { unix_read unix_write } for  pid=25626 comm="httpd" key=1392707921  scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 tclass=shm permissive=0
        Was caused by:
                Missing type enforcement (TE) allow rule.

                You can use audit2allow to generate a loadable module to allow this access.

[root@localhost build]# audit2allow   -a


#============= httpd_t ==============
allow httpd_t unconfined_t:shm { unix_read unix_write };
[root@localhost build]# allow httpd_t unconfined_t:shm { unix_read unix_write };
bash: allow: command not found
[root@localhost build]#

해결책은 httpd_t가 unconfined_t에서 shm을 실행하도록 허용하는 것 같지만 이는 올바르지 않습니다. key=1392707921에 대해 shm에 unconfined_t가 어떻게 필요한지 모르겠습니다.

관련 정보