Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
The "unconfined_login" boolean is supposed to "allow users to login as an unconfined domain" (i.e. "unconfined_t").
Turning OFF this boolean doesn't seem to have any effect, at least on sshd:
a user mapped to unconfined_u can still log in:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
$ ssh unconfined@vm-confined8
[unconfined@vm-confined8 ~]$ id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
The policy shows the following rules being added when "unconfined_login" is enabled:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# sesearch -A -b unconfined_login
allow unconfined_login_domain bin_t:dir { getattr ioctl lock open read search }; [ unconfined_login ]:True
allow unconfined_login_domain bin_t:dir { getattr open search }; [ unconfined_login ]:True
allow unconfined_login_domain bin_t:dir { getattr open search }; [ unconfined_login ]:True
allow unconfined_login_domain bin_t:lnk_file { getattr read }; [ unconfined_login ]:True
allow unconfined_login_domain shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; [ unconfined_login ]:True
allow unconfined_login_domain unconfined_t:process transition; [ unconfined_login ]:True
allow unconfined_t unconfined_login_domain:fd use; [ unconfined_login ]:True
allow unconfined_t unconfined_login_domain:fifo_file { append getattr ioctl lock open read write }; [ unconfined_login ]:True
allow unconfined_t unconfined_login_domain:process sigchld; [ unconfined_login ]:True
# seinfo -a unconfined_login_domain -x
Type Attributes: 1
attribute unconfined_login_domain;
chroot_user_t
crond_t
local_login_t
remote_login_t
rshd_t
sshd_t
sulogin_t
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
From above, I'd expect when boolean is off, that shell services (e.g. sshd) cannot spawn a shell but ... there is an unconditional rule in the policy as well for sshd:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# sesearch -A -s sshd_t -t shell_exec_t
[...]
allow sshd_t shell_exec_t:file { execute execute_no_trans getattr ioctl map open read };
allow sshd_t shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; [ ssh_sysadm_login ]:True
allow unconfined_login_domain shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; [ unconfined_login ]:True
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Stracing sshd with "--secontext" option shows the context change for the sshd user happens without issue:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
39754 [sshd_t] 13:13:41.865154 write(12</proc/39754/task/39754/attr/current> [sshd_t], "unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\0", 54) = 54 <0.000142>
39754 [unconfined_t] 13:13:41.865324 close(12</proc/39754/task/39754/attr/current> [unconfined_t]) = 0 <0.000004>
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
What's wrong?
Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-80.el8_5.2.noarch
How reproducible:
Always
Steps to Reproduce:
1. Map a user to "unconfined_u"
# useradd -Z unconfined_u unconfined
# echo "pass" | passwd --stdin unconfined
2. Disable the boolean
# semanage boolean --modify --off unconfined_domain
3. Try ssh'ing
# ssh unconfined@localhost
Actual results:
Works
Expected results:
Doesn't work
Comment 19RHEL Program Management
2023-08-23 11:51:42 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 20RHEL Program Management
2023-08-23 14:45:04 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.
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.
Description of problem: The "unconfined_login" boolean is supposed to "allow users to login as an unconfined domain" (i.e. "unconfined_t"). Turning OFF this boolean doesn't seem to have any effect, at least on sshd: a user mapped to unconfined_u can still log in: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- $ ssh unconfined@vm-confined8 [unconfined@vm-confined8 ~]$ id -Z unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- The policy shows the following rules being added when "unconfined_login" is enabled: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # sesearch -A -b unconfined_login allow unconfined_login_domain bin_t:dir { getattr ioctl lock open read search }; [ unconfined_login ]:True allow unconfined_login_domain bin_t:dir { getattr open search }; [ unconfined_login ]:True allow unconfined_login_domain bin_t:dir { getattr open search }; [ unconfined_login ]:True allow unconfined_login_domain bin_t:lnk_file { getattr read }; [ unconfined_login ]:True allow unconfined_login_domain shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; [ unconfined_login ]:True allow unconfined_login_domain unconfined_t:process transition; [ unconfined_login ]:True allow unconfined_t unconfined_login_domain:fd use; [ unconfined_login ]:True allow unconfined_t unconfined_login_domain:fifo_file { append getattr ioctl lock open read write }; [ unconfined_login ]:True allow unconfined_t unconfined_login_domain:process sigchld; [ unconfined_login ]:True # seinfo -a unconfined_login_domain -x Type Attributes: 1 attribute unconfined_login_domain; chroot_user_t crond_t local_login_t remote_login_t rshd_t sshd_t sulogin_t -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- From above, I'd expect when boolean is off, that shell services (e.g. sshd) cannot spawn a shell but ... there is an unconditional rule in the policy as well for sshd: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- # sesearch -A -s sshd_t -t shell_exec_t [...] allow sshd_t shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; allow sshd_t shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; [ ssh_sysadm_login ]:True allow unconfined_login_domain shell_exec_t:file { execute execute_no_trans getattr ioctl map open read }; [ unconfined_login ]:True -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- Stracing sshd with "--secontext" option shows the context change for the sshd user happens without issue: -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- 39754 [sshd_t] 13:13:41.865154 write(12</proc/39754/task/39754/attr/current> [sshd_t], "unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\0", 54) = 54 <0.000142> 39754 [unconfined_t] 13:13:41.865324 close(12</proc/39754/task/39754/attr/current> [unconfined_t]) = 0 <0.000004> -------- 8< ---------------- 8< ---------------- 8< ---------------- 8< -------- What's wrong? Version-Release number of selected component (if applicable): selinux-policy-3.14.3-80.el8_5.2.noarch How reproducible: Always Steps to Reproduce: 1. Map a user to "unconfined_u" # useradd -Z unconfined_u unconfined # echo "pass" | passwd --stdin unconfined 2. Disable the boolean # semanage boolean --modify --off unconfined_domain 3. Try ssh'ing # ssh unconfined@localhost Actual results: Works Expected results: Doesn't work