From: Andy Lutomirski <luto@stanford.edu>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-kernel@vger.kernel.org, glasgow@beer.net,
albert@users.sourceforge.net
Subject: Re: posix capabilities inheritance
Date: Fri, 24 Oct 2003 09:44:22 -0700 [thread overview]
Message-ID: <3F9956E6.2020709@stanford.edu> (raw)
In-Reply-To: <20031024124150.GA5609@thunk.org>
Theodore Ts'o wrote:
> On Fri, Oct 24, 2003 at 01:44:36AM -0700, Andy Lutomirski wrote:
>
>>1. pI is currently almost useless. If a process really wants a capability
>>to be dropped after exec, it can drop it itself. So redefine pI to mean
>>"these are the only capabilities that this process or its children may
>>_ever_ hold."
>
>
> A lot of the reasons why it looks useless is because we don't have
> filesystem support. The intent behind the POSIX capabilities system
> is that system administrator can control which privileges are
> conferred upon a program when it is exec'ed, as well as which
> privileges it is allowed to inherit. (The idea behind this is that
> even if the exec'ing process wishes to bequeath some super-user
> capabilities across an exec, unless that program has been audited and
> cleared by the site security officer as being cleared to accept that
> additional capability, it shouldn't be given it.) In addition, of
> course, the exec'ing process ought to be allowed to control what
> capabilities it is willing to bequeth.
I agree completely. I'm just suggesting a different way of doing it.
If a process is actually not trusted to have some capability, then it is
presumably not trusted to use helper applications that have that
capability. So make it impossible to use or _regain_ caps that are not
in pI and fI.
On the other hand, if the exec'ing process wants to remove a capability
without this restriction, then it can just drop it and then call exec.
Hence:
pP' = (fP | pP) & pI'; (note pI_'_ -- fI restrictions still take effect
here)
>
> Hence the capabilities inheritance algorithm of:
>
> pP' = fP | (fI & pI)
>
>
>>2. fE is useless. It doesn't seem to have much of a point, and it just
>>adds complexity. (e.g. look at Windows privileges. they start unenabled,
>>and programs have to jump through hoops to use them. I see no security
>>benefit.) So remove fE entirely.
>
>
> It has a lot of point. It's there for the same reason why just
> because you have the root password, you don't want to run as root all
> the time. (At least, sane people don't...) You might make mistakes.
>
> A very basic rule of security is that you only use the least amount of
> privileges to get the job done. That way, if you make a mistake, and
> get tricked into accessing the wrong file (say, because you failed to
> check for .. in pathnames supplied by an untrusted user), you limit
> the amount of damage done because of your bone-headed mistake.
>
> Is this more complexity? Yes. But security generally means more
> complexity. Deal with it. If you don't like, it you can just always
> run with fE set to fP, just as you just login as root and run with
> root privileges all the time. As long as you're careful, and never
> accidentally type the command rm -rf /, why bother with non-root
> accounts on a single-user machine?
>
> (And if you really need help answering that question, then let's just
> agree to disagree, and remind me to never hire you to be a system
> administrator on any of my machines....)
We are both talking about the _file_ effective mask, right? I
absolutely agree that pI is needed.
I've been programming Windows for a long time, and windows has a
capability system. Essectially, a "privilege" (capability) is either
present or not present, and, if present, either enabled or disabled.
This enabled state corresponds to effectiveness in POSIX -- programs can
freely change it. All capabilities are disabled by default (almost --
there's a pointless exception, of course). The result is that every
program that uses a privileged function (e.g. change the time, restart,
etc.) wraps that call with something that turns enables the capability
at first, then disables it. This has no benefit -- a hijacked
privileged program can still enable them, and the admin never sees this,
because everything enables them. I'm not saying that the ability to
disable capabilities is bad (e.g. single-process file servers absolutely
require it).
Now let's throw fE into the equation. Will admins keep a list of which
programs prefer their capabilities enabled by default? If I'm an admin,
and I don't trust a program, I won't give it the capability _at all_.
Just telling the program "I don't trust you, so please to do
such-and-such unless you remember to enable the capability first" seems
useless. I think a sensible capability system will choose a sane
default at leave it there.
>
>
>>3. The current use of the capability bits is not as fine-grained as it
>>could be, and lacks the ability to restrict normal users.
>
>
> No. Bad, bad, bad, bad, bad idea.
I imagined that admins or users would remove almost everything from the
inheritable mask so that the untrusted program is not given the change
to screw up. I'm perfectly willing to drop that part, though.
I think that my proposal for extending super-user capabilities still has
a lot of value, though. Things like CAP_SYS_ADMIN are far to wide in
scope, and I think that can be fixed without breaking old applications.
Andy
next prev parent reply other threads:[~2003-10-24 16:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.n4rmmgg.2423pm@ifi.uio.no>
[not found] ` <fa.l1oevhb.1s5k583@ifi.uio.no>
2003-10-24 8:44 ` posix capabilities inheritance Andy Lutomirski
2003-10-24 12:41 ` Theodore Ts'o
2003-10-24 16:44 ` Andy Lutomirski [this message]
2003-10-24 20:58 ` David Wagner
[not found] <fa.f26d55g.1qgijbi@ifi.uio.no>
[not found] ` <fa.hq0dft9.9i0obd@ifi.uio.no>
2003-10-24 21:24 ` Andy Lutomirski
[not found] <fa.f4bs2b4.fhub0m@ifi.uio.no>
2003-10-23 22:05 ` Michael Glasgow
2003-10-23 22:59 ` Theodore Ts'o
2003-10-24 1:36 ` Ernie Petrides
2003-10-24 2:19 ` Bernd Eckenfels
2003-10-24 5:10 ` Ernie Petrides
2003-10-25 19:51 ` Pavel Machek
2003-10-23 1:41 Albert Cahalan
[not found] <fa.f9mv0tb.27sf3j@ifi.uio.no>
2003-10-23 1:36 ` Michael Glasgow
2003-10-23 1:57 ` Andy Lutomirski
[not found] <fa.f36f4t9.1rg8j3v@ifi.uio.no>
2003-10-22 7:11 ` Michael Glasgow
2003-10-22 19:40 ` Andy Lutomirski
[not found] <fa.hehull9.10mmngt@ifi.uio.no>
2003-10-21 18:24 ` Andy Lutomirski
-- strict thread matches above, loose matches on Subject: below --
2003-10-21 11:26 Michael Glasgow
2003-10-23 16:46 ` Theodore Ts'o
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=3F9956E6.2020709@stanford.edu \
--to=luto@stanford.edu \
--cc=albert@users.sourceforge.net \
--cc=glasgow@beer.net \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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.