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 1192314 - With empty ipaselinuxusermapdefault security context on client is staff_u
Summary: With empty ipaselinuxusermapdefault security context on client is staff_u
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sssd
Version: 7.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Jakub Hrozek
QA Contact: Kaushik Banerjee
URL:
Whiteboard:
Depends On:
Blocks: 1194302 1198480 1199143
TreeView+ depends on / blocked
 
Reported: 2015-02-13 06:30 UTC by Steeve Goveas
Modified: 2020-05-02 17:57 UTC (History)
14 users (show)

Fixed In Version: sssd-1.12.2-58.el7.5
Doc Type: Bug Fix
Doc Text:
When the SELinux user content on an IdM server was set to an empty string, the SSSD SELinux evaluation utility previously returned an error. With this update, when an empty string is set, the SSSD correctly uses the default SELinux context value stored in the policy on the client, which prevents the described error from occurring.
Clone Of:
: 1194302 1198480 1199143 (view as bug list)
Environment:
Last Closed: 2015-11-19 11:35:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 3628 0 None None None 2020-05-02 17:57:16 UTC
Red Hat Product Errata RHSA-2015:2355 0 normal SHIPPED_LIVE Low: sssd security, bug fix, and enhancement update 2015-11-19 10:27:42 UTC

Description Steeve Goveas 2015-02-13 06:30:24 UTC
Description of problem:
Default security context for users on client becomes staff_u:staff_r:staff_t:s0-s0:c0.c1023 when ipaselinuxusermapdefault is not set

Version-Release number of selected component (if applicable):
ipa-server-4.1.0-18.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. Setup trust
2. Remove default selinux user
3. check security contest of user 

Actual results:
On IPA Master

[root@bumblebee ~]# ipa config-mod --ipaselinuxusermapdefault=

[root@bumblebee ~]# ipa config-show
  Maximum username length: 32
  Home directory base: /home
  Default shell: /bin/sh
  Default users group: ipausers
  Default e-mail domain: slnx2k8r2.test
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=SLNX2K8R2.TEST
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default PAC types: nfs:NONE, MS-PAC


[root@bumblebee ~]# kdestroy -A

[root@bumblebee ~]# echo Secret123| kinit au102130134
Password for au102130134: 

[root@bumblebee ~]# ssh -l au102130134 `hostname` id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

On Client

[root@vm-idm-033 ~]# service sssd stop; rm -rf /var/lib/sssd/{db,mc}/*; service sssd start
Redirecting to /bin/systemctl stop  sssd.service
Redirecting to /bin/systemctl start  sssd.service

[root@vm-idm-033 ~]# kdestroy -A

[root@vm-idm-033 ~]# echo Secret123| kinit au102130134
Password for au102130134: 

[root@vm-idm-033 ~]# ssh -l au102130134 `hostname` id -Z
staff_u:staff_r:staff_t:s0-s0:c0.c1023



Expected results:
[root@vm-idm-033 ~]# ssh -l au102130134 `hostname` id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

Comment 3 Martin Kosek 2015-02-13 07:29:22 UTC
I assume that in that case, the default comes from SSSD. Reassigning.

Comment 9 Jakub Hrozek 2015-02-13 17:19:43 UTC
Upstream ticket:
https://fedorahosted.org/sssd/ticket/2587

Comment 11 Michal Zidek 2015-03-03 20:26:32 UTC
The problem here is that SSSD does not delete the user's old selinux context. Jakub already wrote a patch and it is on review. As a workaround, you can use semanage tools to delete the old context:

semanage login --delete username

Then the right default will be picked up.

Comment 14 Jakub Hrozek 2015-03-04 19:01:12 UTC
* master: 01f78f755fde63997ccfded71fb8395569b11430
* sssd-1-12: 90efb3c2a48146d7b6cc81fe8422e9024144402a

Comment 17 Steeve Goveas 2015-08-05 15:55:12 UTC
Verified in version
[root@vm-idm-043 ~]# rpm -q sssd
sssd-1.13.0-11.el7.x86_64


Master
[root@vm-idm-014 ~]# ipa config-show | grep -i selinux
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default SELinux user: unconfined_u:s0-s0:c0.c1023

[root@vm-idm-014 ~]# ipa config-mod --ipaselinuxusermapdefault=
  Maximum username length: 32
  Home directory base: /home
  Default shell: /bin/sh
  Default users group: ipausers
  Default e-mail domain: stvidrange.test
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=STVIDRANGE.TEST
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default PAC types: nfs:NONE, MS-PAC

[root@vm-idm-014 ~]# ipa config-show | grep -i selinux
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023

[root@vm-idm-014 ~]# kdestroy -A

[root@vm-idm-014 ~]# echo Secret123 | kinit aduser1
Password for aduser1: 

[root@vm-idm-014 ~]# ssh -l aduser1 `hostname` id -Z
Could not chdir to home directory /home/adtest.qe/aduser1: No such file or directory
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

[root@vm-idm-014 ~]# service sssd stop ; rm -f /var/lib/sss/{mc,db}/* ; service sssd start
Redirecting to /bin/systemctl stop  sssd.service
Redirecting to /bin/systemctl start  sssd.service


Client

[root@vm-idm-043 ~]# kdestroy -A

[root@vm-idm-043 ~]# echo Secret123 | kinit aduser1
Password for aduser1: 

[root@vm-idm-043 ~]# service sssd stop ; rm -f /var/lib/sss/{mc,db}/* ; service sssd start
Redirecting to /bin/systemctl stop  sssd.service
Redirecting to /bin/systemctl start  sssd.service

[root@vm-idm-043 ~]# ssh -l aduser1 `hostname` id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

[root@vm-idm-043 ~]# rpm -q sssd
sssd-1.13.0-11.el7.x86_64

[root@vm-idm-043 ~]# service sssd stop ; rm -f /var/lib/sss/{mc,db}/* ; service sssd start
Redirecting to /bin/systemctl stop  sssd.service
Redirecting to /bin/systemctl start  sssd.service

[root@vm-idm-043 ~]# ssh -l aduser1 `hostname` id -Z
unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

Comment 18 errata-xmlrpc 2015-11-19 11:35:42 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://rhn.redhat.com/errata/RHSA-2015-2355.html


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