Gentoo Archives: gentoo-hardened

From: Pedro Venda <pjvenda@××××××××××××.org>
To: gentoo-hardened@l.g.o
Cc: Julius Loman <lomo@×××××××.net>, Miguel Filipe <miguel.filipe@×××××.com>
Subject: Re: [gentoo-hardened] running php scripts as owner
Date: Wed, 28 Sep 2005 14:11:25
Message-Id: 200509281502.21697.pjvenda@arrakis.dhis.org
In Reply to: Re: [gentoo-hardened] running php scripts as owner by Julius Loman
1 On Wednesday 28 September 2005 07:16, Julius Loman wrote:
2 > On Wed, Sep 28, 2005 at 12:08:24AM -0700, Anthony Gorecki
3 <agorecki@××××××××××.com> wrote:
4 > > On Tuesday, September 27, 2005 23:57, Julius Loman wrote:
5 > > > For security reasons I want to have php scripts running
6 > > > under file owner UID.
7 > >
8 > > PHP's "safe mode" might offer the security that you're looking for.
9 >
10 > I don't think so, at least files created by php scripts will be created
11 > with UID that php is running. I don't want this, so do users.
12
13 This is indeed a serious issue and it deserves attention from careful
14 sysadmins.
15
16 On my previous sysadmin job, me and my team discussed this issue exactly. we
17 were a team of sysadmins that (between many other things) handled a sun
18 solaris server with about 8000 user accounts.
19
20 I can't remember all the arguments, but:
21 - suphp was abandoned due to poor testing and not supporting solaris well;
22 - we didn't know fastcgi, but I assume it works by running php scripts through
23 a shell interpreter called as a cgi. it's an option, and it doesn't require
24 fastcgi... still it caused us trouble because the interpreter was being
25 called with the apache owner. the suexec module has some limitations on this,
26 since the php scripts didn't have .cgi extensions.
27
28 our solution involved patching apache's suexec to handle .php scripts just
29 like .cgi ones, running the interpreter on them.
30
31 the guy who patched the suexec (and worked with me then) is on this list and I
32 believe he'll give it to you, if it looks pretty enough. (CC'd him)
33
34 as for performance, it surely dropped but we didn't really measure it with
35 numbers. that wasn't really the main concern.
36
37 regards,
38 pedro venda.
39 --
40
41 Pedro João Lopes Venda
42 email: pjvenda < at > arrakis.dhis.org
43 http://arrakis.dhis.org

Replies

Subject Author
Re: [gentoo-hardened] running php scripts as owner Rumen Yotov <rumen_yotov@×××.bg>