Skip to contentSkip to conversation

user_t more restrictive than sshd_t (e.g.)?

DISCUSSION dE 2 participants 5 messages May 23, 2014 – May 31, 2014 SELinux security module

lore
Share & tools
lore

dE

author
#0 lore raw

As we know, the user_r does not allow many processes to have high privilege types (system_t for e.g. which's tailored for a single program named X), if such a process is executed, it'll have a type of user_t.

However system_t specifies restrictions on the program exactly as per X's specifications -- it wont allow the program to do anything outside what's it supposed to do.

But that's not the same for user_t -- this type is generic and there are many things that user_t allows which system_t does not.

This may form a security vector; a vulnerable program which should run as system_t but is not run cause user_r does not allow that type, this allows the program to do many things which it's not designed to do; so basically this bypasses SELinux restrictions as put on by system_t.

So, is there any way to prevent this form happening -- or can we specify in the policy what type to run the program as when it's run by a user with role user_r or any other user which is not allowed system_t?

As an e.g. we may see systemctl.

author
#1 lore raw
Quoted 11 lines · dE

As we know, the user_r does not allow many processes to have high privilege types (system_t for e.g. which's tailored for a single program named X), if such a process is executed, it'll have a type of user_t.

However system_t specifies restrictions on the program exactly as per X's specifications -- it wont allow the program to do anything outside what's it supposed to do.

But that's not the same for user_t -- this type is generic and there are many things that user_t allows which system_t does not.

This may form a security vector; a vulnerable program which should run as system_t but is not run cause user_r does not allow that type, this allows the program to do many things which it's not designed to do; so basically this bypasses SELinux restrictions as put on by system_t.

So, is there any way to prevent this form happening -- or can we specify in the policy what type to run the program as when it's run by a user with role user_r or any other user which is not allowed system_t?

As an e.g. we may see systemctl.

Is this concern real?

#2 lore raw
Quoted 7 lines · dE
Quoted 6 lines · dE

As we know, the user_r does not allow many processes to have high privilege types (system_t for e.g. which's tailored for a single program named X), if such a process is executed, it'll have a type of user_t.

However system_t specifies restrictions on the program exactly as per X's specifications -- it wont allow the program to do anything outside what's it supposed to do.

But that's not the same for user_t -- this type is generic and there are many things that user_t allows which system_t does not.

Quoted 7 lines
Quoted 5 lines

This may form a security vector; a vulnerable program which should run as system_t but is not run cause user_r does not allow that type, this allows the program to do many things which it's not designed to do; so basically this bypasses SELinux restrictions as put on by system_t.

So, is there any way to prevent this form happening -- or can we specify in the policy what type to run the program as when it's run by a user with role user_r or any other user which is not allowed system_t?

As an e.g. we may see systemctl.

Is this concern real?

Moving thread to refpolicy mail list.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
#3 lore raw
Quoted 11 lines · Christopher J. PeBenito
Quoted 10 lines · dE
Quoted 9 lines · dE

As we know, the user_r does not allow many processes to have high privilege types (system_t for e.g. which's tailored for a single program named X), if such a process is executed, it'll have a type of user_t.

However system_t specifies restrictions on the program exactly as per X's specifications -- it wont allow the program to do anything outside what's it supposed to do.

But that's not the same for user_t -- this type is generic and there are many things that user_t allows which system_t does not.

This may form a security vector; a vulnerable program which should run as system_t but is not run cause user_r does not allow that type, this allows the program to do many things which it's not designed to do; so basically this bypasses SELinux restrictions as put on by system_t.

So, is there any way to prevent this form happening -- or can we specify in the policy what type to run the program as when it's run by a user with role user_r or any other user which is not allowed system_t?

If there is an exec() that causes a domain/role transition to an invalid context, the exec() will fail. The program won't run.

Signature · 3 lines
Chris PeBenito
Tresys Technology, LLC
www.tresys.com | oss.tresys.com
author
#4 lore raw
Quoted 5 lines · Christopher J. PeBenito
Quoted 4 lines · Christopher J. PeBenito
Quoted 3 lines · dE
Quoted 2 lines · dE

As we know, the user_r does not allow many processes to have high privilege types (system_t for e.g. which's tailored for a single program named X), if such a process is executed, it'll have a type of user_t.

Quoted 10 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

However system_t specifies restrictions on the program exactly as per X's specifications -- it wont allow the program to do anything outside what's it supposed to do.

But that's not the same for user_t -- this type is generic and there are many things that user_t allows which system_t does not.

This may form a security vector; a vulnerable program which should run as system_t but is not run cause user_r does not allow that type, this allows the program to do many things which it's not designed to do; so basically this bypasses SELinux restrictions as put on by system_t.

So, is there any way to prevent this form happening -- or can we specify in the policy what type to run the program as when it's run by a user with role user_r or any other user which is not allowed system_t?

If there is an exec() that causes a domain/role transition to an invalid context, the exec() will fail. The program won't run.

Thanks for forwarding the response.

Unfortunately I've been going thorough more related confusion, so I'm sorting them out.