Bug 2213604 - SELinux labels RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas process as zebra_t
Summary: SELinux labels RIPE Atlas Probe/Anchor's /usr/sbin/ripe-atlas process as zebra_t
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-08 16:58 UTC by Robert Scheck
Modified: 2023-06-29 16:44 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-06-29 16:44:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1768 0 None open Label only /usr/sbin/ripd and ripngd with zebra_exec_t 2023-06-28 20:02:14 UTC

Internal Links: 2213605 2213606

Description Robert Scheck 2023-06-08 16:58:49 UTC
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

Reproducible: Always

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

Comment 1 Zdenek Pytela 2023-06-28 20:02:15 UTC
Thank you for the report, good catch. The regexp actually matches also rip89d from ax25-tools, so I changed it to 2 individual entries. All of it can probably be removed anyway later as system executables are usually in /usr/libexec now.


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