pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew McMillan <andrew@catalyst.net.nz>
To: pgsql-php@postgresql.org
Subject: Re: securing PHP/Postgresql (was: MD5 in pg and php)
Date: Sun, 02 May 2004 00:07:26 +1200
Message-ID: <1083413245.6439.43.camel@lamb.mcmillan.net.nz> (raw)
In-Reply-To: <20040429165723.GA18588@localhost.localdomain>
References: <20040429070716.GA6918@localhost.localdomain>
	<20040429101129.GC26489@wolff.to>
	<20040429165723.GA18588@localhost.localdomain>

On Thu, 2004-04-29 at 18:57 +0200, Joolz wrote:
> 
> I have to think about it long and hard :-), the extra "layer" makes
> things more secure, I would only have to register username (for
> auditing purposes) plus the "role" in session variables, which could
> be md5()'d. Still, the extra layer is from a logical point of view
> redundant and thus errorprone.
> 
> Still, it might be a good idea. If anyone cares to share their opinion
> on the matter (or discuss how you handled this), TIA!

For myself, I handle security roughly as follows:

Password is stored as a salted md5, which means that two users with the
same password have different on-disk records of it.

Logged in user gets a session cookie which is an md5 of random data plus
a session id.  The session id is looked up, and the random data (which
is only known server-side) is validated.  Of course the session id is
predictable, but the random data is not.

I use a general user-id to access the database, rather than database
users and permissions.  I generally find that the database permissions
model is not a good fit to the permissions I want for my website.

Hope this is of interest,
					Andrew McMillan.
-------------------------------------------------------------------------
Andrew @ Catalyst .Net .NZ  Ltd,  PO Box 11-053,  Manners St,  Wellington
WEB: http://catalyst.net.nz/             PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201       MOB: +64(21)635-694      OFFICE: +64(4)499-2267
                        
-------------------------------------------------------------------------




view thread (2+ messages)

Message-ID: <1083413245.6439.43.camel@lamb.mcmillan.net.nz>
Permalink:  ../1083413245.6439.43.camel@lamb.mcmillan.net.nz/
Also on:    postgresql.org/message-id/1083413245.6439.43.camel@lamb.mcmillan.net.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: andrew@catalyst.net.nz
  Subject: Re: securing PHP/Postgresql (was: MD5 in pg and php)
  In-Reply-To: <1083413245.6439.43.camel@lamb.mcmillan.net.nz>
  References: <20040429070716.GA6918@localhost.localdomain> <20040429101129.GC26489@wolff.to> <20040429165723.GA18588@localhost.localdomain> <1083413245.6439.43.camel@lamb.mcmillan.net.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox