Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 4892363218F for ; Wed, 16 Jun 2010 18:26:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 22306-10 for ; Wed, 16 Jun 2010 21:26:40 +0000 (UTC) X-Greylist: delayed 00:43:48.193357 by SQLgrey-1.7.6 Received: from progressive.micfo.com (progressive.micfo.com [174.34.188.2]) by mail.postgresql.org (Postfix) with ESMTP id 06B25633848 for ; Wed, 16 Jun 2010 18:26:40 -0300 (ADT) Received: from 87-204-194-135.dg-net.pl ([87.204.194.135]:55019 helo=radek.localnet) by progressive.micfo.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1OOzRf-0003bx-OL for pgsql-jdbc@postgresql.org; Wed, 16 Jun 2010 15:42:47 -0500 From: =?utf-8?q?Rados=C5=82aw_Smogura?= To: pgsql-jdbc@postgresql.org Subject: Re: Java .pgpass reader Date: Wed, 16 Jun 2010 22:44:16 +0200 User-Agent: KMail/1.12.4 (Linux/2.6.31-gentoo-r10; KDE/4.3.5; x86_64; ; ) References: <4C1912D0.8010405@scharp.org> In-Reply-To: <4C1912D0.8010405@scharp.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201006162244.16266.rsmogura@softperience.eu> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - progressive.micfo.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - softperience.eu X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.448 tagged_above=-10 required=5 tests=BAYES_40=-0.001, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: * X-Archive-Number: 201006/60 X-Sequence-Number: 20630 Dnia =C5=9Broda 16 czerwiec 2010 o 20:07:12 Scott Langley napisa=C5=82(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? =2Epgpass - could be a little usefull for desktop JDBC application, and alm= ost=20 useless for server applications (and pgpass was created, as i think, to=20 provide password for server jobs - CRON etc.) pg_service.conf - i think, this is much more interesting, but only for desk= top=20 applications; server applications generally connect to database through=20 WEB/EJB/WS + J2EE and J2EE servers supports much more advanced way of name= =20 mapping - e.g. the driver could search such file on network share or in use= r=20 shared folder. :) Implementation of this should be turned off by default, as it could decreas= e=20 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= =20 files) is never secure, because hacker at 90% can retrive orginal password = (if=20 it's not encrypted with user provided password), or at least can reproduce= =20 chain of activities to login to database. In theory the beter way is to use= =20 user-in-mind password (but depends who uses application), and use any type = of=20 SSO / e-wallets / Active Directory auto login, etc. Ofcourse it's sometimes= =20 depends on particular needs. Giving a user password to DB is much more unsecure just because it is - us= er=20 can see data that it should not see, or perform other bad tasks. (deleting,= =20 updating, granting). But... generally i vote for yes. This could be helpfull for some fast and=20 simple applications.