Bug 909547

Summary: SELinux is preventing /usr/bin/python2.7 from 'name_connect' accesses on the tcp_socket .
Product: [Fedora] Fedora Reporter: Niki Guldbrand <niki.guldbrand>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:e52ab1477ec8a1a161d0688200c23c96c7425cc6c343b91c7e9b9722ea972c09
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-25 12:46:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Niki Guldbrand 2013-02-09 10:08:04 UTC
Description of problem:
Trying to connect glance to a PostgreSQL backend
SELinux is preventing /usr/bin/python2.7 from 'name_connect' accesses on the tcp_socket .

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that python2.7 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 glance-api /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:glance_api_t:s0
Target Context                system_u:object_r:postgresql_port_t:s0
Target Objects                 [ tcp_socket ]
Source                        glance-api
Source Path                   /usr/bin/python2.7
Port                          5432
Host                          (removed)
Source RPM Packages           python-2.7.3-13.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-74.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.5-201.fc18.x86_64 #1 SMP Mon
                              Jan 28 19:54:41 UTC 2013 x86_64 x86_64
Alert Count                   80
First Seen                    2013-02-09 11:08:48 CET
Last Seen                     2013-02-09 11:10:29 CET
Local ID                      ec22854d-f36f-49d8-9e45-15456a01e1ba

Raw Audit Messages
type=AVC msg=audit(1360404629.305:1131): avc:  denied  { name_connect } for  pid=16118 comm="glance-api" dest=5432 scontext=system_u:system_r:glance_api_t:s0 tcontext=system_u:object_r:postgresql_port_t:s0 tclass=tcp_socket


type=SYSCALL msg=audit(1360404629.305:1131): arch=x86_64 syscall=connect success=no exit=EACCES a0=5 a1=2e2c7d0 a2=10 a3=7fff1f8f8fa4 items=0 ppid=14955 pid=16118 auid=4294967295 uid=161 gid=161 euid=161 suid=161 fsuid=161 egid=161 sgid=161 fsgid=161 ses=4294967295 tty=(none) comm=glance-api exe=/usr/bin/python2.7 subj=system_u:system_r:glance_api_t:s0 key=(null)

Hash: glance-api,glance_api_t,postgresql_port_t,tcp_socket,name_connect

audit2allow

#============= glance_api_t ==============
allow glance_api_t postgresql_port_t:tcp_socket name_connect;

audit2allow -R

#============= glance_api_t ==============
allow glance_api_t postgresql_port_t:tcp_socket name_connect;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.5-201.fc18.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-02-11 11:42:44 UTC
*** Bug 909548 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2013-02-11 12:14:50 UTC
Fixed in selinux-policy-3.11.1-77.fc18