linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: daw@mozart.cs.berkeley.edu (David Wagner)
To: linux-kernel@vger.kernel.org
Subject: Re: User-manageable sub-ids proposals
Date: 13 Dec 2001 23:24:01 GMT	[thread overview]
Message-ID: <9vbdah$59k$1@abraham.cs.berkeley.edu> (raw)
In-Reply-To: <20011205143209.C44610@wobbly.melbourne.sgi.com> <20011212204333.A4017@pimlott.ne.mediaone.net> <3C1873A2.1060702@namesys.com> <20011213113616.B6547@pern.dea.icai.upco.es>

Romano Giannetti  wrote:
>I was thinking about the idea of sub-ids to enable users to run "untrusted"
>binary or "dangerous" one without risk for their files/privacy. 

Can I point you to some work I've done on this topic?
We built a tool called Janus (alas, it required kernel patches).
http://www.cs.berkeley.edu/~daw/janus/

Your basic goal seems like a good one: it'd be really nice if you could
run untrusted code in a sandbox that nothing can escape.  Based on
our experience, though, I've come to believe you probably want a more
sophisticated solution than the one you outlined.

First, the 'nobody' userid (and equivalents) leave a lot to be desired.
A troubling number of system resources can be accessed by 'nobody': there
are usually an enormous quantity of world-readable files; more troubling,
there are tons of world-executable setuid programs, and it's hard with a
purely userid-based mechanism to be sure that they won't provide an escape
hatch; not to mention other resources, such as interprocess communication,
network sockets, and so on.

The conclusion we came to is that you really need something more powerful
than the existing access control measures.  Unix systems are really not
very good at preventing attacks by local users.

A second claim is that you really want to start from the Principle
of Least Privilege: give the untrusted process the absolute minimum
privilege necessary for it to accomplish its task, and nothing more.
Userid-based mechanisms do a lousy job at achieving this.

This, by the way, is analogous to the "default deny" policy that you may
be familiar with from the firewalls world: if you start by giving the
untrusted process zero privileges and then explicitly declare only the
ones you want allowed, you greatly reduce the risk that the untrusted
process can escape and cause harm in some way you didn't expect.

A third observation is that you need to control access to a lot more
than just the filesystem.  You want to control the network (prevent the
spread of viruses; and if anyone uses IP-based authentication, or if
your machine is inside a firewall, prevent the untrusted process from
abusing the good name of the local host).  You want to control resources
like IPC, signals, resource usage, and so on.  And I claim you want more
fine-grained control than POSIX capabilities provide.

A fourth observation is that in practice it's useful to provide more
than just isolation: you often also want to allow some limited degree
of sharing between trusted and untrusted processes.  chroot() is not
so good in this respect, even apart from the fact that it protects only
the filesystem and not any of the other resources on the system.

The Janus approach is to interpose on system calls to impose a more
restrictive security policy.  We use ptrace() and the like to do this
from userspace.  It's a little clunky, especially since support for
process tracing on Linux has shortcomings, but it works.  We've run
a web browser, a web server, etc., inside the restricted environment
Janus provides.  Janus is just one approach, of course, and there are
a number of other projects that have followed related directions (DTE,
consh, mapbox, SubDomain, SELinux, etc.).

Looking to the future, may I direct your attention to the Linux Security
Module project?  They're doing some great work that I think will lay
a fantastic foundation for trying out many different approaches to
this problem.

  parent reply	other threads:[~2001-12-13 23:25 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-05  3:32 [PATCH] Revised extended attributes interface Nathan Scott
2001-12-05  9:08 ` Anton Altaparmakov
2001-12-06  5:46   ` Nathan Scott
2001-12-06  3:05 ` Daniel Phillips
2001-12-06  5:41   ` Nathan Scott
2001-12-06 15:25     ` Daniel Phillips
2001-12-06 23:15       ` Nathan Scott
2001-12-07  1:45         ` Daniel Phillips
2001-12-07  2:03         ` Daniel Phillips
2001-12-07  3:51           ` Nathan Scott
2001-12-07 20:20 ` Stephen C. Tweedie
2001-12-08  4:58   ` Nathan Scott
2001-12-08 20:17     ` Hans Reiser
2001-12-11  2:42       ` reiser4 (was Re: [PATCH] Revised extended attributes interface) Nathan Scott
2001-12-11 12:02         ` Hans Reiser
2001-12-11 19:23         ` Anton Altaparmakov
2001-12-11 20:14           ` reiser4 (was Re: [PATCH] Revised extended attributesinterface) curtis
2001-12-11 21:34             ` Hans Reiser
2001-12-11 23:04               ` curtis
2001-12-11 23:28                 ` Hans Reiser
2001-12-11 23:46                   ` Anton Altaparmakov
2001-12-12  1:00                   ` curtis
2001-12-11 21:21           ` reiser4 (was Re: [PATCH] Revised extended attributes interface) Hans Reiser
2001-12-11 23:33             ` Anton Altaparmakov
2001-12-11 23:59               ` Hans Reiser
2001-12-12  2:16                 ` Anton Altaparmakov
2001-12-12 12:02                   ` Hans Reiser
2001-12-12 13:34                   ` Anton Altaparmakov
2001-12-12 15:40                     ` Hans Reiser
2001-12-13  1:43             ` Andrew Pimlott
2001-12-13  9:23               ` Hans Reiser
2001-12-13 10:36                 ` User-manageable sub-ids proposals Romano Giannetti
2001-12-13 13:37                   ` Ragnar Kjørstad
2001-12-13 16:06                     ` Romano Giannetti
2001-12-13 18:58                       ` Ragnar Kjørstad
2001-12-18  0:17                     ` Pavel Machek
2001-12-13 23:24                   ` David Wagner [this message]
2001-12-21 21:28                   ` Andreas Ferber
2001-12-13 15:27                 ` reiser4 (was Re: [PATCH] Revised extended attributes interface) Andrew Pimlott
2001-12-13 20:47                   ` Hans Reiser
2001-12-13 21:01               ` Anton Altaparmakov
2001-12-10 11:52     ` [PATCH] Revised extended attributes interface Stephen C. Tweedie
2001-12-10 15:00       ` Peter J. Braam
2001-12-10 15:56         ` Stephen C. Tweedie
2001-12-10 16:00           ` Mr. James W. Laferriere
2001-12-10 16:15             ` Stephen C. Tweedie
2001-12-10 19:01           ` John Stoffel
2001-12-11  1:22       ` Timothy Shimmin
2001-12-11 11:33         ` Stephen C. Tweedie
2001-12-11 15:15           ` Implementing POSIX ACLs - was: " Anton Altaparmakov
2001-12-11  1:41       ` Nathan Scott
2001-12-11 13:47         ` Stephen C. Tweedie
2001-12-11 18:23           ` Hans Reiser
2001-12-11 18:46           ` Anton Altaparmakov
2001-12-11 23:37           ` Implementing POSIX ACLs - was " Nathan Scott
2001-12-11 13:30       ` Implementing POSIX ACLs - was: " Anton Altaparmakov
2001-12-11 14:34         ` Stephen C. Tweedie
2001-12-13 16:02 User-manageable sub-ids proposals Jacques Gelinas

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='9vbdah$59k$1@abraham.cs.berkeley.edu' \
    --to=daw@mozart.cs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    /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).