22 SELinux changed Apache port | sealert -l id | grep AVC /var/log/audit/audit.log | semanage port -a -t http_port_t -p tcp 888


Listen 888

[root@localhost ~]# vim /etc/httpd/conf/httpd.conf 
[root@localhost ~]# systemctl stop httpd
[root@localhost ~]# systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
[root@localhost ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2017-09-23 15:04:01 EDT; 14s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 13914 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 13909 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 13909 (code=exited, status=1/FAILURE)

[root@localhost ~]# grep sealert /var/log/messages
Sep 23 15:04:08 localhost setroubleshoot: SELinux is preventing /usr/sbin/httpd from name_bind access on the tcp_socket port 888. For complete SELinux messages. run sealert -l fe09cca3-697b-44bc-812f-ec4e28a18d48
===================
[root@localhost ~]# sealert -l fe09cca3-697b-44bc-812f-ec4e28a18d48
# semanage port -a -t PORT_TYPE -p tcp 888
Additional Information:
Source Context                system_u:system_r:httpd_t:s0
Target Context                system_u:object_r:hi_reserved_port_t:s0
Target Objects                port 888 [ tcp_socket ]
Source                        httpd
Source Path                   /usr/sbin/httpd
Port                          888
Host                          localhost.localdomain
===================
[root@localhost ~]# grep AVC /var/log/audit/audit.log 
type=AVC msg=audit(1506193440.896:838): avc:  denied  { name_bind } for  pid=13909 comm="httpd" src=888 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:hi_reserved_port_t:s0 tclass=tcp_socket
===================
[root@localhost ~]# semanage port -a -t PORT_TYPE -p tcp 888
ValueError: Type PORT_TYPE is invalid, must be a port type
[root@localhost ~]# semanage port -a -t http_port_t -p tcp 888
===================
systemctl restart httpd





Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all