Bug 753844

Summary: SELinux is preventing /usr/sbin/httpd from 'name_bind' accesses on the tcp_socket port 12345.
Product: [Fedora] Fedora Reporter: szymon
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:01d84367b09342c14587893dfefe970eed7e05a2b17503f995b58ae7f8459a63
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-14 20:15:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description szymon 2011-11-14 16:41:40 UTC
libreport version: 2.0.6
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.1.0-7.fc16.i686.PAE
reason:         SELinux is preventing /usr/sbin/httpd from 'name_bind' accesses on the tcp_socket port 12345.
time:           Mon Nov 14 11:41:18 2011

description:
:SELinux is preventing /usr/sbin/httpd from 'name_bind' accesses on the tcp_socket port 12345.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If aby httpd powinno mieć domyślnie name_bind dostęp do port 12345 tcp_socket.
:Then proszę to zgłosić jako błąd.
:Można utworzyć lokalny moduł polityki, aby umożliwić ten dostęp.
:Do
:można tymczasowo zezwolić na ten dostęp wykonując polecenia:
:# grep httpd /var/log/audit/audit.log | audit2allow -M moja_polityka
:# semodule -i moja_polityka.pp
:
:Additional Information:
:Source Context                system_u:system_r:httpd_t:s0
:Target Context                system_u:object_r:unreserved_port_t:s0
:Target Objects                port 12345 [ tcp_socket ]
:Source                        httpd
:Source Path                   /usr/sbin/httpd
:Port                          12345
:Host                          (removed)
:Source RPM Packages           httpd-2.2.21-1.fc16
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-55.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.1.0-7.fc16.i686.PAE #1 SMP Tue Nov
:                              1 20:53:45 UTC 2011 i686 i686
:Alert Count                   1
:First Seen                    pon, 14 lis 2011, 11:25:41
:Last Seen                     pon, 14 lis 2011, 11:25:41
:Local ID                      feb49c09-8895-4016-b878-ba517bea3fc6
:
:Raw Audit Messages
:type=AVC msg=audit(1321287941.628:187): avc:  denied  { name_bind } for  pid=31428 comm="httpd" src=12345 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket
:
:
:type=SYSCALL msg=audit(1321287941.628:187): arch=i386 syscall=socketcall success=no exit=EACCES a0=2 a1=bfd8fc00 a2=9b21fc a3=217dc3e0 items=0 ppid=1 pid=31428 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 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_bind
:
:audit2allow
:
:#============= httpd_t ==============
:allow httpd_t unreserved_port_t:tcp_socket name_bind;
:
:audit2allow -R
:
:#============= httpd_t ==============
:allow httpd_t unreserved_port_t:tcp_socket name_bind;
:

Comment 1 Daniel Walsh 2011-11-14 20:15:38 UTC
There is a bug in the alert system which should have given you this suggestion

*****  Plugin bind_ports (99.5 confidence) suggests  *************************

If you want to allow httpd to bind to network port 12345
Then you need to modify the port type.
Do
# semanage port -a -t PORT_TYPE -p tcp 12345
    where PORT_TYPE is one of the following: ntop_port_t, http_cache_port_t, http_port_t, puppet_port_t, jboss_management_port_t.



Meaning most likely this is a local customization and you should execute

# semanage port -a -t http_port_t -p tcp 12345

I will fix setroubleshoot.