Skip to contentSkip to conversation

three problems about normal user login in strict policy

DISCUSSION Ken YANG 4 participants 12 messages Jun 7, 2007 – Jun 20, 2007 SELinux security module

lore
Share & tools
lore

Ken YANG

author
#0 lore raw

hi all,

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

but i still can not switch staff_r:staff_t through su:

su -l staffuser

staffuser is another user, i associate it with staff_u:

Login Name SELinux User MLS/MCS Range

__default__ user_u s0

root root s0-s0:c0.c1023

staffuser staff_u s0

system_u system_u s0-s0:c0.c1023

can anyone give me some hint? thanks

2
as mentioned above, if i use staffuser to login, i can newrole to syadm_r, but this way is same with root login, i think this is meaningless.

so how can i login with normal user(user_u), and can switch to syadm role when performing admin tasks?

3
i declared a user in policy:

gen_user(ken, user, user_r, s0, s0)

"ken" is my linux login user, i think if login program find the same SELinux user and linux user identity, it will use the "ken" in the context for the initial shell process, but after i login through tty2, and execute "id -Z", i found my user in context was still user_u, i.e. user_u:user_r:user_t:s0, why?

thanks in advance

--
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.

#1 lore raw
Quoted 5 lines · Ken YANG

hi all,

i studied the point from walsh about non-root X login, see details in following thread:

Quoted 8 lines

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

Quoted 10 lines

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

Hmm...seems like those should be removed from policy (unless some distro tunable is set for older fedora or rhel4), as su should no longer be making such transitions.

Quoted 46 lines

but i still can not switch staff_r:staff_t through su:

su -l staffuser

staffuser is another user, i associate it with staff_u:

Login Name SELinux User MLS/MCS Range

__default__ user_u s0

root root s0-s0:c0.c1023

staffuser staff_u s0

system_u system_u s0-s0:c0.c1023

can anyone give me some hint? thanks

2
as mentioned above, if i use staffuser to login, i can newrole to syadm_r, but this way is same with root login, i think this is meaningless.

so how can i login with normal user(user_u), and can switch to syadm role when performing admin tasks?

3
i declared a user in policy:

gen_user(ken, user, user_r, s0, s0)

"ken" is my linux login user, i think if login program find the same SELinux user and linux user identity, it will use the "ken" in the context for the initial shell process, but after i login through tty2, and execute "id -Z", i found my user in context was still user_u, i.e. user_u:user_r:user_t:s0, why?

thanks in advance

--
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.

Signature · 8 lines
Stephen Smalley
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.
#2 lore raw
Quoted 32 lines · Stephen Smalley
Quoted 4 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

Quoted 8 lines

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

Quoted 10 lines

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

Quoted 3 lines

Hmm...seems like those should be removed from policy (unless some distro tunable is set for older fedora or rhel4), as su should no longer be making such transitions.

Its in a rhel4 build option.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.
#3 lore raw
Quoted 33 lines · Christopher J. PeBenito
Quoted 32 lines · Stephen Smalley
Quoted 4 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

Quoted 8 lines

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

Quoted 10 lines

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

Quoted 5 lines
Quoted 3 lines

Hmm...seems like those should be removed from policy (unless some distro tunable is set for older fedora or rhel4), as su should no longer be making such transitions.

Its in a rhel4 build option.

Hmmm...so why is it still showing up in F7 strict policy?

Signature · 8 lines
Stephen Smalley
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.
#4 lore raw
Quoted 34 lines · Stephen Smalley
Quoted 33 lines · Christopher J. PeBenito
Quoted 32 lines · Stephen Smalley
Quoted 4 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

Quoted 8 lines

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

Quoted 10 lines

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Hmm...seems like those should be removed from policy (unless some distro tunable is set for older fedora or rhel4), as su should no longer be making such transitions.

Its in a rhel4 build option.

Hmmm...so why is it still showing up in F7 strict policy?

He's just looking at the su.if header (hence the $1_su_t references), which is just copied out of the refpolicy sources as is. So its in the headers, but shouldn't be in the actual policy.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.
author
#5 lore raw

