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 1727379 - sysadm_u users cannot log into graphical sessions
Summary: sysadm_u users cannot log into graphical sessions
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: All
OS: Linux
Target Milestone: rc
: 7.8
Assignee: Lukas Vrabec
QA Contact: Milos Malik
Jan Fiala
Depends On:
TreeView+ depends on / blocked
Reported: 2019-07-05 18:56 UTC by Mason Loring Bliss
Modified: 2023-09-07 20:13 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-3.13.1-253.el7
Doc Type: Enhancement
Doc Text:
.sysadm_u users can now log in to graphical sessions Previously, Linux users mapped to the `sysadm_u` SELinux user were unable to log in to graphical sessions. The SELinux policy has been updated to allow these users to use graphical sessions while conforming to DISA STIG requirements. If the `xdm_sysadm_login` Boolean is enabled, the `sysadm_u` user can now successfully log in to X Window System session from the GNOME Display Manager.
Clone Of:
Last Closed: 2020-03-31 19:11:00 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1007 0 None None None 2020-03-31 19:11:13 UTC

Description Mason Loring Bliss 2019-07-05 18:56:16 UTC
Description of problem:

Users with user context sysadm_u cannot log into graphical sessions, not can they evidently log in via ssh.

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

Observed with RHEL 7.6. Untested on RHEL 8 as yet.

How reproducible:

useradd testuser
semanage login -a -s sysadm_u testuser
# try to log in via gdm or sshd

Additional info:

Customer is using DISA STIG, and cannot have unconfined users. Between this and other bugs that will be opened presently they cannot function.

Comment 2 Mason Loring Bliss 2019-07-05 19:15:58 UTC
Additional notes: The xdm_exec_bootloader boolean seems to impact the 
misbehaviour cosmetically.

Comment 10 Milos Malik 2019-07-17 13:43:56 UTC
Here is the output from "ausearch -m avc -m user_avc -i -ts today | audit2allow" gathered on my VM:

#============= NetworkManager_t ==============
allow NetworkManager_t systemd_resolved_t:dbus send_msg;

#============= accountsd_t ==============
allow accountsd_t sysadm_t:dbus send_msg;

#============= boltd_t ==============
allow boltd_t sysadm_t:dbus send_msg;

#============= colord_t ==============
allow colord_t sysadm_t:dbus send_msg;

#============= rhsmcertd_t ==============
allow rhsmcertd_t sysadm_t:dbus send_msg;

#============= rtkit_daemon_t ==============
allow rtkit_daemon_t sysadm_t:dbus send_msg;
allow rtkit_daemon_t sysadm_t:process setsched;

#============= sysadm_gkeyringd_t ==============
allow sysadm_gkeyringd_t sysadm_t:unix_stream_socket connectto;
allow sysadm_gkeyringd_t system_dbusd_t:dbus send_msg;
allow sysadm_gkeyringd_t system_dbusd_t:unix_stream_socket connectto;
allow sysadm_gkeyringd_t systemd_logind_t:dbus send_msg;

#============= sysadm_t ==============
allow sysadm_t accountsd_t:dbus send_msg;
allow sysadm_t boltd_t:dbus send_msg;
allow sysadm_t colord_t:dbus send_msg;
allow sysadm_t rhsmcertd_t:dbus send_msg;
allow sysadm_t rtkit_daemon_t:dbus send_msg;
allow sysadm_t self:netlink_selinux_socket { bind create };
allow sysadm_t system_dbusd_t:dbus acquire_svc;

#============= systemd_logind_t ==============
allow systemd_logind_t sysadm_gkeyringd_t:dbus send_msg;

Based on the list of suggested rules, I believe that important ones contain system_dbusd_t type and netlink_selinux_socket class. The rest of rules depend on what packages/services are installed/enabled.

Comment 11 Milos Malik 2019-07-17 14:17:14 UTC
Here is the local policy module which the problem on my VM:

# cat mypolicy.cil 
( allow sysadm_t sysadm_t ( dbus ( acquire_svc )))
( allow sysadm_t sysadm_t ( netlink_selinux_socket ( bind create )))
( allow sysadm_t system_dbusd_t ( dbus ( acquire_svc )))
( allow sysadm_gkeyringd_t sysadm_t ( unix_stream_socket ( connectto )))
( allow sysadm_gkeyringd_t system_dbusd_t ( dbus ( send_msg )))
( allow sysadm_gkeyringd_t system_dbusd_t ( unix_stream_socket ( connectto )))
( allow sysadm_gkeyringd_t systemd_logind_t ( dbus ( send_msg )))
( allow systemd_logind_t sysadm_gkeyringd_t ( dbus ( send_msg )))
( allow sysadm_gkeyringd_t sysadm_t ( dbus ( acquire_svc )))
# semodule -i mypolicy.cil

Now, I can successfully log into X session as sysadm_u user in enforcing mode.

Comment 28 errata-xmlrpc 2020-03-31 19:11:00 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, 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.