Bug 959533 - SELinux is preventing /usr/bin/python2.7 from 'name_connect' accesses on the tcp_socket .
Summary: SELinux is preventing /usr/bin/python2.7 from 'name_connect' accesses on the ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:813f5a0b8f0716aa851387fbe57...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-03 17:36 UTC by Arindam Choudhury
Modified: 2013-05-21 08:42 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.11.1-95.fc18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-21 08:42:02 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Arindam Choudhury 2013-05-03 17:36:36 UTC
Description of problem:
glance image-create --name myFirstImage --is-public true --container-format bare --disk-format qcow2 --location https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
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:http_port_t:s0
Target Objects                 [ tcp_socket ]
Source                        glance-api
Source Path                   /usr/bin/python2.7
Port                          443
Host                          (removed)
Source RPM Packages           python-2.7.3-13.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-92.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) 3.8.11-200.fc18.x86_64 #1 SMP Wed
                              May 1 19:44:27 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-05-03 19:35:30 CEST
Last Seen                     2013-05-03 19:35:30 CEST
Local ID                      8164b416-2e28-4476-92e6-8222f20b2c95

Raw Audit Messages
type=AVC msg=audit(1367602530.560:396): avc:  denied  { name_connect } for  pid=3899 comm="glance-api" dest=443 scontext=system_u:system_r:glance_api_t:s0 tcontext=system_u:object_r:http_port_t:s0 tclass=tcp_socket


type=SYSCALL msg=audit(1367602530.560:396): arch=x86_64 syscall=connect success=no exit=EINPROGRESS a0=7 a1=7fff94c28740 a2=10 a3=df items=0 ppid=3892 pid=3899 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,http_port_t,tcp_socket,name_connect

audit2allow

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

audit2allow -R
require {
	type glance_api_t;
}

#============= glance_api_t ==============
corenet_tcp_connect_http_port(glance_api_t)


Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.11-200.fc18.x86_64
type:           libreport

Potential duplicate: bug 837330

Comment 1 Daniel Walsh 2013-05-07 20:19:51 UTC
920c45bfc78df5b751de90bca016975ca9cbc45f fixes this in git.

Comment 2 Miroslav Grepl 2013-05-07 21:14:06 UTC
Has been added also to F18.

commit 6c76f387cb289a544c8d6acf1cd00a58c8e68a51
Author: Miroslav Grepl <mgrepl>
Date:   Mon May 6 09:02:09 2013 +0200

    Allow glance-api to connect to http port to make glance image-create working

Comment 3 Fedora Update System 2013-05-07 21:30:12 UTC
selinux-policy-3.11.1-94.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-94.fc18

Comment 4 Fedora Update System 2013-05-09 10:12:47 UTC
Package selinux-policy-3.11.1-94.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-94.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-7743/selinux-policy-3.11.1-94.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-05-17 11:01:59 UTC
selinux-policy-3.11.1-95.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-95.fc18

Comment 6 Fedora Update System 2013-05-21 08:42:02 UTC
selinux-policy-3.11.1-95.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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