Eu tenho problemas com o SELinux. setroubleshoot
sugerido ativar mypol.pp
com semodule -i mypol.pp
para que o Apache pudesse ser executado.
depois de executar o comando sugerido, continuo recebendo:
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
Responder1
O texto abaixo indica que você tem um problema de renomeação.
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
um link simbólico para outro lugar? Normalmente você não colocaria suas bibliotecas aqui, mas apenas como um link simbólico. Nesse caso, correr restorecon -Rv /usr/lib{,64}
pode ser benéfico aqui.
Para que o segundo problema relatado abaixo funcione, você precisa garantir que o SELinux esteja ciente do tipo de comportamento que você espera do seu serviço 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 o booleano httpd_can_network_relay
executando setsebool -P httpd_can_network_relay 1
.
Responder2
Não sei sobre a
**** Invalid AVC allowed in current policy ***
mensagem, mas temos umPerguntas e respostas sobre isso aquijá
Executando o texto que você forneceaudit2allowsugere
#============= httpd_t ==============
allow httpd_t http_cache_port_t:tcp_socket name_connect;
allow httpd_t httpd_config_t:file execute;
então você pode tentar usar o grep para extrair as mensagens AVC negadas relevantes para um arquivo temporário e depois passá-lo para 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
Depois de instalar o myHTTPD.pp, você ainda poderá descobrir que o SElinux interrompe a inicialização do httpd. Isso ocorre porque as negações anteriores (agora permitidas) não mascaram mais as posteriores. Basta repetir o processo acima a cada vez.