Skip to contentSkip to conversation

MLS and Biba

DISCUSSION Salvo Giuffrida 4 participants 6 messages Sep 26, 2006 – Sep 28, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

Good morning, is it possible to configure the MLS policy, using mlsconstraint, to enforce a Biba integrity model of security (no read down, no write up), instead of the Bell-LaPadula (no read up, no write down)? I'm reading the book "SELinux by example", and there there's written that the MLS facility in the Security Server is not very flexible, and allows only to enforce the rules "no read up, no write down". But, if I'm the one configuring the policy in the file "mls", shouldn't I be able to change the rules to the opposite? Thanks a lot...

_________________________________________________________________
Blocca le pop-up pubblicitarie con MSN Toolbar! http://toolbar.msn.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.

#1 lore raw
Quoted 8 lines · Salvo Giuffrida

Good morning, is it possible to configure the MLS policy, using mlsconstraint, to enforce a Biba integrity model of security (no read down, no write up), instead of the Bell-LaPadula (no read up, no write down)? I'm reading the book "SELinux by example", and there there's written that the MLS facility in the Security Server is not very flexible, and allows only to enforce the rules "no read up, no write down". But, if I'm the one configuring the policy in the file "mls", shouldn't I be able to change the rules to the opposite?

Sure you can change it to do that.

Almost everyone who is involved in SE Linux development believes that domain-type is the best way of ensuring system integrity and that MLS is only needed for confidentiality. So all the work has progressed in that direction.

SE Linux only supports one MLS range per object, so having Biba and Bell-laPadula is not really possible. I guess you could misuse the high and low fields of the range such that one of them represents integrity and the other confidentiality, but that is too horrible to seriously contemplate.

Signature · 9 lines
[email protected]
http://etbe.blogspot.com/          My Blog

http://www.coker.com.au/sponsorship.html Sponsoring Free Software development

--
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 4 lines · Russell Coker

SE Linux only supports one MLS range per object, so having Biba and Bell-laPadula is not really possible. I guess you could misuse the high and low fields of the range such that one of them represents integrity and the other confidentiality, but that is too horrible to seriously contemplate.

A more flexible approach would be to split up the category bits into MLS, MCS, and MIC (integrity) sets, so that you could use all the models within a single policy. It's not very pretty but I think not as bad as having completely separate policies.

It would work by masking the MLS fields using bitmasks. Probably the most useful approach is to do this for category bits only, and leave the hierarchical levels for MLS. You could also split up the bits in the hierarchical level if you really wanted to, for example bit 7..4 for MLS and bit 3..0 for MIC.

Something like the following maybe (this doesn't currently work of course):

        define_mls_mask mcs_mask c0..c511;
        define_mls_mask mic_mask c512..c1023;
        define_mls_mask mls_mask s0-s15:c1024..c2048;

        mlsconstrain file write
           (((l1 & mls_mask) eq    (l2 & mls_mask)) and
            ((l1 & mcs_mask) dom   (l2 & mcs_mask)) and
            ((l1 & mic_mask) dom   (l2 & mic_mask)));

        mlsconstrain file read
           (((l1 & mls_mask) dom   (l2 & mls_mask)) and
            ((l1 & mcs_mask) dom   (l2 & mcs_mask)) and
            ((l1 & mic_mask) domby (l2 & mic_mask)));

or alternatively (this would be a lot more readable once you add the overrides):

mlsconstrain-masked mls_mask file read
(l1 dom l2);

mlsconstrain-masked mic_mask file read
(l1 domby l2);

To implement it, you'd mainly need to introduce a "binary and" operator for the mlsconstrain operator. If I understand the AVC cache correctly, this should have no noticeable performance impact since the operations don't happen all that often.

(The current MLS policy uses "write equal" instead of "no write down" to preserve integrity - if you want to depend on MIC for integrity you could change the write "eq" to "domby".)

-Klaus

--
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 11 lines · Klaus Weidner
Quoted 5 lines · Russell Coker

SE Linux only supports one MLS range per object, so having Biba and Bell-laPadula is not really possible.  I guess you could misuse the high and low fields of the range such that one of them represents integrity and the other confidentiality, but that is too horrible to seriously contemplate.

A more flexible approach would be to split up the category bits into MLS, MCS, and MIC (integrity) sets, so that you could use all the models within a single policy. It's not very pretty but I think not as bad as having completely separate policies.

type high_t, domain;
type medium_t, domain;
type low_t, domain;
type high_file_t, file_type;
type medium_file_t, file_type;
type low_file_t, file_type;

can_exec(high_t, high_file_t) can_exec(medium_t, { medium_file_t, high_file_t }) can_exec(low_t, file_type) create_dir_file(high_t, high_file_t) create_dir_file(medium_t, medium_file_t) create_dir_file(low_t, low_file_t)
allow high_t { medium_t low_t }:file w_file_perms;
...

It seems that we can do BIBA stuff with the domain-type model. The above is a demonstration of how it might start. Probably the best thing to do would be to have a set of N levels and N-1 attributes for all possible <X and >X values and a set of macros to define the BIBA policy.

As has been mentioned in the past, the domain-type model is flexible enough to implement MLS etc. It's just a matter of whether you would want to.

I might have some spare time in a couple of weeks. Maybe I'll hack something up for fun.

Signature · 10 lines
[email protected]
http://etbe.blogspot.com/          My Blog

http://www.coker.com.au/sponsorship.html Sponsoring Free Software development


--
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 3 lines · Russell Coker

can_exec(high_t, high_file_t) can_exec(medium_t, { medium_file_t, high_file_t }) can_exec(low_t, file_type)

[...]

Quoted 4 lines

It seems that we can do BIBA stuff with the domain-type model. The above is a demonstration of how it might start. Probably the best thing to do would be to have a set of N levels and N-1 attributes for all possible <X and >X values and a set of macros to define the BIBA policy.

But that means that you won't be able to combine the integrity controls with the existing TE controls, or if you want both you'll have to use combined types such as high_passwd_exec_t, medium_user_t and so on, and that way lies madness.

The advantage of the bitmasks would be that you could use TE, MLS, MCS, and MIC within a single policy, including backwards compatibility to the current type labels.

Quoted 2 lines

As has been mentioned in the past, the domain-type model is flexible enough to implement MLS etc. It's just a matter of whether you would want to.

I think the problem is that if you overload the types too much, you get a combinatorial explosion of types, and the current size of the policy is already getting unwieldy.

Quoted 2 lines

I might have some spare time in a couple of weeks. Maybe I'll hack something up for fun.

I'm short on spare time, but I'd also be curious to hack up the bitmask approach ;-)

-Klaus

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

#5 lore raw
In reply to Salvo Giuffrida
Quoted 9 lines · Salvo Giuffrida

Good morning, is it possible to configure the MLS policy, using mlsconstraint, to enforce a Biba integrity model of security (no read down, no write up), instead of the Bell-LaPadula (no read up, no write down)? I'm reading the book "SELinux by example", and there there's written that the MLS facility in the Security Server is not very flexible, and allows only to enforce the rules "no read up, no write down". But, if I'm the one configuring the policy in the file "mls", shouldn't I be able to change the rules to the opposite?
Thanks a lot...

Are you referring to the statement:
"Unlike type enforcement, which is flexible and adaptable, MLS is intended to strictly and inflexibly enforce a single security invariant ("no write down, no read up")"

That is describing the MLS/BLP model, not a limitation of the SELinux security server. As you note, the SELinux security server allows for very flexible configuration of the MLS constraints, including the ability to switch the logic as you say (but at that point it is no longer enforcing a "MLS 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.