Skip to contentSkip to conversation

Problem with semodule mls policy

DISCUSSION Daniel J Walsh 3 participants 9 messages Mar 15, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

How do I get semodule to create policy.20 at SystemHigh and everything other files at SystemLow?

--
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 2 lines · Daniel J Walsh

How do I get semodule to create policy.20 at SystemHigh and everything other files at SystemLow?

Options:
1) As with the devpts problem, if we had range_transitions for object classes supported by checkpolicy and the kernel, then we could do this via a range_transition rule, as policy.20 is created in a separate directory. Good idea for a kernel enhancement, not a short term option.
2) Modify libsemanage to explicitly set the context on the installed files based on some configuration. Using matchpathcon/file_contexts is a potential concern for bootstrapping, although it can likely be worked around. Putting additional entries into semanage.conf, similar to the existing entry for specifying the file-mode, would be another option.

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 3 lines · Stephen Smalley
Quoted 1 line · Daniel J Walsh

How do I get semodule to create policy.20 at SystemHigh and everything other files at SystemLow?

Why do we want policy.20 at SystemHigh again? The only scenerio I can think of is the user->role mappings but who will be using those rather than seuser mappings? For that matter, seuser file should probably be at SystemHigh...

Quoted 11 lines

Options:
1) As with the devpts problem, if we had range_transitions for object classes supported by checkpolicy and the kernel, then we could do this via a range_transition rule, as policy.20 is created in a separate directory. Good idea for a kernel enhancement, not a short term option.
2) Modify libsemanage to explicitly set the context on the installed files based on some configuration. Using matchpathcon/file_contexts is a potential concern for bootstrapping, although it can likely be worked around. Putting additional entries into semanage.conf, similar to the existing entry for specifying the file-mode, would be another option.

--
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 9 lines · Joshua Brindle
Quoted 4 lines · Stephen Smalley
Quoted 2 lines · Daniel J Walsh

How do I get semodule to create policy.20 at SystemHigh and everything other files at SystemLow?

Why do we want policy.20 at SystemHigh again? The only scenerio I can think of is the user->role mappings but who will be using those rather than seuser mappings? For that matter, seuser file should probably be at SystemHigh...

Possibly local customizations are in view here, e.g. the contents of interfaces.local, that are then fed into the final policy.20 emitted by libsemanage? seusers is the more likely concern, as you note, and it is harder to transparently label it separately since it doesn't live in its own dedicated subdirectory (so range_transition wouldn't help with it; you'd need libsemanage code modification).

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 4 lines · Stephen Smalley
Quoted 3 lines · Joshua Brindle
Quoted 2 lines · Stephen Smalley
Quoted 1 line · Daniel J Walsh

How do I get semodule to create policy.20 at SystemHigh and everything other files at SystemLow?

Quoted 9 lines
Quoted 1 line

Why do we want policy.20 at SystemHigh again? The only scenerio I can think of is the user->role mappings but who will be using those rather than seuser mappings? For that matter, seuser file should probably be at SystemHigh...

Possibly local customizations are in view here, e.g. the contents of interfaces.local, that are then fed into the final policy.20 emitted by libsemanage? seusers is the more likely concern, as you note, and it is harder to transparently label it separately since it doesn't live in its own dedicated subdirectory (so range_transition wouldn't help with it; you'd need libsemanage code modification).

