![selinux를 활성화하면 nginx는 기본 가상 호스트 파일에 어떻게 액세스합니까?](https://linux55.com/image/90306/selinux%EB%A5%BC%20%ED%99%9C%EC%84%B1%ED%99%94%ED%95%98%EB%A9%B4%20nginx%EB%8A%94%20%EA%B8%B0%EB%B3%B8%20%EA%B0%80%EC%83%81%20%ED%98%B8%EC%8A%A4%ED%8A%B8%20%ED%8C%8C%EC%9D%BC%EC%97%90%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%EC%95%A1%EC%84%B8%EC%8A%A4%ED%95%A9%EB%8B%88%EA%B9%8C%3F.png)
내가 아는 한 은(는) nginx
보안 컨텍스트에서 실행되고 있으며 예를 들어 다음 중 하나입니다.httpd_t
index.html
usr_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
폭넓게 읽을 수 있다고 들었습니다 .