Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnVKr-0002F1-L3 for pgsql-admin@arkaria.postgresql.org; Mon, 22 Jun 2020 22:54:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jnVKq-0001iw-Hn for pgsql-admin@arkaria.postgresql.org; Mon, 22 Jun 2020 22:54:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnVKq-0001iI-AC; Mon, 22 Jun 2020 22:54:40 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jnVKo-0004Y5-4q; Mon, 22 Jun 2020 22:54:39 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 43CF75F79F; Mon, 22 Jun 2020 18:54:37 -0400 (EDT) Date: Mon, 22 Jun 2020 18:54:37 -0400 From: Stephen Frost To: Pavan Kumar Cc: "David G. Johnston" , Pgsql-admin , "pgsql-generallists.postgresql.org" Subject: Re: scram-sha-256 encrypted password in pgpass Message-ID: <20200622225437.GK3125@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="4ybNbZnZ8tziJ7D6" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --4ybNbZnZ8tziJ7D6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Greetings, * Pavan Kumar (pavan.dba27@gmail.com) wrote: > > What would be the point of storing the encrypted password instead of the > > plaintext one? > As per our organization security policies, we can 't keep any passwords in > plain text format. Then you need to *actually* encrypt the password in whatever file you'd like, and then decrypt it using a key from somewhere when you go to connect to PG and use it to connect to PG. Anything that doesn't involve some key from somewhere being used to decrypt it isn't actually meeting your organization's security policies, certainly not anything that's just dumping whatever into .pgpass and then allowing you to connect. > I am working on postgres + pgbouncer setup, tested pgbouncer 1.14 where we > have support to use encrypted password in userlist,txt file. I am > surprised why pgpass is not supporting encrypted passwords. I'm not sure what you mean here, but I'm pretty confident it's not actually what you think. If you can directly connect with it, without providing some kind of additional key, then it's, pretty much by definition, not encrypted. Thanks, Stephen --4ybNbZnZ8tziJ7D6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJe8TasAAoJEO1sijiDR2RVFfkP/2ZNvp+zZjMKFAcGZNYN3lSA 3A72nycjdpRWkkHFWQeyYjuxYa2vwZtfjCl6CXv0gokcfQjvdj7Mk/Bt13B75dk2 FlwSOJnHkf38hNrBhal9XgQlQ5/1RnL25Wszy6BZoRJUa53O6NNDSgMaPJmt9nht 7n+UQVkStp0PjHHHB42qpT0PMpY1HbQ832LPOD5Y1Pe83Qa16cnILGsSRpGoRzIT zEQ+EUrDLiuSYwdw3gVIQ5g+PvHP5oJu/Hb3Lm9swY6xpoMZezFafaNtWIxL15wB xvDAmWhRE46YtAAb18M+qwBzIl/owBYi123kAwmouQwBNaDgfxW7iis45ixVA6d/ HiSZ3KdImy00QkwJFEZn/J9qYKAwWePO7hdKhhVP4acGBUTyzy9TJFV3O35T/OnA KIcw23tYzCkERKGqMqbmdgrBMrFnNAeABRZN7yf+9VUgDbEb/74tYjm3QRT8Gi7L yCDHkx/Zu9KU9OIoEMjIb5UsO/noR1/1a1IE5enYE5erLW2caazxgbovKCdA7GNj tZMPjDhbT8RyhKRIKG5Ki2kgQ+dxCGmYf4MD0RcuZocCEWspKXNgrUUKJTz9rHAT bZm1zTEHwxb/l2YQwAA+V4pHDaivw6OPfrBWmrAebufjs6BeOuKi81/iQuSkfI/V RDvwGo166J7klWVfyxvu =SMtn -----END PGP SIGNATURE----- --4ybNbZnZ8tziJ7D6--