thanks for all of your reply.

i am learning walsh blog, i hope i can figure out all points about user management in SELinux through all of your replies, walsh blog, policy source, and etc...

anyway, thanks again

Quoted 34 lines · Christopher J. PeBenito
Quoted 33 lines · Stephen Smalley
Quoted 32 lines · Christopher J. PeBenito
Quoted 31 lines · Stephen Smalley
Quoted 11 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

Quoted 9 lines

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

Hmm...seems like those should be removed from policy (unless some distro tunable is set for older fedora or rhel4), as su should no longer be making such transitions.

Quoted 7 lines
Quoted 2 lines
Quoted 1 line

Its in a rhel4 build option.

Hmmm...so why is it still showing up in F7 strict policy?

He's just looking at the su.if header (hence the $1_su_t references), which is just copied out of the refpolicy sources as is. So its in the headers, but shouldn't be in the actual policy.

--
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.

author
#6 lore raw
In reply to Christopher J. PeBenito
Quoted 15 lines · Christopher J. PeBenito
Quoted 14 lines · Stephen Smalley
Quoted 13 lines · Christopher J. PeBenito
Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

sorry for reply so late, i just covered walsh's blog, and reviewed some points about selinux user, but i still had 2 questions:

now that su/pam_selinux will not change selinux user id, and user_r cannt switch to staff_r, what is the function of "user_r:user_su_t:s0 staff_r:staff_t:s0..." line in "default_context", and where is it used?

another question is:

i declared a user in policy:

gen_user(ken, user, user_r, s0, s0)

"ken" is my linux login user, i think if login program find the same SELinux user and linux user identity, it will use the "ken" in the context for the initial shell process, but after i login through tty2, and execute "id -Z", i found my user in context was still user_u, i.e. user_u:user_r:user_t:s0.

is there something i missing?

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 10 lines

user_r:user_su_t:s0 staff_r:staff_t:s0 user_r:user_t:s0
sysadm_r:sysadm_t:s0

and in the policy, i found the condition of su domain transition have satisfied, including su_exec_t entrypoint and type_transition rules, furthermore, i also meet the constrain conditon in su_per_role_template(), e.g. domain_role_change_exemption($1_su_t), domain_subj_id_change_exemption($1_su_t), domain_obj_id_change_exemption($1_su_t), and etc.

Hmm...seems like those should be removed from policy (unless some distro tunable is set for older fedora or rhel4), as su should no longer be making such transitions.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

Its in a rhel4 build option.

Hmmm...so why is it still showing up in F7 strict policy?

He's just looking at the su.if header (hence the $1_su_t references), which is just copied out of the refpolicy sources as is. So its in the headers, but shouldn't be in the actual policy.

sorry for omitting this point, i deliberately include these calls for testing, which will not be in the actual policy.

Quoted 1 line

--
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.

#7 lore raw
Quoted 23 lines · Ken YANG
Quoted 15 lines · Christopher J. PeBenito
Quoted 14 lines · Stephen Smalley
Quoted 13 lines · Christopher J. PeBenito
Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

Quoted 8 lines

sorry for reply so late, i just covered walsh's blog, and reviewed some points about selinux user, but i still had 2 questions:

now that su/pam_selinux will not change selinux user id, and user_r cannt switch to staff_r, what is the function of "user_r:user_su_t:s0 staff_r:staff_t:s0..." line in "default_context", and where is it used?

They are obsolete and can be removed, unless they are just being left for compatibility in case someone wants to re-insert pam_selinux into /etc/pam.d/su.

Quoted 5 lines

another question is:

i declared a user in policy:

gen_user(ken, user, user_r, s0, s0)

Unnecessary - you should be mapping Linux usernames to SELinux users via semanage login. The mapping is then stored
in /etc/selinux/$SELINUXTYPE/seusers. It is not necessary anymore to add the Linux usernames to the kernel policy; you can just map them to SELinux users already defined in the kernel policy, where those SELinux users are generic ways of identifying authorized role sets.

Quoted 7 lines