The entire module store (/etc/selinux/<type>/modules/*) should be entirely inaccessible except by an semanage_t domain (and policy server later) via type enforcement, so those shouldn't be a concern. The policy.20 shouldn't really contain any sensitive information so I think the only necessary modification is to label seusers differently, correct?

--
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
Quoted 8 lines · Joshua Brindle
Quoted 7 lines · Stephen Smalley

Possibly local customizations are in view here, e.g. the contents of interfaces.local, that are then fed into the final policy.20 emitted by libsemanage? seusers is the more likely concern, as you note, and it is harder to transparently label it separately since it doesn't live in its own dedicated subdirectory (so range_transition wouldn't help with it; you'd need libsemanage code modification).

Quoted 5 lines

The entire module store (/etc/selinux/<type>/modules/*) should be entirely inaccessible except by an semanage_t domain (and policy server later) via type enforcement, so those shouldn't be a concern. The policy.20 shouldn't really contain any sensitive information so I think the only necessary modification is to label seusers differently, correct?

I wasn't sure whether the fact that e.g. netif eth0 is assigned SystemHigh and netif eth1 is assigned SystemLow in interfaces.local (which is then compiled into policy.20) might be considered sensitive. If so, that would make the final policy.20 sensitive as well.

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.
#6 lore raw
Quoted 9 lines · Stephen Smalley
Quoted 8 lines · Joshua Brindle
Quoted 7 lines · Stephen Smalley

Possibly local customizations are in view here, e.g. the contents of interfaces.local, that are then fed into the final policy.20 emitted by libsemanage? seusers is the more likely concern, as you note, and it is harder to transparently label it separately since it doesn't live in its own dedicated subdirectory (so range_transition wouldn't help with it; you'd need libsemanage code modification).

Quoted 7 lines
Quoted 1 line

The entire module store (/etc/selinux/<type>/modules/*) should be entirely inaccessible except by an semanage_t domain (and policy server later) via type enforcement, so those shouldn't be a concern. The policy.20 shouldn't really contain any sensitive information so I think the only necessary modification is to label seusers differently, correct?

I wasn't sure whether the fact that e.g. netif eth0 is assigned SystemHigh and netif eth1 is assigned SystemLow in interfaces.local (which is then compiled into policy.20) might be considered sensitive. If so, that would make the final policy.20 sensitive as well.

I can buy this, as well as nodecons having different levels. The strange thing is that you don't know what the levels are exactly, you just know their relationships to each other. ie: eth0 is s1 and eth1 is s5 so eth1 is higher sensitivity even though I don't know what that sensitivity means. How big of an issue is this? Chad?

writing down files of different levels from within libsemanage means any libsemanage client must be mls trusted, which may or may not be an issue, I'm not sure.

So, if this is an issue then both seusers and policy.20 need to be labeled differently.. should this be done through libsemanage config or some appconfig in the 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.

#7 lore raw
Quoted 6 lines · Joshua Brindle

I can buy this, as well as nodecons having different levels. The strange thing is that you don't know what the levels are exactly, you just know their relationships to each other. ie: eth0 is s1 and eth1 is s5 so eth1 is higher sensitivity even though I don't know what that sensitivity means. How big of an issue is this? Chad?

Quoted 7 lines

writing down files of different levels from within libsemanage means any libsemanage client must be mls trusted, which may or may not be an issue, I'm not sure.

So, if this is an issue then both seusers and policy.20 need to be labeled differently.. should this be done through libsemanage config or some appconfig in the policy?

libsemanage could call matchpathcon and just use the returned context, as long as we guarantee an initial installed file_contexts file for bootstrapping. semanage.conf is not an option I suppose since it now lives directly in /etc/selinux and is policy-independent.

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 6 lines · Stephen Smalley
Quoted 4 lines · Joshua Brindle

I can buy this, as well as nodecons having different levels. The strange thing is that you don't know what the levels are exactly, you just know their relationships to each other. ie: eth0 is s1 and eth1 is s5 so eth1 is higher sensitivity even though I don't know what that sensitivity means. How big of an issue is this? Chad?

writing down files of different levels from within libsemanage means any libsemanage client must be mls trusted, which may or may not be an issue, I'm not sure.

Quoted 9 lines
Quoted 2 lines

So, if this is an issue then both seusers and policy.20 need to be labeled differently.. should this be done through libsemanage config or some appconfig in the policy?

libsemanage could call matchpathcon and just use the returned context, as long as we guarantee an initial installed file_contexts file for bootstrapping. semanage.conf is not an option I suppose since it now lives directly in /etc/selinux and is policy-independent.

If you don't have an initial file_contexts file at install time, you are going to have a lot more problems than this.

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