selinux를 활성화하면 nginx는 기본 가상 호스트 파일에 어떻게 액세스합니까?

selinux를 활성화하면 nginx는 기본 가상 호스트 파일에 어떻게 액세스합니까?

내가 아는 한 은(는) nginx보안 컨텍스트에서 실행되고 있으며 예를 들어 다음 중 하나입니다.httpd_tindex.htmlusr_t

$ ps auxZ | grep 'nginx.*worker'
system_u:system_r:httpd_t:s0    nginx    13734  0.0  0.2 112948  3600 ?        S    02:07   0:00 nginx: worker process

$ ls -Z /usr/share/nginx/html/index.html
-rw-r--r--. root root system_u:object_r:usr_t:s0       /usr/share/nginx/html/index.html

그렇다면 여기서는 CentOS 7을 실행하고 있습니다.

답변1

내가 아는 한:

$ sesearch -A -t usr_t -p read | grep 'httpd usr_t'
   allow httpd_t usr_t : file { ioctl read getattr execute execute_no_trans open } ;
   allow httpd_t usr_t : dir { ioctl read getattr lock search open } ;
   allow httpd_t usr_t : lnk_file { read getattr } ;

아마도 이는 웹 서버가 usr_t파일에 액세스할 수 있음을 의미합니다. 게다가, usr_t폭넓게 읽을 수 있다고 들었습니다 .

관련 정보