"ken" is my linux login user, i think if login program find the same SELinux user and linux user identity, it will use the "ken" in the context for the initial shell process, but after i login through tty2, and execute "id -Z", i found my user in context was still user_u, i.e. user_u:user_r:user_t:s0.

is there something i missing?

Yes, seusers.

Signature · 8 lines
Stephen Smalley
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.
#8 lore raw
Quoted 28 lines · Stephen Smalley
Quoted 27 lines · Ken YANG
Quoted 15 lines · Christopher J. PeBenito
Quoted 14 lines · Stephen Smalley
Quoted 13 lines · Christopher J. PeBenito
Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

sorry for reply so late, i just covered walsh's blog, and reviewed some points about selinux user, but i still had 2 questions:

Quoted 8 lines
Quoted 4 lines

now that su/pam_selinux will not change selinux user id, and user_r cannt switch to staff_r, what is the function of "user_r:user_su_t:s0 staff_r:staff_t:s0..." line in "default_context", and where is it used?

They are obsolete and can be removed, unless they are just being left for compatibility in case someone wants to re-insert pam_selinux into /etc/pam.d/su.

They remain for RHEL4 support.

Signature · 9 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
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.
author
#9 lore raw
In reply to Stephen Smalley
Quoted 27 lines · Stephen Smalley
Quoted 26 lines · Ken YANG
Quoted 15 lines · Christopher J. PeBenito
Quoted 14 lines · Stephen Smalley
Quoted 13 lines · Christopher J. PeBenito
Quoted 12 lines · Stephen Smalley
Quoted 11 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't generally allowed to switch to staff_r; you need to map your Linux user identity to staff_u via semanage.

sorry for reply so late, i just covered walsh's blog, and reviewed some points about selinux user, but i still had 2 questions:

Quoted 8 lines
Quoted 4 lines

now that su/pam_selinux will not change selinux user id, and user_r cannt switch to staff_r, what is the function of "user_r:user_su_t:s0 staff_r:staff_t:s0..." line in "default_context", and where is it used?

They are obsolete and can be removed, unless they are just being left for compatibility in case someone wants to re-insert pam_selinux into /etc/pam.d/su.

thanks, smalley and pebenito.

BTW, as you know, i am not English-native, and know little about english culture, so i'm not sure is it appropriate to call your first name directly? if impolite, please correct me

Quoted 5 lines
Quoted 5 lines

another question is:

i declared a user in policy:

Quoted 8 lines
Quoted 1 line

gen_user(ken, user, user_r, s0, s0)

Unnecessary - you should be mapping Linux usernames to SELinux users via semanage login. The mapping is then stored
in /etc/selinux/$SELINUXTYPE/seusers. It is not necessary anymore to add the Linux usernames to the kernel policy; you can just map them to SELinux users already defined in the kernel policy, where those SELinux users are generic ways of identifying authorized role sets.

i understand what you mean, originally, i want to validate my guess, but as you said, it is unnecessary. anyway, thanks

Quoted 11 lines
Quoted 8 lines

"ken" is my linux login user, i think if login program find the same SELinux user and linux user identity, it will use the "ken" in the context for the initial shell process, but after i login through tty2, and execute "id -Z", i found my user in context was still user_u, i.e. user_u:user_r:user_t:s0.

is there something i missing?

Yes, seusers.

--
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.

#10 lore raw
Quoted 46 lines · Ken YANG
Quoted 34 lines · Stephen Smalley
Quoted 32 lines · Ken YANG
Quoted 20 lines · Christopher J. PeBenito
Quoted 18 lines · Stephen Smalley
Quoted 16 lines · Christopher J. PeBenito
Quoted 14 lines · Stephen Smalley
Quoted 12 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su, but i notice that there is corresponding line in "default_contexts" file:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

The su / pam_selinux integration was reverted a while ago, so su no
longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire session, and you have to use newrole to switch roles. And user_r isn't
generally allowed to switch to staff_r; you need to map your Linux user
identity to staff_u via semanage.

sorry for reply so late, i just covered walsh's blog, and reviewed some points about selinux user, but i still had 2 questions:

