All of lore.kernel.org
 help / color / mirror / Atom feed
* policy language extensions
@ 2003-09-25 21:45 David Caplan
  2003-09-25 21:49 ` David Caplan
  2003-09-26 13:02 ` Dale Amon
  0 siblings, 2 replies; 5+ messages in thread
From: David Caplan @ 2003-09-25 21:45 UTC (permalink / raw)
  To: NSA's SELinux

We are currently working on a couple of policy language extensions for 
which we'd like to let the group comment on.  Both grew out of the 
motivations that drove our previous work in developing a binary policy 
patch tool (see 
http://www.ultraviolet.org/mail-archives/selinux.2003/0768.html). We 
expect all changes to be eventually incorporated into the manline SE 
Linux package.

We're working on two enhancements:  conditional policy statements, and 
loadable binary policy modules.  The first is extending the policy 
language to allow conditional blocks of policy depending on the state of 
boolean variables (also defined in the policy).  The booleans are 
defined in a similar fashion to types and the conditional policy 
statements are of the form:

if (expression) then { policy_block } else { policy_block }

where 'expression' is any number of defined boolean variables joined 
with the standard operators (e.g., &&, ||, ==, !=, !, etc.) and the 
policy blocks are made up of any number of AV and Type rules with the 
'else' block being optional.

We've implemented an initial version of the user space portion of this 
(i.e., modifications to checkpolicy) and are porting the data structures 
and functionality to the kernel/security server.  We are planning to use 
  sysctl as the kernel interface to export the booleans.  A patch 
against the current version of checkpolicy is available at 
http://www.tresys.com/selinux/cond_policy_patch.gz for your perusal. 
Please note that policies built with this version of checkpolicy should 
_not_ be used (i.e., loaded) in an SE Linux kernel.  You can examine 
binary conditional policies with 'checkpolicy -d', and there is a test 
directory under the checkpolicy directory as well with a small utility 
that allows the setting of the booleans and displaying various parts of 
a binary policy.

The second extension we are currently designing is a mechanism to allow 
policy modules to be built independant of a base policy.  These modules 
could then be loaded and unloaded into a running policy.  They could be 
integrated into software packages, an rpm for example, so that if the 
software were installed on an selinux system  the appropriate policy 
would also be loaded.

Comments and contributions are welcome.

David
-- 
__________________________________

David Caplan     410 290 1411 x105
dac@tresys.com
Tresys Technology, LLC
8840 Stanford Blvd., Suite 2100
Columbia, MD 21045


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: policy language extensions
  2003-09-25 21:45 policy language extensions David Caplan
@ 2003-09-25 21:49 ` David Caplan
  2003-09-26 13:02 ` Dale Amon
  1 sibling, 0 replies; 5+ messages in thread
From: David Caplan @ 2003-09-25 21:49 UTC (permalink / raw)
  To: David Caplan; +Cc: NSA's SELinux

Sorry, that link should have been:

http://www.tresys.com/checkpolicy_prototype.html

which is also accessible from

http://www.tresys.com/selinux/index.html

David Caplan wrote:
> We are currently working on a couple of policy language extensions for 
> which we'd like to let the group comment on.  Both grew out of the 
> motivations that drove our previous work in developing a binary policy 
> patch tool (see 
> http://www.ultraviolet.org/mail-archives/selinux.2003/0768.html). We 
> expect all changes to be eventually incorporated into the manline SE 
> Linux package.
> 
> We're working on two enhancements:  conditional policy statements, and 
> loadable binary policy modules.  The first is extending the policy 
> language to allow conditional blocks of policy depending on the state of 
> boolean variables (also defined in the policy).  The booleans are 
> defined in a similar fashion to types and the conditional policy 
> statements are of the form:
> 
> if (expression) then { policy_block } else { policy_block }
> 
> where 'expression' is any number of defined boolean variables joined 
> with the standard operators (e.g., &&, ||, ==, !=, !, etc.) and the 
> policy blocks are made up of any number of AV and Type rules with the 
> 'else' block being optional.
> 
> We've implemented an initial version of the user space portion of this 
> (i.e., modifications to checkpolicy) and are porting the data structures 
> and functionality to the kernel/security server.  We are planning to use 
>  sysctl as the kernel interface to export the booleans.  A patch against 
> the current version of checkpolicy is available at 
> http://www.tresys.com/selinux/cond_policy_patch.gz for your perusal. 
> Please note that policies built with this version of checkpolicy should 
> _not_ be used (i.e., loaded) in an SE Linux kernel.  You can examine 
> binary conditional policies with 'checkpolicy -d', and there is a test 
> directory under the checkpolicy directory as well with a small utility 
> that allows the setting of the booleans and displaying various parts of 
> a binary policy.
> 
> The second extension we are currently designing is a mechanism to allow 
> policy modules to be built independant of a base policy.  These modules 
> could then be loaded and unloaded into a running policy.  They could be 
> integrated into software packages, an rpm for example, so that if the 
> software were installed on an selinux system  the appropriate policy 
> would also be loaded.
> 
> Comments and contributions are welcome.
> 
> David

-- 
__________________________________

David Caplan     410 290 1411 x105
dac@tresys.com
Tresys Technology, LLC
8840 Stanford Blvd., Suite 2100
Columbia, MD 21045


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: policy language extensions
  2003-09-25 21:45 policy language extensions David Caplan
  2003-09-25 21:49 ` David Caplan
@ 2003-09-26 13:02 ` Dale Amon
  2003-09-26 13:37   ` David Caplan
  2003-09-26 13:39   ` Stephen Smalley
  1 sibling, 2 replies; 5+ messages in thread
From: Dale Amon @ 2003-09-26 13:02 UTC (permalink / raw)
  To: David Caplan; +Cc: NSA's SELinux

On Thu, Sep 25, 2003 at 05:45:28PM -0400, David Caplan wrote:
> We are currently working on a couple of policy language extensions for 
> which we'd like to let the group comment on.  Both grew out of the 

Looks like just what the doctor ordered. I was thinking
about a related issue yesterday while battling sshd policy
issues (actually I should not use past tense: still am) and
how much easier it would be if I could simply execute or delete
policy statements during a live debugt sessions using a 
policy interpreter. A sort of "perl -de 1" for policy
would be nice. 

Some things could be difficult though: policy statements
do not appear to me to have a 1:1 relation to the binary 
representation.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: policy language extensions
  2003-09-26 13:02 ` Dale Amon
@ 2003-09-26 13:37   ` David Caplan
  2003-09-26 13:39   ` Stephen Smalley
  1 sibling, 0 replies; 5+ messages in thread
From: David Caplan @ 2003-09-26 13:37 UTC (permalink / raw)
  To: Dale Amon; +Cc: NSA's SELinux



Dale Amon wrote:
> 
> Some things could be difficult though: policy statements
> do not appear to me to have a 1:1 relation to the binary 
> representation.
> 

You are right, they do not.  The policy statement:

allow  domain  init_t : process  { sigchld signull };

expands into a hash table entry (in the binary policy) for every type 
associated with the domain attribute.  In a very stripped down policy I 
was looking at this was 49 types.

You also need to keep in mind that "subtraction" or disabling of rules, 
via a conditional policy, is not equivalent to removing permissions.  If 
the above rule were in a condition block that was disabled, there might 
still be an allow rule in the base policy, or even in another 
conditional block, that allowed those permissions.


-- 
__________________________________

David Caplan     410 290 1411 x105
dac@tresys.com
Tresys Technology, LLC
8840 Stanford Blvd., Suite 2100
Columbia, MD 21045


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: policy language extensions
  2003-09-26 13:02 ` Dale Amon
  2003-09-26 13:37   ` David Caplan
@ 2003-09-26 13:39   ` Stephen Smalley
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Smalley @ 2003-09-26 13:39 UTC (permalink / raw)
  To: Dale Amon; +Cc: david caplan, NSA's SELinux

On Fri, 2003-09-26 at 09:02, Dale Amon wrote:
> Some things could be difficult though: policy statements
> do not appear to me to have a 1:1 relation to the binary 
> representation.

Correct.  A policy statement may specify sets of types and classes as
well as using type attributes to represent sets of types; these
statements are expanded into individual (source type, target type,
target class, access vectors or new types) tuples in the binary
representation.  Also, you may have overlapping or even redundant policy
statements in the policy.conf that are unioned by the policy compiler
(particularly due to macro expansions), so removing a statement doesn't
necessarily mean that the permissions should go away.  If you take a
close look at the policy patch tools posted to the list back in June by
Frank Mayer, you'll see that they had to consider these issues for that
work.
 
-- 
Stephen Smalley <sds@epoch.ncsc.mil>
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-09-26 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-25 21:45 policy language extensions David Caplan
2003-09-25 21:49 ` David Caplan
2003-09-26 13:02 ` Dale Amon
2003-09-26 13:37   ` David Caplan
2003-09-26 13:39   ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.