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 1846081 - both rhsm and rhsm-facts services run as unconfined_service_t
Summary: both rhsm and rhsm-facts services run as unconfined_service_t
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.3
Hardware: All
OS: Linux
Target Milestone: rc
: 8.5
Assignee: Patrik Koncity
QA Contact: Milos Malik
Depends On:
Blocks: 1726199
TreeView+ depends on / blocked
Reported: 2020-06-10 17:33 UTC by Milos Malik
Modified: 2021-11-10 08:28 UTC (History)
7 users (show)

Fixed In Version: selinux-policy-3.14.3-76.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Last Closed: 2021-11-09 19:42:28 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4420 0 None None None 2021-11-09 19:42:56 UTC

Description Milos Malik 2020-06-10 17:33:42 UTC
Description of problem:
 * both services belong to the subscription-manager component, which is shipped in RHEL, but they are not confined by SELinux policy

# matchpathcon /usr/libexec/rhsm-service
/usr/libexec/rhsm-service	system_u:object_r:bin_t:s0
# matchpathcon /usr/libexec/rhsm-facts-service 
/usr/libexec/rhsm-facts-service	system_u:object_r:bin_t:s0

Version-Release number of selected component (if applicable):

How reproducible:
 * always

Steps to Reproduce:
1. get a RHEL-8.2 machine (targeted policy is active)
# service rhsm start
Redirecting to /bin/systemctl start rhsm.service
# service rhsm-facts start
Redirecting to /bin/systemctl start rhsm-facts.service
# ps -efZ | grep rhsm[-]
system_u:system_r:unconfined_service_t:s0 root 5048    1  0 13:21 ?        00:00:00 /usr/libexec/platform-python /usr/libexec/rhsm-service
system_u:system_r:unconfined_service_t:s0 root 5064    1  0 13:21 ?        00:00:00 /usr/libexec/platform-python /usr/libexec/rhsm-facts-service

Expected results:
 * the services are confined (either rhsmcertd_t or another SELinux domain)

Comment 1 Milos Malik 2020-06-10 17:49:57 UTC
Are these services functionally different from the rhsmcertd service?

I assume that we can use the rhsmcertd policy for them:

# chcon -t rhsmcertd_exec_t /usr/libexec/rhsm-service
# chcon -t rhsmcertd_exec_t /usr/libexec/rhsm-facts-service

They do not trigger any SELinux denials and they seem to run without problems:

# ps -efZ | grep rhsm[-]
system_u:system_r:rhsmcertd_t:s0 root       5170       1  0 13:42 ?        00:00:00 /usr/libexec/platform-python /usr/libexec/rhsm-service
system_u:system_r:rhsmcertd_t:s0 root       5212       1  0 13:42 ?        00:00:00 /usr/libexec/platform-python /usr/libexec/rhsm-facts-service

Comment 4 Patrik Koncity 2021-07-05 12:54:57 UTC
PR: https://github.com/fedora-selinux/selinux-policy/pull/798

Comment 5 Zdenek Pytela 2021-07-30 16:51:16 UTC
To backport:
commit 322b1d412ae6762333a9b4e22fedc09e50351e3b (HEAD -> rawhide, upstream/rawhide)
Author: Patrik Koncity <pkoncity>
Date:   Thu May 27 09:56:37 2021 +0200

    Confine rhsm service and rhsm-facts service as rhsmcertd_t

    Rhsm service and rhsm-fact service run as unconfined_t. Use existing
    rhsmcertd_t policy to confine rhsm service and rhsm-facts service as
    rhsmcertd_t. Label binary files, which execute systemd daemon.

    Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1846081

Comment 14 errata-xmlrpc 2021-11-09 19:42:28 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.


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