Quoted 9 lines
Quoted 5 lines

now that su/pam_selinux will not change selinux user id, and user_r cannt switch to staff_r, what is the function of "user_r:user_su_t:s0 staff_r:staff_t:s0..." line in "default_context", and where is it used?

They are obsolete and can be removed, unless they are just being left for compatibility in case someone wants to re-insert pam_selinux into /etc/pam.d/su.

Quoted 7 lines

thanks, smalley and pebenito.

BTW, as you know, i am not English-native, and know little about english culture, so i'm not sure is it appropriate to call your first name directly? if impolite, please correct me

First names are fine.

Quoted 15 lines
Quoted 5 lines
Quoted 5 lines

another question is:

i declared a user in policy:

Quoted 9 lines
Quoted 2 lines

gen_user(ken, user, user_r, s0, s0)

Unnecessary - you should be mapping Linux usernames to SELinux users via semanage login. The mapping is then stored
in /etc/selinux/$SELINUXTYPE/seusers. It is not necessary anymore to add the Linux usernames to the kernel policy; you can just map them to SELinux users already defined in the kernel policy, where those SELinux users are generic ways of identifying authorized role sets.

Quoted 17 lines

i understand what you mean, originally, i want to validate my guess, but as you said, it is unnecessary. anyway, thanks

Quoted 11 lines
Quoted 8 lines

"ken" is my linux login user, i think if login program find the same SELinux user and linux user identity, it will use the "ken" in the context for the initial shell process, but after i login through tty2, and execute "id -Z", i found my user in context was still user_u, i.e. user_u:user_r:user_t:s0.

is there something i missing?

Yes, seusers.

--
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.

author
#11 lore raw
Quoted 53 lines · Daniel J Walsh
Quoted 52 lines · Ken YANG
Quoted 49 lines · Stephen Smalley
Quoted 34 lines · Ken YANG
Quoted 22 lines · Christopher J. PeBenito
Quoted 20 lines · Stephen Smalley
Quoted 18 lines · Christopher J. PeBenito
Quoted 16 lines · Stephen Smalley
Quoted 14 lines · Ken YANG

i studied the point from walsh about non-root X login, see details in following thread:

http://marc.info/?l=selinux&m=118050940823692&w=2

when i login with normal user(user_u), i have some questions:
(i'm in fc7 with strict-mcs policy at svn version 2301)

1
when i login as user_u, i find i can not switch to staff_u through su,
but i notice that there is corresponding line in "default_contexts" file:

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

The su / pam_selinux integration was reverted a while ago, so su no longer changes contexts at all, just like in the original SELinux. Thus, the SELinux user identity is once again stable for the entire
session, and you have to use newrole to switch roles. And user_r isn't
generally allowed to switch to staff_r; you need to map your Linux user
identity to staff_u via semanage.

Quoted 9 lines

sorry for reply so late, i just covered walsh's blog, and reviewed some points about selinux user, but i still had 2 questions:

now that su/pam_selinux will not change selinux user id, and user_r cannt switch to staff_r, what is the function of "user_r:user_su_t:s0 staff_r:staff_t:s0..." line in "default_context", and where is it used?

They are obsolete and can be removed, unless they are just being left for compatibility in case someone wants to re-insert pam_selinux into /etc/pam.d/su.

Quoted 8 lines
Quoted 7 lines

thanks, smalley and pebenito.

BTW, as you know, i am not English-native, and know little about english culture, so i'm not sure is it appropriate to call your first name directly? if impolite, please correct me

First names are fine.

thanks.

at first, i think i should call you first name, because foreign friends in our country often call me the first name(ken).

but many people will call the president of US "bush"(as i know, bush is his last name), and when i am watching NBA, you call "Ming YAO" as YAO (Ming YAO is a chinese basketball player, YAO is his last name), so i change to call you last name, but i am afraid i will offend some people if i call the wrong name.

anyway, i know this isn't appropriate place to discuss this topic. thanks

BTW, walsh, your blog is fantastic, i subscribe your blog and learn a lot from it.

--
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.