netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Crispin Cowan <crispin@crispincowan.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
	paul.moore@hp.com, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, takedakn@nttdata.co.jp,
	linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [TOMOYO #7 30/30] Hooks for SAKURA and TOMOYO.
Date: Mon, 14 Apr 2008 20:21:42 -0700	[thread overview]
Message-ID: <48041F46.8030004@crispincowan.com> (raw)
In-Reply-To: <20080414134858.GV11962@parisc-linux.org>

Matthew Wilcox wrote:
> On Sun, Apr 13, 2008 at 06:41:19PM -0700, Crispin Cowan wrote:
>   
>> Rather, it is "can write to /tmp/ntpd/*". You *grant* permissions. You 
>> do *not* throw deny rules.
>>     
> So primarily we're concerned here with things that are running as root,
> daemons and the like.  Normal unix file permissions (or ACLs, if you
> must) are adequate to handle anything not running as uid 0.
>   
That's not true. Both AppArmor and SELinux Targeted Policy address 
confinement of both root and non-root applications. Examples:

    * Confining even non-root applications keeps them from accessing
      world and group accessible files.
    * Many services run as nobody instead of root, and smarter ones
      create themselves a new UID to run as. Even so, confining them is
      useful because the least-privilege posture is much easier to
      specify and verify in a capability model (as SELinux and AppArmor
      are) than an ACL model (as permission bits on files are).
    * You may want to confine a desktop application. E.g. Pidgin is a
      great IM tool because it speaks so many protocols, but with that
      large functionality comes a large attack surface, and it has had
      vulnerabilities from time to time. A confined IM client can be
      configured to only have access to your IM files, and not e.g. your
      SSH private keys.


> I don't see what apparmour and tomoya buy us that namespaces can't.
>   
Controlled overlap. You can use AppArmor to confine every *individual* 
piece of a web site shopping cart, and yet they still can interact with 
each other by sharing files. You cannot do that with namespaces.

Conversely, it is very convenient to use namespaces to set up private 
virtual domains, and that is not at all convenient to do with AppArmor, 
TOMOYO, or SELinux.

The correct answer is to use namespaces for total isolation (virtual 
domain hosting) and LSM confinement tools for security within a virtual 
domain.

> Maybe a nicer interface, but that's something that a nice userspace
> management interface can handle.
>   
Not true. Ease of management of access control is about the security 
model. Cute GUIs help, but not much.

> Create an empty namespace.  Create /tmp/ntpd in it.  Bind the outside
> /tmp/ntpd onto that directory.  Presto, the equivalent to an allow-rule
> of 'can write to /tmp/ntpd/*'.
>   
Now get ntpd to show you that you need to do this, in one pass. If you 
already know all of the files to be accessed, and you are going to write 
the security policy by hand, then the two approaches might be kind of 
comparable. But that's not how AppArmor policies are created. This is 
not a minor distinction.

> The equivalent of 'can read, but not write /home/crispin/.ssh/id_rsa.pub'
> will need r-o bind mounts, which Miklos seems to have become distracted
> from by working on the hooks for TOMOYA.
>
> Do you have a good example of something that apparmour can protect against
> that namespaces can't?
>   
See above. The major classes of things that namespaces can't do are:

    * deliberate overlap
    * learning mode
    * wild cards, e.g. 'can read /var/www/**.html' to grant access to
      all of the HTML files in the tree, but not the .pl source code files

Crispin

-- 
Crispin Cowan, Ph.D.               http://crispincowan.com/~crispin
The Olympic Games: Symbolizing oppressiiion and corruption for over a
hundred years



  reply	other threads:[~2008-04-15  3:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080404122242.867070732@I-love.SAKURA.ne.jp>
2008-04-04 12:22 ` [TOMOYO #7 07/30] Some wrapper functions for socket operation Tetsuo Handa
2008-04-04 12:23 ` [TOMOYO #7 30/30] Hooks for SAKURA and TOMOYO Tetsuo Handa
2008-04-04 16:29   ` Daniel Walker
2008-04-07 13:56     ` Tetsuo Handa
2008-04-07 15:39       ` Daniel Walker
2008-04-07 15:40   ` Paul Moore
2008-04-07 22:57     ` Casey Schaufler
2008-04-09  8:37     ` Toshiharu Harada
2008-04-09 12:49       ` Stephen Smalley
2008-04-10  5:57         ` Toshiharu Harada
2008-04-10 12:51           ` Stephen Smalley
2008-04-11 11:48             ` Toshiharu Harada
2008-04-09 13:11       ` Matthew Wilcox
2008-04-09 13:26         ` Stephen Smalley
2008-04-11 14:12         ` Tetsuo Handa
2008-04-11 14:30           ` Matthew Wilcox
2008-04-12 11:33             ` Tetsuo Handa
2008-04-13 16:36             ` Serge E. Hallyn
2008-04-14  2:05               ` Crispin Cowan
2008-04-14 14:17                 ` Stephen Smalley
2008-04-14 17:05                   ` Casey Schaufler
2008-04-15  4:59                   ` Crispin Cowan
2008-04-16 16:31                     ` Stephen Smalley
2008-04-17  7:49                       ` Crispin Cowan
2008-04-17  8:45                         ` Jamie Lokier
2008-04-17 12:42                         ` Stephen Smalley
2008-04-15 13:00                 ` Toshiharu Harada
2008-04-14  1:41             ` Crispin Cowan
2008-04-14 13:48               ` Matthew Wilcox
2008-04-15  3:21                 ` Crispin Cowan [this message]
2008-04-15  4:57                   ` Al Viro
2008-04-09 13:22       ` Serge E. Hallyn
2008-04-11  3:57         ` Toshiharu Harada

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=48041F46.8030004@crispincowan.com \
    --to=crispin@crispincowan.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=netdev@vger.kernel.org \
    --cc=paul.moore@hp.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=takedakn@nttdata.co.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).