Users are not assigned correct security context on login
Hi,
I've configured the users file like this:
user system_u roles system_r;
user user_u roles user_r;
user root roles { sysadm_r staff_r };
user test roles { sysadm_r staff_r };
(Doing a "make policy" shows "security: 4 users ...")
However, after doing a "make reload", rebooting and logging in as root, "id" shows this:
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:user_t
... "newrole -r sysadm_r" shows this:
Cannot find your entry in the passwd file.
... and "newrole -r sysadm_u" shows this:
Couldn't get default type.
I put some printf's into newrole.c, and the reason newrole didn't find root in the passwd file, was because context_user_get() didn't return "root" as username ("" was returned).
Am I doing an obvious mistake somewhere here? Or might it be that login is buggy and cannot set the correct security context?
Is it a problem that id doesn't show any SID?
Regards,
Erlend Aasland
P.S:
I'm able to correctly change the context of programs and files (I've been able to configure the system such that no avc-warnings appear during bootup).
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Erlend Aasland
However, after doing a "make reload", rebooting and logging in as root, "id" shows this:
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:user_t
It looks like you have not installed the SE Linux patched /bin/login or the SE Linux PAM module (for new SE Linux). If you do one of those things then it should all work.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Hi,
Thanks for your reply
Quoted 6 lines · Russell Coker
Quoted 3 lines · Erlend Aasland
However, after doing a "make reload", rebooting and logging in as root, "id" shows this:
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:user_tIt looks like you have not installed the SE Linux patched
/bin/loginor the SE
I've successfully applied the SELinux patches to util-linux, so /bin/login should be ok. I will give the PAM module a try and see if it helps.
Regards,
Erlend Aasland
Quoted 7 lines
Signature · 5 lines
-- http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 6 lines · Erlend Aasland
Quoted 2 lines
It looks like you have not installed the SE Linux patched
/bin/loginor the SEI've successfully applied the SELinux patches to util-linux, so
/bin/loginshould be ok. I will give the PAM module a try and see if it helps.
Combining the PAM module and a patched /bin/login is not a good idea, it is likely to work to some extent but will report errors relabeling the tty device at least.
But I suggest double-checking the util-linux patch, the symptoms exactly match what happens when an unpatched /bin/login is used, I can't think of any other possible cause.
Signature · 10 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 3 lines · Erlend Aasland
However, after doing a "make reload", rebooting and logging in as root, "id" shows this:
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:user_t
This implies that login didn't set the user context prior to executing the shell, i.e. it never called (or failed upon calling) setexeccon().
Signature · 8 lines
Stephen Smalley <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.