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 2104913 - insights-client raises SELinux issues
Summary: insights-client raises SELinux issues
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.7
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: 8.7
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard: CockpitTest
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-07 13:00 UTC by Jelle van der Waa
Modified: 2022-11-08 12:21 UTC (History)
11 users (show)

Fixed In Version: selinux-policy-3.14.3-106.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-08 10:44:31 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 1298 0 None Merged Make default file context match with named transitions 2022-07-28 14:56:40 UTC
Red Hat Bugzilla 2107363 0 high CLOSED [RHEL9] insights-client raises SELinux issues 2023-04-22 07:18:38 UTC
Red Hat Issue Tracker RHELPLAN-127212 0 None None None 2022-07-07 13:08:42 UTC
Red Hat Product Errata RHBA-2022:7691 0 None None None 2022-11-08 10:44:46 UTC

Internal Links: 2107363

Description Jelle van der Waa 2022-07-07 13:00:46 UTC
Description of problem:

Cockpit's insights tests fail after an yum update of RHEL-8-7.

https://github.com/cockpit-project/bots/pull/3585

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

  selinux-policy (3.14.3-100.el8 -> 3.14.3-104.el8)
  selinux-policy-targeted (3.14.3-100.el8 -> 3.14.3-104.el8)
  subscription-manager (1.28.30-1.el8 -> 1.28.31-1.el8)
  subscription-manager-cockpit (1.28.30-1.el8 -> 1.28.31-1.el8)
  subscription-manager-rhsm-certificates (1.28.30-1.el8 -> 1.28.31-1.el8)

How reproducible:

Always

Steps to Reproduce:
1. Run insights-client cockpit tests

Actual results:

audit: type=1400 audit(1657197565.055:4): avc:  denied  { read } for  pid=5606 comm="gpg" name="pubring.kbx" dev="vda3" ino=7285 scontext=system_u:system_r:insights_client
_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.055:5): avc:  denied  { read } for  pid=5606 comm="gpg" name="pubring.kbx" dev="vda3" ino=7285 scontext=system_u:system_r:insights_client
_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.096:6): avc:  denied  { getattr } for  pid=5606 comm="gpg" path="/root/.gnupg/trustdb.gpg" dev="vda3" ino=7287 scontext=system_u:system_r
:insights_client_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.096:7): avc:  denied  { create } for  pid=5606 comm="gpg" name=".#lk0x0000559120d36c80.rhel-8-7-127-0-0-2-2201.5606" scontext=system_u:sy
stem_r:insights_client_t:s0 tcontext=system_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.055:4): avc:  denied  { read } for  pid=5606 comm="gpg" name="pubring.kbx" dev="vda3" ino=7285 scontext=system_u:system_r:insights_client
_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.055:5): avc:  denied  { read } for  pid=5606 comm="gpg" name="pubring.kbx" dev="vda3" ino=7285 scontext=system_u:system_r:insights_client
_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.096:6): avc:  denied  { getattr } for  pid=5606 comm="gpg" path="/root/.gnupg/trustdb.gpg" dev="vda3" ino=7287 scontext=system_u:system_r
:insights_client_t:s0 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file permissive=0
audit: type=1400 audit(1657197565.096:7): avc:  denied  { create } for  pid=5606 comm="gpg" name=".#lk0x0000559120d36c80.rhel-8-7-127-0-0-2-2201.5606" scontext=system_u:sy
stem_r:insights_client_t:s0 tcontext=system_u:object_r:admin_home_t:s0 tclass=file permissive=0


Expected results:


Additional info:

https://cockpit-logs.us-east-1.linodeobjects.com/pull-3585-20220704-231612-d759ef86-rhel-8-7-candlepin-subscription-manager-subscription-manager-1.28/log.html#5
https://cockpit-logs.us-east-1.linodeobjects.com/pull-3585-20220704-231615-d759ef86-rhel-8-7-cockpit-project-cockpit/log.html
https://cockpit-logs.us-east-1.linodeobjects.com/pull-3585-20220704-231615-d759ef86-rhel-8-7-cockpit-project-cockpit/log.html#278

