Skip to contentSkip to conversation

policy package names for Debian

DISCUSSION Russell Coker 3 participants 7 messages Mar 28, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

The policy names used in Fedora/RHEL (according to the SELINUXTYPE field in /etc/selinux/config) are "targeted", "strict", and "mls".

The names currently used in Debian are "refpolicy-targeted"
and "refpolicy-strict". For my work on MLS in Debian I have started with a package named "refpolicy-mls" (but hope to release it just as "mls").

I believe that the contents of /etc/selinux/config should match between distributions as much as possible. It would be good if documentation for how to solve problems on Fedora would work for people using Debian.

Also the "refpolicy" part of the name doesn't seem to add any value. Policy other than "refpolicy" is old and forgotten, and more importantly there is no possibility of switching between them. If a user could choose to have either "refpolicy-targeted" or the old "targeted" then that would be a good reason for having the different name. But as they have no choice it seems better to have shorter names everywhere (both in the config file and in the package name).

pn  postfix-policy <none>         (no description available)
un  selinux-policy <none>         (no description available)
ii  selinux-policy 0.0.20061018-5 Headers from the SELinux reference policy fo
pn  selinux-policy <none>         (no description available)
pn  selinux-policy <none>         (no description available)
pn  selinux-policy <none>         (no description available)
ii  selinux-policy 0.0.20061018-5 Targeted variant of the SELinux reference po

The package name "selinux-policy-refpolicy-targeted" is unreasonably long to type and is too long to be usable in a default operation of "dpkg -l" (see the above output from "dpkg -l" on an 80 column xterm).

Manoj, I suggest that we change the package names to selinux-pol-targeted, selinux-pol-strict, and selinux-pol-mls. That saves typing and results in the above dpkg command giving useful data.

Currently anyone who is using SE Linux in Debian/Unstable will need to purge and reinstall their policy (while also rebooting their machine). The process of purge and reinstall will handle the name in /etc/selinux/config, and the problems related to a reboot make the issue of a different policy package name trivial by comparison.

Manoj, what do you think?

Signature · 9 lines
[email protected]
http://etbe.coker.com.au/          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.
#1 lore raw
Quoted 27 lines · Russell Coker

The policy names used in Fedora/RHEL (according to the SELINUXTYPE field in /etc/selinux/config) are "targeted", "strict", and "mls".

The names currently used in Debian are "refpolicy-targeted"
and "refpolicy-strict". For my work on MLS in Debian I have started with a package named "refpolicy-mls" (but hope to release it just as "mls").

I believe that the contents of /etc/selinux/config should match between distributions as much as possible. It would be good if documentation for how to solve problems on Fedora would work for people using Debian.

Also the "refpolicy" part of the name doesn't seem to add any value. Policy other than "refpolicy" is old and forgotten, and more importantly there is no possibility of switching between them. If a user could choose to have either "refpolicy-targeted" or the old "targeted" then that would be a good reason for having the different name. But as they have no choice it seems better to have shorter names everywhere (both in the config file and in the package name).

pn  postfix-policy <none>         (no description available)
un  selinux-policy <none>         (no description available)
ii  selinux-policy 0.0.20061018-5 Headers from the SELinux reference policy fo
pn  selinux-policy <none>         (no description available)
pn  selinux-policy <none>         (no description available)
pn  selinux-policy <none>         (no description available)
ii  selinux-policy 0.0.20061018-5 Targeted variant of the SELinux reference po
Quoted 7 lines

The package name "selinux-policy-refpolicy-targeted" is unreasonably long to type and is too long to be usable in a default operation of "dpkg -l" (see the above output from "dpkg -l" on an 80 column xterm).

Manoj, I suggest that we change the package names to selinux-pol-targeted, selinux-pol-strict, and selinux-pol-mls. That saves typing and results in the above dpkg command giving useful data.

