Tengo un problema con SELinux. setroubleshoot
Se sugirió habilitar mypol.pp
con semodule -i mypol.pp
para que Apache pudiera ejecutarse.
Después de ejecutar el comando sugerido, sigo recibiendo:
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
Respuesta1
Lo siguiente me indica que tiene un problema de reetiquetado.
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
¿Es /etc/httpd/lib
un enlace simbólico a otro lugar? Normalmente no colocarías tus bibliotecas aquí, sino sólo como un enlace simbólico. Si es así, correr restorecon -Rv /usr/lib{,64}
podría ser beneficioso aquí.
Para que funcione el segundo problema que se informa a continuación, debe asegurarse de que SELinux sepa qué tipo de comportamiento espera de su servicio 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
Habilite el booleano httpd_can_network_relay
ejecutando setsebool -P httpd_can_network_relay 1
.
Respuesta2
No sé sobre el
**** Invalid AVC allowed in current policy ***
mensaje pero tenemos unPreguntas y respuestas al respecto aquíya
Ejecutar el texto que proporcionasauditoría2permitirsugiere
#============= httpd_t ==============
allow httpd_t http_cache_port_t:tcp_socket name_connect;
allow httpd_t httpd_config_t:file execute;
entonces podrías intentar usar grep para extraer los mensajes denegados AVC relevantes a un archivo temporal y luego pasarlo a 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
Después de instalar myHTTPD.pp, es posible que aún encuentre que SElinux impide que httpd se inicie. Esto se debe a que las negaciones anteriores (ahora permitidas) ya no enmascaran las posteriores. Simplemente repita el proceso anterior cada vez.