Is there a SELinux tutorial for ISVs ?
This string of messages brings up something I wanted to get a conversation going on how to handle non OS Provided policy.
We all know we need a better mechanism for handling "binary" policy in the future. ( I think the future is now.) I see three people providing policy.
1. OS Provider with base policy. (It would also be nice if the base policy got broken into several policies and only the policy of the running service would be loaded. If we got to this state we would need a new mechanism for restoring file context since file_context might not meet the currently loaded policy.
2. Third Party application developers. As the use of targeted policy has begun to take off, Third Party ISV have started to question how they can play in this world.
I see Tresys Stuff solving the problems of both of the above.
3 Local User customization and minor policies. Currently we have people using audit2allow creating files in domains/misc and then
reloading policy. We need a mechanism for users to be able to do this without recompiling policy. Also more significantly how
do we handle the small diffed apache_domain stuff. A couple of months ago I redesigned apache policy to have a macro called apache_domain. A user could create a new apache_XYZ.te file with
apache_domain(XYZ)
Followed by a few allow rules and be able to get their cgi scripts working without turning off apache protection or running their script in httpd_unconfined_script_t.
The problem is the only way to do this is to install policy sources and muck around. I think we to have some shared library mechanism
where a few well known macros could be defined and users could easily build their own custom policy.
Anyways I think we need more discussion on handling third party and user customization of policy outside of the current make tree stuff.
Dan
Dan
Signature · 4 lines
-- 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 · Daniel J Walsh
The problem is the only way to do this is to install policy sources and
muck around. I think we to have some shared library mechanism
where a few well known macros could be defined and users could easily build their own custom policy.Anyways I think we need more discussion on handling third party and user customization of policy outside of the current make tree stuff.
I've been thinking on it when working on the SELinux deployment within Ubuntu Linux, and binary policies are something pretty handy for binary packages-based distributions, among the general benefit they provide.
I might be able to work on something, but I would like to know first how many people is interested in this and how many of them would be able to contribute to it in the long term.
The idea I thought about is something like the one shown in the diagram at
http://pearls.tuxedo-es.org/selinux/diagrams/selinux-binary-policies-1.png
Cheers,
Signature · 2 lines
Lorenzo Hernández García-Hierro <[email protected]> [1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]
Quoted 7 lines · Lorenzo Hernández García-Hierro
I've been thinking on it when working on the SELinux deployment within Ubuntu Linux, and binary policies are something pretty handy for binary packages-based distributions, among the general benefit they provide.
I might be able to work on something, but I would like to know first how many people is interested in this and how many of them would be able to contribute to it in the long term.
Tresys Technology already has a working implementation of binary policy modules, including a module abstraction with a dependency model, a compiler for generating such modules, and a linker for linking them together with a "base module". Planned for upstreaming after FC4. See their prior posts to the selinux list or their web site for info.
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 18 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Stephen Smalley
Sent: Thursday, April 28, 2005 1:52 PM
To: Lorenzo Hernández García-Hierro
Cc: Daniel J Walsh; Davide Bolcioni; [email protected]; SELinux
Subject: Re: Is there a SELinux tutorial for ISVs ?Quoted 7 lines · Lorenzo Hernández García-Hierro
I've been thinking on it when working on the SELinux deployment within Ubuntu Linux, and binary policies are something pretty handy for binary packages-based distributions, among the general benefit they provide.
I might be able to work on something, but I would like to know first how many people is interested in this and how many of them would be able to contribute to it in the long term.
Quoted 6 lines
Tresys Technology already has a working implementation of binary policy modules, including a module abstraction with a dependency model, a compiler for generating such modules, and a linker for linking them together with a "base module". Planned for upstreaming after FC4. See their prior posts to the selinux list or their web site for info.
This and the reference policy work I just mentioned in another email. As we work on upstreaming the binary modules we are going to need feedback / testing - if you are interested in this area I would greatly appreciate any help you can give.
Thanks,
Karl
---
Karl MacMillan
Tresys Technology
http://www.tresys.com
(410) 290-1411 ext 134
Quoted 9 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.
--
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 15 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Daniel J Walsh
Sent: Thursday, April 28, 2005 11:55 AM
To: Davide Bolcioni
Cc: [email protected]; SELinux
Subject: Re: Is there a SELinux tutorial for ISVs ?This string of messages brings up something I wanted to get a conversation going on how to handle non OS Provided policy.
We all know we need a better mechanism for handling "binary" policy in the future. ( I think the future is now.) I see three people providing policy.
Quoted 6 lines
1. OS Provider with base policy. (It would also be nice if the base policy got broken into several policies and only the policy of the running service would be loaded. If we got to this state we would need a new mechanism for restoring file context since
file_contextmight not meet the currently loaded policy.
In the binary policy work, the base is simply a binary module that is fully self-contained to guarantee that there will be an internally consistent / coherent policy at all times. That policy can be arbitrarily small, however.
As for only enabling policy for certain services I see three options:
1) Policy for all services is always loaded (current practice).
2) Policy for services that are installed is always loaded.
3) Policy for services that are installed is loaded on service start.
1 is obviously problematic because of wasted resources and privileged application domains being present when they should not be (not to mention 3rd party policy). We considered 3 when we started the binary module work, but decided that it was too complicated with little benefit. Additionally, I think that it is _very_ desirable to limit relabeling as much as possible. It is error prone and risky in terms of security.
2 is what we are targeting. The installation of a new service in the model I am proposing would
1) Install the binary policy module to a place on the filesystem managed by RPM (for example /etc/selinux/policy-name/installed-modules).
2) Load the policy by installing it with semodule (semodule -i policy.pp - .pp is for policy package which is the binary policy and file contexts). This will install the module into a managed location (for example /etc/selinux/policy-name/active-modules) and load it into the kernel.
3) RPM would then label files as it installs the application.
The binary module infrastructure also always creates a complete file_context like the current system, so that can be used for whatever labeling needs to be done.
Quoted 6 lines
2. Third Party application developers. As the use of targeted policy has begun to take off, Third Party ISV have started to question how they can play in this world.
I see Tresys Stuff solving the problems of both of the above.
That is the plan - we are porting the recent changes to libsepol/libselinux/checkpolicy to our tree and will start upstreaming the binary policy work soon. I am targeting getting this integrated by June.
Quoted 13 lines
3 Local User customization and minor policies. Currently we have people using audit2allow creating files in domains/misc and then
reloading policy. We need a mechanism for users to be able to do this
without recompiling policy. Also more significantly how
do we handle the small diffedapache_domainstuff. A couple of months ago I redesigned apache policy to have a macro calledapache_domain. A user could create a new apache_XYZ.te file with
apache_domain(XYZ)
Followed by a few allow rules and be able to get their cgi scripts working without turning off apache protection or running their script inhttpd_unconfined_script_t.
Quoted 5 lines
The problem is the only way to do this is to install policy sources and
muck around. I think we to have some shared library mechanism
where a few well known macros could be defined and users could easily build their own custom policy.
We are actively working on what we are calling reference policy. This attempts to create just such a 'shared library' mechanism among other goals. On the source level it creates abstractions in the form of layers and modules. Each module, which contains the policy for a well-defined functional area, exports a set of interfaces - macros that allow access to its resources.
There is a presentation that we did on this work available at
http://tresys.com/Downloads/selinux_dev/reference-policy.pdf, which may give you an idea of what we are trying to accomplish. Also, we are starting a sourceforge project for this that will be up soon. We are making rapid progress on this and can release the policies that we have done so far when the project set up. If anyone would like to see what we have let me know and I will get you a tarball off list.
I think that the next step is to add the interface idea to the underlying binary module language so that external policies can start being dependent not on types but interfaces. If these stabilize enough it should be possible to write to this abstraction layer and have a single binary module work across many base policies.
Quoted 4 lines
Anyways I think we need more discussion on handling third party and user customization of policy outside of the current make tree stuff.
I agree. We are trying to tackle these problems, but need input about exactly what people need.
---
Karl MacMillan
Tresys Technology
http://www.tresys.com
(410) 290-1411 ext 134
Quoted 4 lines
Dan
Dan
Quoted 8 lines
--
--
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.
--
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.