This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
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 2005016 - rhsmcertd-worker blocked by SELinux policy when IPv6 disabled
Summary: rhsmcertd-worker blocked by SELinux policy when IPv6 disabled
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: subscription-manager
Version: 8.4
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: Red Hat subscription-manager QE Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-16 14:51 UTC by juspence
Modified: 2023-09-22 12:51 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-22 12:51:55 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7073 0 None Migrated None 2023-09-22 12:51:46 UTC
Red Hat Issue Tracker RHELPLAN-97558 0 None None None 2021-09-18 10:21:06 UTC

Description juspence 2021-09-16 14:51:35 UTC
Description of problem:
The default RHEL 8.4 CSB configuration disables IPv6. An SELinux error message about "blocked module_request access" (pasted below) appears in journal logs for various applications, including the Red Hat Subscription Manager.

Version-Release number of selected component (if applicable):
RHEL 8.4 CSB, subscription-manager==1.28.13

How reproducible:
Error message appears in logs every day without making any config changes.

Steps to Reproduce:
1. Boot with "ipv6.disable=1" added to the kernel command line.
2. Wait for RHSM to run automatically, or run it manually.
3. Check "journalctl -b -p 3" for setroubleshoot messages.

Actual results:
Error message appears in logs, subscription manager tries to load IPv6 module and is blocked by SELinux policy.

Expected results:
No error message appears in logs, subscription manager either does not try to make IPv6 calls / load the IPv6 module when it is disabled, or the SELinux policy allows this access and does not flag it.

Additional info:
The error message for RHSM mentions "/usr/libexec/platform-python3.6", which is invoked by "/usr/libexec/rhsmcertd-worker" to run the "/usr/lib64/python3.6/site-packages/subscription_manager/scripts/rhsmcertd_worker.py" script.

The error message is fixed (at least for other applications) by passing config options that disable IPv6 usage, so the applicaton does not try and fail to call module_request for the disabled IPv6 module. For example, chronyd can be run with the "-4" command-line option, and postfix / cups can be configured to bind to "127.0.0.1" (only IPv4) instead of "localhost" (both IPv4 and IPv6).

RHSM scripts should probably be updated to not use IPv6 when it is disabled, or the RHSM SELinux policies should be updated to allow requesting the IPv6 module.


Contents of rhsmcertd-worker script that invokes platform-python:
[user@localhost ~]$ cat /usr/libexec/rhsmcertd-worker
#!/usr/libexec/platform-python

    EASY-INSTALL-ENTRY-SCRIPT: 'subscription-manager==1.28.13','console_scripts','rhsmcertd-worker'
    _requires_ = 'subscription-manager==1.28.13'
    import re
    import sys
    from pkg_resources import load_entry_point

if _name_ == '_main_':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('subscription-manager==1.28.13', 'console_scripts', 'rhsmcertd-worker')()
)


Error message about SELinux blocking module_request access for platform-python:
[user@localhost ~]$ journalctl -b -p 3 | grep sealert
Sep 12 12:53:06 localhost setroubleshoot[9359]: SELinux is preventing /usr/libexec/platform-python3.6 from module_request access on the system labeled kernel_t. For complete SELinux messages run: sealert -l b4d2c94d-b749-47e8-90c3-21933bd3eaea

 

Verbose error message that shows platform-python is being invoked by rhsmcertd-worker, using the rhsmcertd_t SELinux context:
[user@localhost ~]$ sealert -l b4d2c94d-b749-47e8-90c3-21933bd3eaea
SELinux is preventing /usr/libexec/platform-python3.6 from module_request access on the system labeled kernel_t.

                    Plugin catchall (5.76 confidence) suggests **************************

If you believe that platform-python3.6 should be allowed module_request access on system labeled kernel_t by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:

    ausearch -c 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
    semodule -X 300 -i my-rhsmcertdworke.pp

Additional Information:
Source Context system_u:system_r:rhsmcertd_t:s0
Target Context system_u:system_r:kernel_t:s0
Target Objects Unknown [ system ]
Source rhsmcertd-worke
Source Path /usr/libexec/platform-python3.6
Port <Unknown>
Host localhost
Source RPM Packages
Target RPM Packages
SELinux Policy RPM selinux-policy-targeted-3.14.3-67.el8_4.1.noarch
Local Policy RPM selinux-policy-targeted-3.14.3-67.el8_4.1.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name localhost
Platform Linux localhost 4.18.0-305.12.1.el8_4.x86_64 #1
SMP Mon Jul 26 08:06:24 EDT 2021 x86_64 x86_64
Alert Count 33
First Seen 2021-08-30 09:48:18 EDT
Last Seen 2021-09-12 12:53:00 EDT
Local ID b4d2c94d-b749-47e8-90c3-21933bd3eaea

Raw Audit Messages
type=AVC msg=audit(1631465580.767:256): avc: denied { module_request } for pid=9356 comm="rhsmcertd-worke" kmod="net-pf-10" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system permissive=0
Hash: rhsmcertd-worke,rhsmcertd_t,kernel_t,system,module_request

Comment 2 Zdenek Pytela 2021-09-23 12:08:50 UTC
In the bz title there is "rhsmcertd-worker blocked", but I can't find any actual problem in the description. Can this be clarified?

If there is no problem, then from selinux-policy maintainer PoV it is correct to have the AVC denial exposed when IPv6 is disabled as this can help point out to a possible problem.

Comment 3 Pino Toscano 2021-09-23 12:23:12 UTC
(In reply to Zdenek Pytela from comment #2)
> In the bz title there is "rhsmcertd-worker blocked", but I can't find any
> actual problem in the description. Can this be clarified?

There interesting part of the report is in the "Additional info" part of the report.
In short: it seems that /usr/libexec/rhsmcertd-worker (a Python application, executed periodically by rhsmcertd) gets the SELinux module_request denial.

> If there is no problem, then from selinux-policy maintainer PoV it is
> correct to have the AVC denial exposed when IPv6 is disabled as this can
> help point out to a possible problem.

Well yeah, the problem is that rhsmcertd-worker somehow (directly or indirectly) triggers a module loading, which should definitely not happen.

Comment 5 juspence 2021-09-23 12:28:27 UTC
Sure, that's fine. I only set it to private since I wasn't sure if this application was private / internal or not.

Comment 7 RHEL Program Management 2023-09-22 12:51:17 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 8 RHEL Program Management 2023-09-22 12:51:55 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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