pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Security - local(TRUST) and php/perl access
3+ messages / 2 participants
[nested] [flat]

* Security - local(TRUST) and php/perl access
@ 2002-04-19 14:01 Dave <dave@hawk-systems.com>
  2002-04-19 16:10 ` Re: Security - local(TRUST) and php/perl access Josh Berkus <josh@agliodbs.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Dave @ 2002-04-19 14:01 UTC (permalink / raw)
  To: pgsql-php

Currently we TRUST local users so pretty much any user can access any database
from the shell.
When PHP or Perl(DBI) accesses the postgres database, can they simply specify
any userid and database set as a local user would, or are they restricted to the
"host sameuser 0.0.0.0 0.0.0.0 password" setting in pg_hba.conf

Dave




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Security - local(TRUST) and php/perl access
  2002-04-19 14:01 Security - local(TRUST) and php/perl access Dave <dave@hawk-systems.com>
@ 2002-04-19 16:10 ` Josh Berkus <josh@agliodbs.com>
  2002-04-19 17:45   ` Re: Security - local(TRUST) and php/perl access Dave <dave@hawk-systems.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Josh Berkus @ 2002-04-19 16:10 UTC (permalink / raw)
  To: Dave <dave@hawk-systems.com>; pgsql-php

Dave,

> Currently we TRUST local users so pretty much any user can access any
> database
> from the shell.
> When PHP or Perl(DBI) accesses the postgres database, can they simply
> specify
> any userid and database set as a local user would, or are they
> restricted to the
> "host sameuser 0.0.0.0 0.0.0.0 password" setting in pg_hba.conf

Anything running on the same machine, whether a shell, PHP, or Perl, is
covered by the "trust" statement, unless you make the mistake of
routing your connection through an external interface. 

However, I strongly reccommend against using "trust" on any public web
server.

-Josh Berkus



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Security - local(TRUST) and php/perl access
  2002-04-19 14:01 Security - local(TRUST) and php/perl access Dave <dave@hawk-systems.com>
  2002-04-19 16:10 ` Re: Security - local(TRUST) and php/perl access Josh Berkus <josh@agliodbs.com>
@ 2002-04-19 17:45   ` Dave <dave@hawk-systems.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Dave @ 2002-04-19 17:45 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; pgsql-php

>Anything running on the same machine, whether a shell, PHP, or Perl, is
>covered by the "trust" statement, unless you make the mistake of
>routing your connection through an external interface.

this is what I was afraid of

>However, I strongly reccommend against using "trust" on any public web
>server.

agreed, thus my concern...

it appears however that if everything is set to password (or better) that
postgres doesn't start on reboot.  the startup script reads

case $1 in
start)
    [ -d /usr/local/pgsql/lib ] && /sbin/ldconfig -m /usr/local/pgsql/lib
    [ -x /usr/local/pgsql/bin/pg_ctl ] && {
        su -l pgsql -c \
            'exec /usr/local/pgsql/bin/pg_ctl -w start > /usr/local/pgsql/errlog
        echo -n ' pgsql'
    }
    ;;

essentially what happens is that the startup waits for the password to be
entered, and as such that and any following services in the local/rc directory
are never started... it times out after a time (if memory serves).

workaround without security ramifications?

Dave




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-04-19 17:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19 14:01 Security - local(TRUST) and php/perl access Dave <dave@hawk-systems.com>
2002-04-19 16:10 ` Josh Berkus <josh@agliodbs.com>
2002-04-19 17:45   ` Dave <dave@hawk-systems.com>

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