SELinux: pid=2174 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3"에 대해 { 실행 }이 거부되었습니다.

SELinux: pid=2174 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3"에 대해 { 실행 }이 거부되었습니다.

SELinux에 문제가 있습니다. 아파치가 실행될 수 있도록 활성화 setroubleshoot하는 것이 좋습니다 .mypol.ppsemodule -i mypol.pp

제안된 명령을 실행한 후에도 계속해서 다음과 같은 메시지가 나타납니다.

type=AVC msg=audit(1388119964.806:11): avc:  denied  { execute } for  pid=2174 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file

**** Invalid AVC allowed in current policy ***

type=AVC msg=audit(1388120085.792:29): avc:  denied  { execute } for  pid=2298 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file

**** Invalid AVC allowed in current policy ***

type=AVC msg=audit(1388120159.57:37): avc:  denied  { execute } for  pid=2330 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file

**** Invalid AVC allowed in current policy ***

type=AVC msg=audit(1388121088.955:65): avc:  denied  { name_connect } for  pid=2331 comm="httpd" dest=8080 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_cache_port_t:s0 tclass=tcp_socket

**** Invalid AVC allowed in current policy ***

found 0 alerts in /var/log/audit/audit.log

답변1

아래 내용은 라벨을 다시 지정하는 데 문제가 있음을 나타냅니다.

type=AVC msg=audit(1388119964.806:11): avc: denied { execute } for pid=2174 comm="httpd" path="/etc/httpd/lib/libaprutil-1.so.0.5.3" dev=md0 ino=2228931 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_config_t:s0 tclass=file

/etc/httpd/lib다른 곳으로의 심볼릭 링크 가 있습니까 ? 일반적으로 여기에 라이브러리를 넣지 않고 심볼릭 링크로만 넣습니다. 그렇다면 restorecon -Rv /usr/lib{,64}여기서 달리는 것이 도움이 될 수 있습니다.

아래에 보고된 두 번째 문제가 작동하려면 SELinux가 httpd 서비스에서 어떤 종류의 동작을 기대하는지 인식해야 합니다.

type=AVC msg=audit(1388121088.955:65): avc: denied { name_connect } for pid=2331 comm="httpd" dest=8080 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:http_cache_port_t:s0 tclass=tcp_socket

httpd_can_network_relay를 실행하여 부울을 활성화합니다 setsebool -P httpd_can_network_relay 1.

답변2

메시지에 대해서는 잘 모르지만 **** Invalid AVC allowed in current policy ***우리는여기에 대한 Q&A이미

당신이 제공하는 텍스트를 실행audit2allow제안

#============= httpd_t ==============

allow httpd_t http_cache_port_t:tcp_socket name_connect;
allow httpd_t httpd_config_t:file execute;

따라서 grep을 사용하여 관련 AVC 거부 메시지를 임시 파일로 가져온 다음 audit2allow에 전달할 수 있습니다.

grep denied: audit.log | grep httpd >temp.log

cat temp.log | audit2allow -M myHTTPD
******************** IMPORTANT ***********************
To make this policy package active, execute:

semodule -i myHTTPD.pp

myHTTPD.pp를 설치한 후에도 SElinux가 httpd 시작을 중지하는 것을 발견할 수 있습니다. 이는 이전(현재 허용된) 거부가 더 이상 이후 거부를 마스킹하지 않기 때문입니다. 매번 위의 과정을 반복하면 됩니다.

관련 정보