From: Radosław Smogura <rsmogura@softperience.eu>
To: pgsql-jdbc@postgresql.org
Subject: Re: Java .pgpass reader
Date: Wed, 16 Jun 2010 22:44:16 +0200
Message-ID: <201006162244.16266.rsmogura@softperience.eu> (raw)
In-Reply-To: <4C1912D0.8010405@scharp.org>
References: <4C1912D0.8010405@scharp.org>
Dnia środa 16 czerwiec 2010 o 20:07:12 Scott Langley napisał(a):
> Did anyone ever implement code in Java to read Postgres configuration
> information from a user's .pgpass file - or a more general
> pg_service.conf - as discussed in this thread back in 2006?
.pgpass - could be a little usefull for desktop JDBC application, and almost
useless for server applications (and pgpass was created, as i think, to
provide password for server jobs - CRON etc.)
pg_service.conf - i think, this is much more interesting, but only for desktop
applications; server applications generally connect to database through
WEB/EJB/WS + J2EE and J2EE servers supports much more advanced way of name
mapping - e.g. the driver could search such file on network share or in user
shared folder. :)
Implementation of this should be turned off by default, as it could decrease
security of servers.
> My organization uses .pgpass files to securely store and read user's
> passwords when user run applications in Perl and Python but currently
> not for Java.
Hmm... I will disagre.
Storing password in any not-full-user-controled file (or not in wallet type
files) is never secure, because hacker at 90% can retrive orginal password (if
it's not encrypted with user provided password), or at least can reproduce
chain of activities to login to database. In theory the beter way is to use
user-in-mind password (but depends who uses application), and use any type of
SSO / e-wallets / Active Directory auto login, etc. Ofcourse it's sometimes
depends on particular needs.
Giving a user password to DB is much more unsecure just because it is - user
can see data that it should not see, or perform other bad tasks. (deleting,
updating, granting).
But... generally i vote for yes. This could be helpfull for some fast and
simple applications.
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-jdbc@postgresql.org
Cc: rsmogura@softperience.eu
Subject: Re: Java .pgpass reader
In-Reply-To: <201006162244.16266.rsmogura@softperience.eu>
References: <4C1912D0.8010405@scharp.org> <201006162244.16266.rsmogura@softperience.eu>
* 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