restrict access by user identity
I would like to be able to do the following thing:
Let's assume I set the type of a file to type_a.
I would like to be able to ensure that users who can read files of type_a can only do so for files which are labeled with their name (so the scontext of the file is <username>:object_r:type_a.) So userA would then not be able to read a file labeled with userB:object_r:type_a. Is this possible?
Thanks.
M.H
_________________________________________________________________
Join the world�s largest e-mail service with MSN Hotmail. http://www.hotmail.com
--
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 7 lines · M. H.
I would like to be able to do the following thing:
Let's assume I set the type of a file totype_a.
I would like to be able to ensure that users who can read files oftype_acan only do so for files which are labeled with their name (so the scontext of the file is <username>:object_r:type_a.) So userA would then not be able to read a file labeled with userB:object_r:type_a.
Is this possible?
You could try to implement such a restriction via the policy/constraints configuration (see the Configuring the SELinux Policy report). However, I wouldn't recommend this approach. The preferred approach would be to define separate types for userA's objects and userB's objects, with separate domains and roles for userA and userB.
--
Stephen D. Smalley, NAI Labs
[email protected]
--
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 9 lines · Stephen Smalley
Quoted 7 lines · M. H.
I would like to be able to do the following thing:
Let's assume I set the type of a file totype_a.
I would like to be able to ensure that users who can read files oftype_acan only do so for files which are labeled with their name (so the scontext of the file is <username>:object_r:type_a.) So userA would then not be able to read a file labeled with userB:object_r:type_a. Is this possible?
Quoted 5 lines
You could try to implement such a restriction via the policy/constraints configuration (see the Configuring the SELinux Policy report). However, I wouldn't recommend this approach. The preferred approach would be to define separate types for userA's objects and userB's objects, with separate domains and roles for userA and userB.
Also make sure you use the most recent version of the sample policy that is available for this.
Older versions had user_t and user_home_t specified right through the policy files. When I first setup a machine with multiple user roles (the SE demo machine at LinuxTag in Germany) I spent about 45 minutes getting it to the stage where it was half-usable (barely enough for a demo machine) with multiple roles.
Successive policy revisions have improved this considerably.
Any time you see a reference to user_t or user_home_t in a .te file then the .te file is buggy and will cause you problems with multiple user roles (IE you'll have to re-write that .te file). I've just done a grep of my policy tree, it looks like I've got some work to do in this regard. :(
If you are using a policy V9 policy DB (kernel 2.4.17 from memory) then this will be a problem for you. It would be quite possible to merge the policy file support needed for policy V9 with the newer versions of the macro files etc that support multiple user roles, but it would probably be a lot easier to upgrade to a newer kernel with a V11 policy DB.
It seems that the major issues with my current policy are:
1) login and sshd need a user_t for a default transition (if you use a non-SE version of login or sshd). So you can add new user roles but you MUST have user_r and user_t.
2) You have to change newrole.te when adding new roles, IFF they are to be permitted to change roles. Of course if you add a new role that isn't to be allowed to change to any other role then it's not a problem. Failure to change newrole.te means that the terminal device type doesn't get changed. The most noticable symptom of this is that you do "newrole -r sysadm_r" and then "su" doesn't work because it transitions to a domain that doesn't have the "write almost anything" access of sysadm_t.
Signature · 3 lines
I do not get viruses because I do not use MS software. If you use Outlook then please do not put my email address in your address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line
From field.
--
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 4 lines · Russell Coker
Any time you see a reference to
user_toruser_home_tin a .te file then the .te file is buggy and will cause you problems with multiple user roles (IE you'll have to re-write that .te file). I've just done a grep of my policy tree, it looks like I've got some work to do in this regard. :(
I've just started work on the changes needed to address these issues.
I've added the following to attrib.te:
# The user_tmpfile attribute identifies all types associated with temporary
# files for unpriv_userdomain domains. attribute user_tmpfile;
# for the user_xserver_tmp_t etc attribute xserver_tmpfile;
Now I'm stuck on what to do with the following from file_contexts/types.fc:/tmp/orbit.* system_u:object_r:user_tmp_t
/tmp/.ICE-unix(|/.*) system_u:object_r:user_tmp_t
As I don't have /tmp/orbit.* and I don't know what the .ICE-unix on my system is for I'm not sure what to do with them.
I plan to setup a machine in a virtual-multihead situation (different X servers on different virtual consoles), login under two different roles and shake down some of these issues. However it'll require a spare day when I have no other plans for one of my headed machines. So it may be some time before I get to it.
Also it appears that login.te only needs the following access to user home directories in my policy tree:
allow local_login_t home_dir_type:dir search;
allow remote_login_t home_dir_type:dir search;
Or the following for the policy tree from the last NSA release:
allow local_login_t home_type:dir search;
allow remote_login_t home_type:dir search;
Of course login is a "trusted" application so restricting it doesn't really gain us much, but there's no harm in it.
Signature · 3 lines
I do not get viruses because I do not use MS software. If you use Outlook then please do not put my email address in your address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line
From field.
--
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 · Russell Coker
Now I'm stuck on what to do with the following from file_contexts/types.fc:
/tmp/orbit.*system_u:object_r:user_tmp_t
/tmp/.ICE-unix(|/.*) system_u:object_r:user_tmp_tAs I don't have
/tmp/orbit.*and I don't know what the .ICE-unix on my system is for I'm not sure what to do with them.
Not sure if this helps:
[509] [snoopy:unstable:bam] ~ >fuser -v /tmp/.ICE-unix/29869
USER PID ACCESS COMMAND/tmp/.ICE-unix/29869 bam 29869 f.... gnome-session
Of course, I still don't know what it is there for, it doesn't appear to be orbit related either (although I might be mistaken).
Signature · 6 lines
Brian May <[email protected]> -- 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.
For httpd_t I think that we need to have macros for multiple httpd_user_content_t etc types for full multi-role support.
I don't plan to write this as I don't have much interest in this area at the moment. Contributions from anyone who's doing serious things with Apache would be welcome.
Also it might be worth waiting for the next NSA release, it may contain some changes that would impact such work.
Russell Coker
--
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.