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 2211566 - SELinux prevents the rhsmcertd-worker from executing the ip command
Summary: SELinux prevents the rhsmcertd-worker from executing the ip command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: selinux-policy
Version: 9.3
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Nobody
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-01 05:24 UTC by Pino Toscano
Modified: 2023-11-07 11:22 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-38.1.15-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:52:30 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1723 0 None open Allow subscription-manager execute ip 2023-06-01 15:12:33 UTC
Red Hat Issue Tracker RHELPLAN-158764 0 None None None 2023-06-01 05:30:02 UTC
Red Hat Product Errata RHBA-2023:6617 0 None None None 2023-11-07 08:52:45 UTC

Description Pino Toscano 2023-06-01 05:24:44 UTC
Description of problem:
We (subscription-manager team) are working to change how subscription-manager collects network facts, making use of `ip` from the iproute package. When a first draft of the change was tested with QE's help, the result was that rhsmcertd-worker (spawned by rhsmcertd) does now allow this execution -- for example:

type=AVC msg=audit(1684773208.054:13797): avc:  denied  { execute } for  pid=57312 comm="rhsmcertd-worke" name="ip" dev="vda1" ino=12803826 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:ifconfig_exec_t:s0 tclass=file permissive=0

The `ip` usage seems to not trigger denials when run from the subscription-manager CLI, e.g. when registering using `subscription-manager register` or a simpler `subscription-manager facts` (to trigger the facts collection).

Hence, please allow rhsmcertd-worker to execute/run `ip`.

How reproducible:
All the time.

Steps to Reproduce:
1. Install a version of subscription-manager that uses `ip` to collect network facts
2. Shorten the check-in time of rhsmcertd to e.g. 5 minutes & disable the splay (the randomization of the check-in time within the interval), so you can see the problem quicker than waiting for the default check-in time (which is ~4h):
  # subscription-manager config --rhsmcertd.certCheckInterval=5 --rhsmcertd.splay=0
3. Restart rhsmcertd: `systemctl restart rhsmcertd.service`
4. Register a system: `subscription-manager register`
5. Wait for 5 minutes

Actual results:
SELinux denials for the execution of "ip" as shown above.

Expected results:
No denials.

Comment 4 Zdenek Pytela 2023-06-01 15:16:57 UTC
Note: run the command as
subscription-manager config --rhsmcertd.certcheckinterval=3 --rhsmcertd.splay=0

or edit /etc/rhsm/rhsm.conf

Comment 7 Zdenek Pytela 2023-06-08 18:55:50 UTC
Commit:
795a04994 Allow subscription-manager execute ip

Comment 18 errata-xmlrpc 2023-11-07 08:52:30 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:6617


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