Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1551585

Summary: Selinux policy block container from creating sockets - avc: denied { create } comm="yum" scontext=system_u:system_r:container_t:s0:c14,c957 tcontext=system_u:system_r:container_t:s0:c14,c957 tclass=udp_socket
Product: Red Hat Enterprise Linux 7 Reporter: Michael Mráka <mmraka>
Component: container-selinuxAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: ddarrah, dwalsh, lvrabec, mgrepl, mmalik, plautrba, ssekidde
Target Milestone: rcKeywords: Extras, Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: container-selinux-2.51-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-11 00:03:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Mráka 2018-03-05 13:05:40 UTC
Description of problem:
Can't run yum install or postgresql database in container.
Selinux policy prevents containers from creating sockets.

Version-Release number of selected component (if applicable):
selinux-policy-3.13.1-192.el7.noarch

How reproducible:
always

Steps to Reproduce:
1. on RHEL 7.5 host with selinux-policy-3.13.1-192.el7.noarch run e.g.:
2. docker run  --rm rhel7 yum list bash
3. grep AVC /var/log/audit.log


Actual results:
$ docker run  --rm rhel7 yum list bash
Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager
https://cdn.redhat.com/content/rc/rhel/server/7/x86_64/os/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: cdn.redhat.com; Name or service not known"
Trying other mirror.
...
$ grep AVC /var/log/audit.log
type=AVC msg=audit(1520253563.959:457): avc:  denied  { create } for  pid=8292 comm="yum" scontext=system_u:system_r:container_t:s0:c14,c957 tcontext=system_u:system_r:container_t:s0:c14,c957 tclass=udp_socket

Expected results:
$ docker run  --rm rhel7 yum list bash
Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager
Installed Packages
bash.x86_64                4.2.46-21.el7_3                @anaconda/7.3         
Available Packages
bash.x86_64                4.2.46-30.el7                  rhel-7-server-htb-rpms


Additional info:
Downgrading to selinux-policy-3.13.1-166.el7.noarch fixes problem.

Comment 1 Lukas Vrabec 2018-03-05 21:15:39 UTC
Dan, 

Could it be caused by renaming by update container-policy? Some kind of regression? 

In -166 it's working but in -192 not. 

Lukas.

Comment 2 Lokesh Mandvekar 2018-03-07 21:06:16 UTC
seems to work just fine for me:

lsm5 @ rhel75 : ~(master) $ sudo docker run --rm rhel7 yum list bash
Loaded plugins: ovl, product-id, search-disabled-repos, subscription-manager
This system is not receiving updates. You can use subscription-manager on the host to register and assign subscriptions.
Installed Packages
bash.x86_64                    4.2.46-29.el7_4                     @anaconda/7.4


lsm5 @ rhel75 : ~(master) $ rpm -q container-selinux selinux-policy docker
container-selinux-2.50-1.el7.noarch
selinux-policy-3.13.1-192.el7.noarch
docker-1.13.1-55.rhel75.git774336d.el7.x86_64

Comment 7 errata-xmlrpc 2018-04-11 00:03:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1073

Comment 8 Red Hat Bugzilla 2023-09-14 04:17:19 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days