role orthogonality
One thing that I still poorly understand is the interaction between types and roles.
Am I right that roles are only relevant when transitioning, and not during normal type enforcement?
It seems to me that we often want to break that orthogonality, so we encode the role in the type (e.g. sysadm_tty_device_t vs user_tty_device_t). I find this ugly, boring and repetitive -- exactly the kind of thing that computers should shield us from. Wouldn't it be possible to make the policy language grok these desires? Out of my hat:
rtype foo_t, domain;
type foo_etc_t, file_type;
rtype foo_files_t, file_type;
allow foo_t self:process signal;
allow foo_t foo_etc_t:file r_file_perms;
allow foo_t foo_files_t:file rw_file_perms;This is supposed to mean that foo_t and foo_files_t exist seperately for every role, while there is only one foo_etc_t. Or you can think of foo_t and foo_files_t having "hard" boundaries between roles.
So in this scenario user_r:foo_t may signal user_r:foo_t, but not sysadm_r:foo_t; user_r:foo_files_t [1] may only be read/written by user_r:foo_t, not sysadm_r:foo_t; but foo_etc_t can be read by foo_t under any role.
It's probably desirable to allow more detailed specification as well:
allow sysadm_r:foo_t user_r:foo_files_t:file rw_file_perms;
meaning that sysadm_r can access user_r's foo_files as well. (Yes we run into colon overload problems here.)
Now, what's wrong with this naive proposal?
[1] Files would need to be able to hold roles, then.
Signature · 1 line
Robbe
Quoted 5 lines · Robert Bihlmeyer
One thing that I still poorly understand is the interaction between types and roles.
Am I right that roles are only relevant when transitioning, and not during normal type enforcement?
Yes, roles only come into play on process transitions, based on the role allow rules and the constraints configuration. Roles are merely a layer of abstraction for grouping related domains together and assigning them to users. They can provide a limited form of boundary between sets of domains (i.e. by limiting a user to certain roles, you bound the set of domains he can reach), but even here, you are truly relying on TE to deal with all possible interactions between those domains (i.e. non-transition forms of interactions).
Quoted 4 lines
It seems to me that we often want to break that orthogonality, so we encode the role in the type (e.g.
sysadm_tty_device_tvsuser_tty_device_t). I find this ugly, boring and repetitive -- exactly the kind of thing that computers should shield us from.
This is actually a type derivation (sysadm_tty_device_t is a type derived from sysadm_t and tty_device_t), not role encoding.
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.
Quoted 3 lines · Robert Bihlmeyer
This is supposed to mean that
foo_tandfoo_files_texist seperately for every role, while there is only onefoo_etc_t. Or you can think offoo_tandfoo_files_thaving "hard" boundaries between roles.
Probably the best way to do that would be in an object-oriented manner. You could have a security "class" which defines local types. Then the User class would be instantiated for user_t and sysadm_t.
You could implement this as a policy pre-processor which outputs code with name mangling that the checkpolicy tool can accept, in a similar manner to the C-front implementation of C++.
Things of a similar nature have been suggested before and the NSA people haven't seemed to like any of them. But that doesn't prevent you from doing whatever you want.
Although I think that there's much less call for such things now than there used to be. I think I've solved a lot of the annoying policy issues with M4 macros, and I will probably improve it even more in the next few months.
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.