All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: jwcart2@tycho.nsa.gov
Cc: SELinux <selinux@tycho.nsa.gov>,
	Steve Smalley <sds@epoch.ncsc.mil>,
	Karl MacMillan <kmacmillan@mentalrootkit.com>
Subject: Re: Are the reference policy abstractions the right ones?
Date: Tue, 09 Oct 2007 13:34:39 -0400	[thread overview]
Message-ID: <470BBBAF.7090606@manicmethod.com> (raw)
In-Reply-To: <1191942521.2794.89.camel@moss-lions.epoch.ncsc.mil>

James Carter wrote:
> I would like to start a discussion on whether reference policy is
> providing the right abstractions for writing policy.
>
> This is not intended to be an attack on Chris or Dan, or their work.  I
> think that it is obvious that reference policy is much better organized,
> far more useful, and works way better than the old example policy.  We
> don't want to go back to example policy.
>
> One of the goals of reference policy is to provide a more modern feel to
> the policy by eliminating the use of types in a global manner across the
> whole policy.  It does this by allowing interfaces to be defined through
> which permissions can be granted to the types of a module.  There seems
> to be several problems with this.
>
> 1) The user is constantly presented with types.  They are in the audit
> logs, when the label of a process or file is displayed, and even in the
> man pages ("Set cgi scripts with httpd_sys_script_exec_t to allow them
> to run with access to all sys types.")
>
>   


We've been talking about this here as well. I think its clear that types 
should either be global in policy and implementation or they should not 
be global. The latter means sticking with the kinds of abstraction in 
refpolicy but extending it so that audit logs and on-disk labels are 
both presented with those abstractions. This means potentially making 
the kernel implementation of SELinux more complicated but completing the 
currently ill-fated abstractions that we have.

> 2) We have traded needing to know about 2500 types or so to write
> policy, for needing to know around 4000 interfaces.  And no, I don't
> think that SELinux Clippy is the answer.
>
>   

The interfaces have documentation and are well organized where types 
aren't (they aren't even consistent in naming because of legacy names 
being used).

> 3) We don't need to abstract class and permissions, because they don't
> change very much, but frequently the interfaces consist of only a few
> allow rules.  Over 60% of the interfaces have only one line (not
> counting gen_require or refpolicywarn lines).
> Lines   # of Interfaces
>      0    53	These only have a refpolicywarn line
>      1  3080    Around 300 of these consist of a single dontaudit rule
>   

not too surprising, think of these like OO accessors :) The unfortunate 
part is that the symbols still end up globally (which is the other part 
of the problem).

>      2  1224
>      3   269
>      4    80
>      5    29
>      6    14
>      7    11
>      8    10
>      9     5
>     10     7
>  11-50    17
> 51-100     2
>   >100     0
>
> It is true that some to many of these are calling other interfaces or
> macros, so they are a little bit longer than indicated here.  Templates
> are much more useful, but there are still many very short ones.
> Lines   # of Templates
>      1    51
>      2    32
>      3    12
>      4     7
>      5     5
>      6     3
>      7     1
>      8     4
>      9     2
>     10     1
>  11-50    34
> 51-100    24
>   >100    21
>
>
> I think that we need:
>
> 1) A way to say, "I want a domain like that one, without this
> permission, but with that one".  I think that inheritance is the answer,
> because a macro requires you to know ahead of time that someone might be
> interested in making something similar.  I believe that Karl tried to
> start a discussion on inheritance a month ago, but there wasn't any
> interest.  Let's restart that discussion.  I think that whether through
> macros or inheritance, a rule to remove permissions is needed, because
> without one, we have to get the base classes or macros perfect.
>
>   

> 2) A way to export types in some manner that would still allow
> flexibility in renaming or splitting a type locally, without having to
> change the global name.  That global name would also have to be what
> shows up in audit logs and other things.  Maybe this is impossible and
> we are just stuck treating types as global entities.
>   

This relates to what I said earlier about completing the refpolicy 
abstractions by removing the global symbols. I'm not sure how well this 
can be done but I think its worth thinking about, if scoping symbols 
wasn't useful programming would be much different than it is today :)


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

  parent reply	other threads:[~2007-10-09 17:34 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-09 15:08 Are the reference policy abstractions the right ones? James Carter
2007-10-09 17:10 ` Karl MacMillan
2007-10-09 18:54   ` James Carter
2007-10-09 19:07     ` Karl MacMillan
2007-10-09 19:44       ` James Carter
2007-10-09 20:00         ` Karl MacMillan
2007-10-10 15:23           ` Karl MacMillan
2007-10-10 15:47             ` Joshua Brindle
2007-10-10 16:52             ` James Carter
2007-10-10 20:39               ` Karl MacMillan
2007-10-11 17:00                 ` Karl MacMillan
2007-10-11 17:32                   ` James Carter
2007-10-12 16:45                   ` Chad Sellers
2007-10-12 19:53                     ` James Carter
2007-10-12 19:59                       ` Karl MacMillan
2007-10-12 20:48                       ` Chad Sellers
2007-10-15  2:50                   ` James Morris
2007-10-15  3:45                     ` Joe Nall
2007-10-15  4:06                       ` James Morris
2007-10-15 14:30                     ` David P. Quigley
2007-10-15 18:55                     ` Karl MacMillan
2007-10-15 21:15                       ` James Morris
2007-10-15 22:23                         ` Karl MacMillan
2007-10-11 23:30             ` Daniel J Walsh
2007-10-09 17:34 ` Joshua Brindle [this message]
2007-10-09 18:18 ` Christopher J. PeBenito
2007-10-10 15:09 ` Karl MacMillan
2007-10-10 16:25   ` Casey Schaufler
2007-10-10 18:26   ` Paul Moore
2007-10-11  7:18 ` Frank L. Mayer
2007-10-11 20:26   ` James Carter
2007-10-12 16:45     ` Chad Sellers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=470BBBAF.7090606@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=jwcart2@tycho.nsa.gov \
    --cc=kmacmillan@mentalrootkit.com \
    --cc=sds@epoch.ncsc.mil \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.