Bug 870514 - SELinux is preventing /usr/sbin/httpd from 'name_connect' accesses on the tcp_socket .
Summary: SELinux is preventing /usr/sbin/httpd from 'name_connect' accesses on the tcp...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 17
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:0617b4a453f5ecbf871809a2d2e...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-26 17:46 UTC by Chris Jones
Modified: 2013-05-18 10:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-04 11:51:34 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
File: type (9 bytes, text/plain)
2012-10-26 17:46 UTC, Chris Jones
no flags Details
File: hashmarkername (14 bytes, text/plain)
2012-10-26 17:47 UTC, Chris Jones
no flags Details

Description Chris Jones 2012-10-26 17:46:55 UTC
Additional info:
libreport version: 2.0.16
kernel:         3.5.3-1.fc17.x86_64

description:
:SELinux is preventing /usr/sbin/httpd from 'name_connect' accesses on the tcp_socket .
:
:*****  Plugin connect_ports (99.5 confidence) suggests  **********************
:
:If you want to allow /usr/sbin/httpd to connect to network port 6543
:Then you need to modify the port type.
:Do
:# semanage port -a -t PORT_TYPE -p tcp 6543
:    where PORT_TYPE is one of the following: dns_port_t, ocsp_port_t, kerberos_port_t, http_port_t, ocsp_port_t, kerberos_port_t.
:
:*****  Plugin catchall (1.49 confidence) suggests  ***************************
:
:If you believe that httpd should be allowed name_connect access on the  tcp_socket by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep httpd /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:httpd_t:s0
:Target Context                system_u:object_r:unreserved_port_t:s0
:Target Objects                 [ tcp_socket ]
:Source                        httpd
:Source Path                   /usr/sbin/httpd
:Port                          6543
:Host                          (removed)
:Source RPM Packages           httpd-2.2.22-4.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-156.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.5.3-1.fc17.x86_64 #1 SMP Wed Aug
:                              29 18:46:34 UTC 2012 x86_64 x86_64
:Alert Count                   4
:First Seen                    2012-10-24 23:41:41 BST
:Last Seen                     2012-10-26 18:42:01 BST
:Local ID                      988361fb-6c6a-48f0-bed5-8bd8bd42d3b4
:
:Raw Audit Messages
:type=AVC msg=audit(1351273321.794:5167): avc:  denied  { name_connect } for  pid=32464 comm="httpd" dest=6543 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
:
:
:type=SYSCALL msg=audit(1351273321.794:5167): arch=x86_64 syscall=connect success=no exit=EACCES a0=c a1=7f930f9996c8 a2=10 a3=40 items=0 ppid=27684 pid=32464 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm=httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)
:
:Hash: httpd,httpd_t,unreserved_port_t,tcp_socket,name_connect
:
:audit2allow
:
:#============= httpd_t ==============
:#!!!! This avc can be allowed using one of the these booleans:
:#     allow_ypbind, httpd_can_network_connect
:
:allow httpd_t unreserved_port_t:tcp_socket name_connect;
:
:audit2allow -R
:
:#============= httpd_t ==============
:#!!!! This avc can be allowed using one of the these booleans:
:#     allow_ypbind, httpd_can_network_connect
:
:allow httpd_t unreserved_port_t:tcp_socket name_connect;
:

Comment 1 Chris Jones 2012-10-26 17:46:58 UTC
Created attachment 633996 [details]
File: type

Comment 2 Chris Jones 2012-10-26 17:47:00 UTC
Created attachment 633997 [details]
File: hashmarkername

Comment 3 Daniel Walsh 2012-10-26 18:05:21 UTC
Why is apache trying to connect to 6543?

Comment 4 gdelx001 2013-05-17 18:46:10 UTC
In _my_ case 6543 is the port that mythweb httpd module uses to communicate with the (myth tv) mythbackend server.

Before there's a fix (if there's a fix), is there a suggested workaround?
(e.g. just randomly pick and assign one of the allowed port types above?)

Comment 5 Daniel Walsh 2013-05-17 21:27:29 UTC
Well I would pick http_port_t, should make the tool a little bit smarter to pick sort the list of possible ports with the most match.

semanage port -a -t http_port_t -p tcp 6543

Comment 6 gdelx001 2013-05-17 21:40:11 UTC
Thanks... http_port_t makes sense.

If it matters, for me, port 6544 also requires the same access opened, for the same reason.

Comment 7 Daniel Walsh 2013-05-18 10:19:22 UTC
You can define that port as an http_port_t also.


Note You need to log in before you can comment on or make changes to this bug.