BugTraq
Re: Re: PHP security (or the lack thereof) Jun 21 2006 11:52PM
nabiy hotmail com (2 replies)
Re: PHP security (or the lack thereof) Jun 24 2006 05:07AM
Ronald Chmara (ron Opus1 COM) (1 replies)
RE: PHP security (or the lack thereof) Jun 26 2006 04:06PM
Geo. (geoincidents nls net) (3 replies)
Re: PHP security (or the lack thereof) Jun 26 2006 07:37PM
Mrten (bugtraq ii nl)
Re: PHP security (or the lack thereof) Jun 26 2006 05:45PM
Paul Schmehl (pauls utdallas edu) (1 replies)
RE: PHP security (or the lack thereof) Jun 27 2006 11:53AM
Geo. (geoincidents nls net) (1 replies)
Re: PHP security (or the lack thereof) Jun 29 2006 12:44AM
Kevin Waterson (kevin oceania net)
Re: PHP security (or the lack thereof) Jun 26 2006 05:32PM
Matthias Kestenholz (lists spinlock ch) (1 replies)
RE: PHP security (or the lack thereof) Jun 27 2006 11:41AM
Geo. (geoincidents nls net) (1 replies)
Securing PHP or finding PHP alternatives (was: PHP security (orthe lack thereof)) Jul 08 2006 02:48AM
Gezim Hoxha (gezimetc shaw ca) (4 replies)
Re: Securing PHP or finding PHP alternatives Jul 11 2006 06:21AM
Michael Shigorin (mike osdn org ua)
Re: Securing PHP or finding PHP alternatives (was: PHP security (or the lack thereof)) Jul 10 2006 08:37PM
Meet Myself on the Internet (me arteabstracta net)
Re: Securing PHP or finding PHP alternatives (was: PHP security (orthe lack thereof)) Jul 10 2006 07:25PM
Matthias Kestenholz (lists spinlock ch)
Re: Securing PHP or finding PHP alternatives Jul 10 2006 05:37PM
Crispin Cowan (crispin novell com) (2 replies)
Re: Securing PHP or finding PHP alternatives Jul 11 2006 02:50PM
Sheryl Coppenger (gubydala his com) (2 replies)
Re: Securing PHP or finding PHP alternatives Jul 21 2006 07:29PM
Crispin Cowan (crispin novell com)
Re: Securing PHP or finding PHP alternatives Jul 18 2006 09:35PM
Michael Cordover (michael cordover gmail com)
On 7/11/06, Sheryl Coppenger <gubydala (at) his (dot) com [email concealed]> wrote:
> Crispin Cowan wrote:
> > Gezim Hoxha wrote:
> >> 1.) If I have to write PHP, how do I write secure PHP? Give me a number
> >> of ensures that I can follow and check-mark each and live a happy
> >> life--for the most part.
> >>
> > Program defensively:
> [snip]
> > Test your system:
> [snip]
>
> > Wrap it in AppArmor http://en.opensuse.org/AppArmor for when you screw
> > up ^W^W don't do all the above perfectly.
>
> But that's only available if you're using Suse, right? What about
> hardened PHP, modsecurity, putting Apache in a chroot jail, that sort of
> thing?
>

Yeah, this is an important one. Use security on multiple levels.
Code your stuff so it's invulnerable, but make it so even if it isn't,
the site doesn't collapse. Put your administrative settings in a
different database, with different permissions, to your user stuff -
if possible using the administrator's password as the (my|pg)SQL user
password, so sql injections don't kill the site, just userland data.
Don't have write access where it's unnecessary, or read for that
matter: set permissions properly. Store SQL connections strings and
other sensitive information in a file to be require_once()d from
outside the web-accessible directory, just in case php suddenly
becomes uninstalled. Use php_flag and php_value in .htaccess, in case
your host changes php.ini without telling you. Code so you don't rely
on anything within php.ini. Initialise all variables before you use
them, access user input all within the $_GET, $_POST, $_COOKIE, $_FILE
superglobals.

Also configure your system properly. Keep up to date! Use hardened
php, modsecurity and apache in a jail for a start. Give your php user
limited access only to those files it needs access to. And then it
goes lower - secure your kernel. use ACLs.

The key point here? There are more entranceways to your server than
you think. Block them all. Secure your system in every place
possible. Use encryption. Never, ever, ever rely on a user, or
administrator, for security - have everything coded securely. A good
administrator will keep it that way and add their own restrictions...
but a bad one might not. Also don't be slack once you get into the
admin area. just because it's only meant to be accessed by someone
with a vested interest in the site, that doesn't mean that's how it'll
happen. Some stupid admin will use "d34db33f" as a password and think
they're funny - don't let this compromise the site. And at all costs,
for the sake of humanity, make it so a site compromise can't turn your
server upside down, can't make your server a spamer, and can't modify
anything on the server other than that specific site.

And that is my rant for today.

Michael

--
http://mine.mjec.net/

[ reply ]
Re: Securing PHP or finding PHP alternatives Jul 11 2006 07:54AM
SkyFlash (webmaster hackquest de) (1 replies)
Re: Securing PHP or finding PHP alternatives Jul 18 2006 04:58AM
Crispin Cowan (crispin novell com)
Re: PHP security (or the lack thereof) Jun 23 2006 08:16PM
Crispin Cowan (crispin novell com) (3 replies)
Re: PHP security (or the lack thereof) Jun 24 2006 12:43PM
Glynn Clements (glynn gclements plus com)
Re: PHP security (or the lack thereof) Jun 24 2006 08:28AM
Daniel Hulme (bugtraq doublezero uklinux net)
Re: PHP security (or the lack thereof) Jun 24 2006 05:55AM
Tobias J. Kreidl (Tobias Kreidl NAU EDU)


 

Privacy Statement
Copyright 2010, SecurityFocus