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 1482682 - Open vSwitch selinux policy needs updating
Summary: Open vSwitch selinux policy needs updating
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.5
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
Mirek Jahoda
URL:
Whiteboard:
: 1503820 1541926 (view as bug list)
Depends On:
Blocks: 1480897 1503566 1503820 1538936
TreeView+ depends on / blocked
 
Reported: 2017-08-17 21:12 UTC by Aaron Conole
Modified: 2021-08-30 11:46 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Prior to this update, the SELinux policy did not contain all the rules needed for Open vSwitch (OVS) 2.8.0. Consequently, this version of OVS did not work properly with SELinux in enforcing mode. With this update, new rules allowing creating `netlink_audit_` and `tun_` sockets, and the `kill` capability have been added to the policy. As a result, OVS 2.8.0 is now able to work properly with SELinux in enforcing mode.
Clone Of:
: 1538936 (view as bug list)
Environment:
Last Closed: 2018-04-10 12:38:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3331561 0 None None None 2018-01-24 17:06:58 UTC
Red Hat Product Errata RHBA-2018:0763 0 None None None 2018-04-10 12:40:51 UTC

Description Aaron Conole 2017-08-17 21:12:20 UTC
Description of problem:

Open vSwitch 2.8.0 will require a new policy in order to have selinux enabled, since it now runs as a non-root user.


The policy to be applied can be found at:

https://mail.openvswitch.org/pipermail/ovs-dev/2017-August/337516.html

In that file, the content between @begin_dpdk@ and @end_dpdk@ needs to be kept (but the lines that contain @begin_dpdk@ and @end_dpdk@ should be cut).

Comment 2 Aaron Conole 2017-08-17 21:14:39 UTC
also note that bz #1482682 also will want this change.

Comment 3 Aaron Conole 2017-08-17 21:15:16 UTC
Oops, I meant to write bz #1442372

Comment 4 Milos Malik 2017-08-18 08:32:02 UTC
Following SELinux denial appeared several times in enforcing mode:
----
type=PROCTITLE msg=audit(08/18/2017 04:28:38.630:302) : proctitle=runuser --user openvswitch -- ovsdb-tool -vconsole:off create /etc/openvswitch/conf.db /usr/share/openvswitch/vswitch.ovsschema 
type=SYSCALL msg=audit(08/18/2017 04:28:38.630:302) : arch=x86_64 syscall=socket success=no exit=EACCES(Permission denied) a0=netlink a1=SOCK_RAW a2=igp a3=0x7fff58dcffb0 items=0 ppid=31679 pid=31718 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=runuser exe=/usr/sbin/runuser subj=system_u:system_r:openvswitch_t:s0 key=(null) 
type=AVC msg=audit(08/18/2017 04:28:38.630:302) : avc:  denied  { create } for  pid=31718 comm=runuser scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=netlink_audit_socket 
----

Comment 5 Milos Malik 2017-08-18 08:34:43 UTC
Following SELinux denials appeared in permissive mode:
----
type=PROCTITLE msg=audit(08/18/2017 04:33:00.080:313) : proctitle=runuser --user openvswitch -- ovsdb-tool -vconsole:off schema-version /usr/share/openvswitch/vswitch.ovsschema 
type=SYSCALL msg=audit(08/18/2017 04:33:00.080:313) : arch=x86_64 syscall=socket success=yes exit=3 a0=netlink a1=SOCK_RAW a2=igp a3=0x7ffe4fc24ec0 items=0 ppid=20283 pid=20284 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=runuser exe=/usr/sbin/runuser subj=system_u:system_r:openvswitch_t:s0 key=(null) 
type=AVC msg=audit(08/18/2017 04:33:00.080:313) : avc:  denied  { create } for  pid=20284 comm=runuser scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=netlink_audit_socket 
----
type=PROCTITLE msg=audit(08/18/2017 04:33:00.080:314) : proctitle=runuser --user openvswitch -- ovsdb-tool -vconsole:off schema-version /usr/share/openvswitch/vswitch.ovsschema 
type=SYSCALL msg=audit(08/18/2017 04:33:00.080:314) : arch=x86_64 syscall=sendto success=yes exit=136 a0=0x3 a1=0x7ffe4fc1e660 a2=0x88 a3=0x0 items=0 ppid=20283 pid=20284 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=runuser exe=/usr/sbin/runuser subj=system_u:system_r:openvswitch_t:s0 key=(null) 
type=AVC msg=audit(08/18/2017 04:33:00.080:314) : avc:  denied  { audit_write } for  pid=20284 comm=runuser capability=audit_write  scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=capability 
type=AVC msg=audit(08/18/2017 04:33:00.080:314) : avc:  denied  { nlmsg_relay } for  pid=20284 comm=runuser scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=netlink_audit_socket 
----

Comment 6 Milos Malik 2017-08-18 09:09:44 UTC
----
type=PROCTITLE msg=audit(08/18/2017 04:46:23.876:383) : proctitle=/bin/sh /usr/s
hare/openvswitch/scripts/ovs-ctl --no-ovs-vswitchd stop 
type=SYSCALL msg=audit(08/18/2017 04:46:23.876:383) : arch=x86_64 syscall=kill s
uccess=no exit=EPERM(Operation not permitted) a0=0x51f2 a1=SIGKILL a2=0x0 a3=0x5
1f2 items=0 ppid=1 pid=31461 auid=unset uid=root gid=root euid=root suid=root fs
uid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=ovs-ctl exe=/u
sr/bin/bash subj=system_u:system_r:openvswitch_t:s0 key=(null) 
type=AVC msg=audit(08/18/2017 04:46:23.876:383) : avc:  denied  { kill } for  pi
d=31461 comm=ovs-ctl capability=kill  scontext=system_u:system_r:openvswitch_t:s
0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=capability 
----

I can't reproduce the other AVCs mentioned in https://mail.openvswitch.org/pipermail/ovs-dev/2017-August/337516.html but that's expected because I'm not familiar with openvswitch and DPDK.

Comment 9 Terry Wilson 2017-08-25 14:25:19 UTC
Arie, one thing you could try is making sure that this line in /etc/sysconfig/openvswitch:

OVS_USER_ID="openvswitch:openvswitch"

is removed, so that it runs as root and probably won't be selinux issues anymore.

Comment 10 Aaron Conole 2017-08-25 15:28:35 UTC
Would be better to set selinux enforcement mode to Permissive and then the selinux "problems" will be allowed, but the various errors will still be logged.

Comment 11 Terry Wilson 2017-08-25 15:45:59 UTC
oops, commented on the wrong bug. in bz 1480897, they are setting to permissive, but director is somehow setting it back to enforcing in the process. so services start, but then fail to function. I meant to suggest in the *other* bug that if he needed to move past this known issue for CI, he could just make that change and change it back when this issue is resolved.

Comment 13 Aaron Conole 2017-11-27 22:18:21 UTC
*** Bug 1503820 has been marked as a duplicate of this bug. ***

Comment 20 Timothy Redaelli 2018-02-05 11:20:42 UTC
*** Bug 1541926 has been marked as a duplicate of this bug. ***

Comment 23 errata-xmlrpc 2018-04-10 12:38:21 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:0763

Comment 24 Dan Kenigsberg 2018-04-19 19:25:01 UTC
*** Bug 1566373 has been marked as a duplicate of this bug. ***


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