From: Geoffrey McRae <geoff@rabidhost.com>
To: Peter Teoh <htmldeveloper@gmail.com>
Cc: Valdis.Kletnieks@vt.edu, Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: New Security Features, Please Comment
Date: Wed, 03 Dec 2008 16:02:25 +1100 [thread overview]
Message-ID: <1228280545.6679.40.camel@lappy.spacevs.com> (raw)
In-Reply-To: <804dabb00812022035k1876a521qa41cd4634b70f9a2@mail.gmail.com>
On Wed, 2008-12-03 at 12:35 +0800, Peter Teoh wrote:
> On Wed, Dec 3, 2008 at 12:02 PM, Geoffrey McRae <geoff@rabidhost.com> wrote:
> >
> > My initial concept is to implement a HTTP server that is designed from
> > the ground up to use this new functionallity. Each server that has been
> > pre-forked will just sit there until the parent sets its uid/gid and
> > hands it the request to handle.
> >
>
> I think the above is the core issue - you have something privileged to
> be executed. So why not execute it in a small, code-verifiable
> implementation, just like the Privilege Separation idea of SSH?
>
> http://www.citi.umich.edu/u/provos/papers/privsep.pdf
This would incur that any dependant programs such as PHP would need to
be re-written to talk to the privlaged process for privlaged operations,
thus increasing the complexness of the application. Also, if there is a
exploitable bug in the communication between the parent and child, the
parent with superuser access could be compromised.
The method I am suggesting fills these gaps, the parent cant be
compromised since the children can not talk to it, and it does not have
elevated privlages once it has started up, so even if it was compomised
somehow, the worst it could do is screw up unprivlaged user's files
within the uid/gids specified in the enable_setpresuid function.
So there are two advantages here:
* The parent is much harder to compromise as the child cant talk to it.
* The child does not have high enough privlages to change its own
uid/gid, but has enough access to perform all required tasks without
needing any special privlages.
>
> Everything is done in userspace. SInce the privileged component is
> small, it is easy to verify for correctness. The rest execute with
> lesser privilege.
>
> Recently, the hypervisor has been used to implement this verifiable
> source code concept: see:
>
> http://www.ghs.com/news/20081117_integrity_EAL6plus_security.html
>
> where GreenHill achieved EAL6 certification - as it built its entire
> kernel on top of the hypervisor. (called Separation Kernel,
> conceptually similar to that of Privilege Separation in SSH).
>
> Just my 2cts :-).
>
Again, this is alot of overhead and complexaty that for the kind of task
that I am trying to accomplish.
Right now the only forseeable problem is that if a process holds a fd
open when the parent app changes its uid/gid, which still, the worst
that it can do is read/write another user's file. But the solution to
this should be trivial, just close all fds the process should not have
access to in the kernel when the uid/gid is changed.
If a program crashes because it did not expect its uid to change, it
should either be updated to handle being used in this manner, or not be
used at all. Most programs, including PHP in my initial testing perform
flawlessly when their uid/gid is changed before they are handed a new
script to parse.
-Geoff
next prev parent reply other threads:[~2008-12-03 5:02 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-02 23:28 New Security Features, Please Comment Geoffrey McRae
2008-12-03 0:24 ` Geoffrey McRae
2008-12-03 0:53 ` Alan Cox
2008-12-03 1:44 ` Geoffrey McRae
2008-12-03 2:11 ` David Newall
2008-12-03 2:55 ` Valdis.Kletnieks
2008-12-03 4:02 ` Geoffrey McRae
2008-12-03 4:35 ` Peter Teoh
2008-12-03 5:02 ` Geoffrey McRae [this message]
2008-12-03 6:54 ` David Newall
2008-12-03 10:29 ` Alan Cox
2008-12-03 12:42 ` Nick Andrew
2008-12-03 12:46 ` Alan Cox
2008-12-03 22:44 ` Geoffrey McRae
2008-12-03 23:08 ` Alan Cox
2008-12-03 23:27 ` Peter Teoh
2008-12-03 23:40 ` Geoffrey McRae
2008-12-04 21:56 ` Valdis.Kletnieks
2008-12-04 22:30 ` Geoffrey McRae
2008-12-05 3:35 ` Valdis.Kletnieks
2008-12-05 3:44 ` Nick Andrew
2008-12-05 3:50 ` Geoffrey McRae
2008-12-05 4:03 ` Valdis.Kletnieks
2008-12-03 23:39 ` Miquel van Smoorenburg
2008-12-04 0:00 ` Geoffrey McRae
2008-12-04 0:22 ` Peter Teoh
2008-12-04 0:08 ` Alan Cox
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=1228280545.6679.40.camel@lappy.spacevs.com \
--to=geoff@rabidhost.com \
--cc=Valdis.Kletnieks@vt.edu \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=htmldeveloper@gmail.com \
--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