Comment 1 Zdenek Pytela 2022-07-07 13:39:28 UTC
Jelle,

The gpg files and directory seem to have incorrect context. Do you know how they were created, and with which packages versions in place?

Comment 2 Pino Toscano 2022-07-07 16:35:02 UTC
Hi Jelle,

this looks to me that bug 2077778 should be the actual root cause of this issue.

Comment 3 Jelle van der Waa 2022-07-08 07:15:45 UTC
(In reply to Zdenek Pytela from comment #1)
> Jelle,
> 
> The gpg files and directory seem to have incorrect context. Do you know how
> they were created, and with which packages versions in place?

From what I understood from Pino Toscano cockpit runs insights-client which might explain the incorrect context.

Comment 4 Martin Pitt 2022-07-15 07:38:05 UTC
This now also affects RHEL 9.1.

Comment 5 Pino Toscano 2022-07-15 08:04:49 UTC
(In reply to Martin Pitt from comment #4)
> This now also affects RHEL 9.1.

Most likely this is bug 2077777.

Comment 6 mabezerr 2022-07-15 12:51:19 UTC
Just to register here, we have following BZ for RHEL9:

Bug 2107363 - [RHEL9] insights-client raises SELinux issues (https://bugzilla.redhat.com/show_bug.cgi?id=2107363)

Comment 7 John 2022-07-28 06:28:38 UTC
Disgraceful.

Comment 9 Zdenek Pytela 2022-07-28 12:36:39 UTC
Jelle,

Do you still see a similar issue with the latest selinux-policy build?

Comment 12 Jelle van der Waa 2022-08-03 08:50:06 UTC
All info was provided in comment #10. Clearing out 'needs info'.

Comment 22 Marius Vollmer 2022-09-05 11:10:08 UTC
After another update we now see another set of messages.

# insights-client --version
Client: 3.1.7
Core: 3.0.292-1

# rpmquery selinux-policy-targeted
selinux-policy-targeted-3.14.3-107.el8.noarch

audit: type=1400 audit(1662161037.179:6): avc:  denied  { read } for  pid=23710 comm="gpg" name="redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161037.179:7): avc:  denied  { open } for  pid=23710 comm="gpg" path="/etc/insights-client/redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161037.179:8): avc:  denied  { getattr } for  pid=23710 comm="gpg" path="/etc/insights-client/redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161037.191:9): avc:  denied  { read } for  pid=23710 comm="gpg" name="last_stable.egg.asc" dev="vda3" ino=16915715 scontext=system_u:system_r:gpg_t:s0 tcontext=unconfined_u:object_r:insights_client_var_lib_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161037.191:10): avc:  denied  { open } for  pid=23710 comm="gpg" path="/var/lib/insights/last_stable.egg.asc" dev="vda3" ino=16915715 scontext=system_u:system_r:gpg_t:s0 tcontext=unconfined_u:object_r:insights_client_var_lib_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161044.234:11): avc:  denied  { read } for  pid=23799 comm="gpg" name="redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161044.234:12): avc:  denied  { open } for  pid=23799 comm="gpg" path="/etc/insights-client/redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161044.234:13): avc:  denied  { getattr } for  pid=23799 comm="gpg" path="/etc/insights-client/redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161072.521:14): avc:  denied  { read } for  pid=23923 comm="gpg" name=".cache.json.asc" dev="vda3" ino=16802000 scontext=system_u:system_r:gpg_t:s0 tcontext=unconfined_u:object_r:insights_client_etc_rw_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161072.521:15): avc:  denied  { open } for  pid=23923 comm="gpg" path="/etc/insights-client/.cache.json.asc" dev="vda3" ino=16802000 scontext=system_u:system_r:gpg_t:s0 tcontext=unconfined_u:object_r:insights_client_etc_rw_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161119.928:16): avc:  denied  { write } for  pid=24381 comm="vdo" name="_etc_vdoconf.yml.lock" dev="tmpfs" ino=26272 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_lock_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161120.731:17): avc:  denied  { write } for  pid=24403 comm="virsh" name="libvirt-sock-ro" dev="tmpfs" ino=24246 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:virt_var_run_t:s0 tclass=sock_file permissive=1
audit: type=1400 audit(1662161120.731:18): avc:  denied  { connectto } for  pid=24403 comm="virsh" path="/run/libvirt/libvirt-sock-ro" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:virtd_t:s0-s0:c0.c1023 tclass=unix_stream_socket permissive=1
audit: type=1400 audit(1662161150.816:19): avc:  denied  { write } for  pid=24594 comm="sealert" name="setroubleshoot_server" dev="tmpfs" ino=95842 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:setroubleshoot_var_run_t:s0 tclass=sock_file permissive=1
audit: type=1400 audit(1662161150.816:20): avc:  denied  { connectto } for  pid=24594 comm="sealert" path="/run/setroubleshoot/setroubleshoot_server" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:setroubleshootd_t:s0 tclass=unix_stream_socket permissive=1
audit: type=1400 audit(1662161174.240:21): avc:  denied  { setrlimit } for  pid=24771 comm="multipath" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=process permissive=1
audit: type=1400 audit(1662161174.301:22): avc:  denied  { read write } for  pid=24771 comm="multipath" name="control" dev="devtmpfs" ino=13255 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:lvm_control_t:s0 tclass=chr_file permissive=1
audit: type=1400 audit(1662161174.301:23): avc:  denied  { open } for  pid=24771 comm="multipath" path="/dev/mapper/control" dev="devtmpfs" ino=13255 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:lvm_control_t:s0 tclass=chr_file permissive=1
audit: type=1400 audit(1662161174.301:24): avc:  denied  { ioctl } for  pid=24771 comm="multipath" path="/dev/mapper/control" dev="devtmpfs" ino=13255 ioctlcmd=0xfd00 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:lvm_control_t:s0 tclass=chr_file permissive=1
audit: type=1400 audit(1662161174.302:25): avc:  denied  { ipc_info } for  pid=24771 comm="multipath" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system permissive=1
audit: type=1400 audit(1662161180.733:30): avc:  denied  { read } for  pid=24910 comm="gluster" name="random" dev="devtmpfs" ino=9424 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:random_device_t:s0 tclass=chr_file permissive=1
audit: type=1400 audit(1662161180.734:31): avc:  denied  { create } for  pid=24910 comm="gluster" name="cli.log" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161232.626:32): avc:  denied  { setrlimit } for  pid=25306 comm="journalctl" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=process permissive=1
audit: type=1400 audit(1662161232.627:33): avc:  denied  { map } for  pid=25306 comm="journalctl" path="/var/log/journal/344419c3fa2b4fa3b5afb245cc7f9981/system.journal" dev="vda3" ino=9164828 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161234.316:34): avc:  denied  { write } for  pid=25353 comm="podman" name="bolt_state.db" dev="vda3" ino=1012468 scontext=system_u:system_r:insights_client_t:s0 tcontext=unconfined_u:object_r:container_var_lib_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161234.316:35): avc:  denied  { map } for  pid=25353 comm="podman" path="/var/lib/containers/storage/libpod/bolt_state.db" dev="vda3" ino=1012468 scontext=system_u:system_r:insights_client_t:s0 tcontext=unconfined_u:object_r:container_var_lib_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161234.338:36): avc:  denied  { mounton } for  pid=25353 comm="podman" path="/var/lib/containers/storage/overlay" dev="vda3" ino=27252250 scontext=system_u:system_r:insights_client_t:s0 tcontext=unconfined_u:object_r:container_ro_file_t:s0 tclass=dir permissive=1
audit: type=1400 audit(1662161234.338:37): avc:  denied  { write } for  pid=25353 comm="podman" name="overlay" dev="vda3" ino=27252250 scontext=system_u:system_r:insights_client_t:s0 tcontext=unconfined_u:object_r:container_ro_file_t:s0 tclass=dir permissive=1
audit: type=1400 audit(1662161234.338:38): avc:  denied  { mknod } for  pid=25353 comm="podman" capability=27  scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=capability permissive=1
audit: type=1400 audit(1662161234.338:39): avc:  denied  { add_name } for  pid=25353 comm="podman" name="backingFsBlockDev.tmp" scontext=system_u:system_r:insights_client_t:s0 tcontext=unconfined_u:object_r:container_ro_file_t:s0 tclass=dir permissive=1
audit: type=1400 audit(1662161234.338:40): avc:  denied  { create } for  pid=25353 comm="podman" name="backingFsBlockDev.tmp" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:container_ro_file_t:s0 tclass=blk_file permissive=1
audit: type=1400 audit(1662161234.338:41): avc:  denied  { remove_name } for  pid=25353 comm="podman" name="backingFsBlockDev.tmp" dev="vda3" ino=27294791 scontext=system_u:system_r:insights_client_t:s0 tcontext=unconfined_u:object_r:container_ro_file_t:s0 tclass=dir permissive=1
audit: type=1400 audit(1662161248.331:52): avc:  denied  { read } for  pid=25785 comm="gpg" name="redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161248.331:53): avc:  denied  { open } for  pid=25785 comm="gpg" path="/etc/insights-client/redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161248.331:54): avc:  denied  { getattr } for  pid=25785 comm="gpg" path="/etc/insights-client/redhattools.pub.gpg" dev="vda3" ino=16797881 scontext=system_u:system_r:gpg_t:s0 tcontext=system_u:object_r:insights_client_etc_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161248.331:55): avc:  denied  { read } for  pid=25785 comm="gpg" name="last_stable.egg.asc" dev="vda3" ino=16915715 scontext=system_u:system_r:gpg_t:s0 tcontext=unconfined_u:object_r:insights_client_var_lib_t:s0 tclass=file permissive=1
audit: type=1400 audit(1662161248.331:56): avc:  denied  { open } for  pid=25785 comm="gpg" path="/var/lib/insights/last_stable.egg.asc" dev="vda3" ino=16915715 scontext=system_u:system_r:gpg_t:s0 tcontext=unconfined_u:object_r:insights_client_var_lib_t:s0 tclass=file permissive=1