If you are seeking consistency with Fedora, then note that it calls the packages selinux-policy-targeted and selinux-policy-mls. The selinux-policy-strict package is gone as of Fedora 8 and later, obsoleted by the merge of strict and targeted policies (now one just maps users to confined roles via semanage login and if one truly doesn't want to leave anything unconfined at all, one can semodule -r unconfined).

Also, there is a selinux-policy-devel package in Fedora that has what is needed to build local policy modules.

If on the other hand you want to track the names used by upstream refpolicy these days, then those would be standard, mcs, and mls. The old strict/targeted distinction is no longer there either, so the only real distinctions are whether you have a policy with MLS field/logic completely disabled (standard), enabled and used for MCS (mcs) or enabled and used for MLS (mls).

BTW, recently noticed that semanage user -a is broken under standard (non-mcs/mls) policy as there is a hardcoded :s0 in seobject.py on a prefix context check - so that needs to be resolved. Or we just need to give up on non-mcs/mls policies altogether (that would simplify life for applications and users - a single format for all contexts).

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 10 lines · Stephen Smalley

If you are seeking consistency with Fedora, then note that it calls the packages selinux-policy-targeted and selinux-policy-mls. The selinux-policy-strict package is gone as of Fedora 8 and later, obsoleted by the merge of strict and targeted policies (now one just maps users to confined roles via semanage login and if one truly doesn't want to leave anything unconfined at all, one can semodule -r unconfined).

If on the other hand you want to track the names used by upstream refpolicy these days, then those would be standard, mcs, and mls. The

Tracking upstream seems more sensible. So that would be selinux-pol-mcs and selinux-pol-mls (I don't think it makes sense to support "standard" in Debian). Or maybe just "selinux-pol" and "selinux-pol-mls" (to make it more obvious that the "mls" one is the odd one out.

Quoted 5 lines

BTW, recently noticed that semanage user -a is broken under standard (non-mcs/mls) policy as there is a hardcoded :s0 in seobject.py on a prefix context check - so that needs to be resolved. Or we just need to give up on non-mcs/mls policies altogether (that would simplify life for applications and users - a single format for all contexts).

I think it's best to give up on policy which lacks the MLS field in the context for everything but embedded systems.

Signature · 9 lines
[email protected]
http://etbe.coker.com.au/          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.
#3 lore raw
In reply to Stephen Smalley
Quoted 5 lines · Stephen Smalley

BTW, recently noticed that semanage user -a is broken under standard (non-mcs/mls) policy as there is a hardcoded :s0 in seobject.py on a prefix context check - so that needs to be resolved. Or we just need to give up on non-mcs/mls policies altogether (that would simplify life for applications and users - a single format for all contexts).

Gentoo isn't the only one with a TE-only policy, Ubuntu has it too.

Neglecting the above, I still disagree with dropping a TE-only configuration. While you can arrive at the same configuration by having one category and one sensitivity and/or dropping the MLS constraints, you still get MLS bits leaking through, eg. in semanage.

Signature · 10 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150



--
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 8 lines · Christopher J. PeBenito
Quoted 5 lines · Stephen Smalley

BTW, recently noticed that semanage user -a is broken under standard (non-mcs/mls) policy as there is a hardcoded :s0 in seobject.py on a prefix context check - so that needs to be resolved. Or we just need to give up on non-mcs/mls policies altogether (that would simplify life for applications and users - a single format for all contexts).

Gentoo isn't the only one with a TE-only policy, Ubuntu has it too.

Not surprising given who has packaged selinux for Ubuntu. Doesn't really add an independent data point for TE-only configurations.

Quoted 4 lines

Neglecting the above, I still disagree with dropping a TE-only configuration. While you can arrive at the same configuration by having one category and one sensitivity and/or dropping the MLS constraints, you still get MLS bits leaking through, eg. in semanage.

That's the point - the presence/absence of a context field is visible to users and applications no matter how much we try to encapsulate the contexts, and having the two different configurations makes maintenance and user experience more difficult/confusing.

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.
#5 lore raw
Quoted 9 lines · Stephen Smalley
Quoted 4 lines

Neglecting the above, I still disagree with dropping a TE-only configuration. While you can arrive at the same configuration by having one category and one sensitivity and/or dropping the MLS constraints, you still get MLS bits leaking through, eg. in semanage.

That's the point - the presence/absence of a context field is visible to users and applications no matter how much we try to encapsulate the contexts, and having the two different configurations makes maintenance and user experience more difficult/confusing.

I think the confusion is worse for the TE-only case (emulated by no mls constraints or only one category/sensitivity). For example, if you short circuit the level translation to "", then people get confused when their setexecon() fails because they haven't put :s0 at the end of the context, but none of their ps -AZ processes have it. Thats significantly more obtuse than people thinking "Fedora has that MCS stuff, and Ubuntu doesn't." There is always configuration/support variances between distros.

I'm not convinced many people actually use MCS at all. Users have a hard enough time dealing with TE. If it wasn't for MCS I don't think we'd even be having this discussion.

Signature · 10 lines
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150



--
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 11 lines · Christopher J. PeBenito
Quoted 9 lines · Stephen Smalley
Quoted 4 lines

Neglecting the above, I still disagree with dropping a TE-only configuration. While you can arrive at the same configuration by having one category and one sensitivity and/or dropping the MLS constraints, you still get MLS bits leaking through, eg. in semanage.

That's the point - the presence/absence of a context field is visible to users and applications no matter how much we try to encapsulate the contexts, and having the two different configurations makes maintenance and user experience more difficult/confusing.

Quoted 8 lines

I think the confusion is worse for the TE-only case (emulated by no mls constraints or only one category/sensitivity). For example, if you short circuit the level translation to "", then people get confused when their setexecon() fails because they haven't put :s0 at the end of the context, but none of their ps -AZ processes have it. Thats significantly more obtuse than people thinking "Fedora has that MCS stuff, and Ubuntu doesn't." There is always configuration/support variances between distros.

Ah, that's likely true. And people do find the difference between MCS and MLS confusing as it is.

Quoted 3 lines

I'm not convinced many people actually use MCS at all. Users have a hard enough time dealing with TE. If it wasn't for MCS I don't think we'd even be having this discussion.

For me, the value of MCS is getting the MLS support adequately tested and supported throughout the distribution. That's about it.

The ideal scenario from a "mainstreaming MAC" perspective would be to have the real MLS constraints in place by default, and the only difference between the default setup and a MLS one would be whether one actually puts anything in any level other than s0. That would carry some cost from the constraint evaluation on compute_av calls, but that should be largely masked by the AVC. It shouldn't really affect memory or disk use as long as everything defaults to s0 and no categories.

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.