Bug 2213606

Summary: SELinux labels RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas process as zebra_t
Product: Red Hat Enterprise Linux 8 Reporter: Robert Scheck <redhat-bugzilla>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: low    
Version: 8.8CC: lvrabec, mmalik
Target Milestone: betaKeywords: Triaged
Target Release: 8.9Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-123.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-14 15:47:52 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 Robert Scheck 2023-06-08 17:06:15 UTC
Description of problem:
While trying to package RIPE Atlas Probe/Anchor for Fedora and EPEL, I had to learn that SELinux labels RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas process as zebra_t, which makes RIPE Atlas Probe/Anchor unusable as the SELinux Zebra policy forbids many things RIPE Atlas Probe/Anchor needs to work.

Fortunately, this seems to be an unintended side effect in the SELinux policy as shipped in Fedora and RHEL:

$ grep /usr/sbin/rip /etc/selinux/targeted/contexts/files/file_contexts
/usr/sbin/rip.* --      system_u:object_r:zebra_exec_t:s0
$ 

For the Zebra/FRR component 'rip' (Routing Information Protocol) a wildcard was placed which likely impacts all software starting with '/usr/sbin/rip', even if it's not related to Zebra/FRR at all. Thus I propose the following simple fix, that does not impact Zebra/FRR's 'rip' but unbreaks RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas (and I explicitly added a wildcard to cover possible future sub-components as well):

/usr/sbin/ripe-atlas.* -- system_u:object_r:bin_t:s0

Version-Release number of selected component (if applicable):
selinux-policy-targeted-3.14.3-117.el8.noarch

Actual Results:  
SELinux labels RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas process as zebra_t when started via ripe-atlas.service

Expected Results:  
SELinux labels RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas process as unconfined_t when started via ripe-atlas.service

Additional info:
Clone of bug #2213604 from Fedora for RHEL 8.

Comment 1 Zdenek Pytela 2023-06-28 20:23:53 UTC
Commit to backport:
b91d9a5b6 (HEAD -> rawhide, upstream/rawhide) Label only /usr/sbin/ripd and ripngd with zebra_exec_t

Comment 11 errata-xmlrpc 2023-11-14 15:47:52 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 (selinux-policy bug fix and enhancement update), 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-2023:7091