Comment 27 Zdenek Pytela 2022-09-06 08:08:12 UTC
(In reply to Marius Vollmer from comment #22)
> After another update we now see another set of messages.
> 
> # insights-client --version
> Client: 3.1.7
> Core: 3.0.292-1
> ...

This bz as reported has been verified. For new issues please open a new bz, or use any which is currently being worked on.

Comment 28 Marius Vollmer 2022-09-06 10:22:49 UTC
> For new issues please open a new bz, or use any which is currently being worked on.

Please do that yourself if you feel there is still work to do and you need a new bug report to track it.

Comment 29 Milos Malik 2022-09-06 13:23:16 UTC
Here is a new BZ which will address the findings listed in the comment#22:
 * https://bugzilla.redhat.com/show_bug.cgi?id=2124550

Comment 30 Milos Malik 2022-09-06 13:29:23 UTC
When you find any SELinux denials related to insights-client programs, please add them into BZ#2124550.

Thank you.

Comment 31 Marius Vollmer 2022-09-07 06:02:07 UTC
(In reply to Milos Malik from comment #30)
> When you find any SELinux denials related to insights-client programs,
> please add them into BZ#2124550.

Will do, thank you!

Comment 34 errata-xmlrpc 2022-11-08 10:44:31 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-2022:7691


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