Bug 1727379 - sysadm_u users cannot log into graphical sessions
Summary: sysadm_u users cannot log into graphical sessions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.6
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: 7.8
Assignee: Lukas Vrabec
QA Contact: Milos Malik
Jan Fiala
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-05 18:56 UTC by Mason Loring Bliss
Modified: 2020-03-31 19:11 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:
Environment:
Last Closed: 2020-03-31 19:11:00 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1007 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.

https://access.redhat.com/errata/RHBA-2020:1007


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