Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XinxS-0001Pj-Cl for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Oct 2014 17:19:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XinxR-0005j6-8e for pgsql-bugs@arkaria.postgresql.org; Mon, 27 Oct 2014 17:19:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XinxO-0005ix-VZ for pgsql-bugs@postgresql.org; Mon, 27 Oct 2014 17:19:51 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XinxH-00073S-4h for pgsql-bugs@postgresql.org; Mon, 27 Oct 2014 17:19:49 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 95D215F875; Mon, 27 Oct 2014 13:19:42 -0400 (EDT) Date: Mon, 27 Oct 2014 13:19:42 -0400 From: Stephen Frost To: Steven Siebert Cc: Tom Lane , Bruce Momjian , Magnus Hagander , pgsql-bugs Subject: Re: BUG #10680: LDAP bind password leaks to log on failed authentication Message-ID: <20141027171942.GW28859@tamriel.snowman.net> References: <20141011183535.GA21267@momjian.us> <25516.1413142930@sss.pgh.pa.us> <28196.1413749669@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iCAsn4r8TXKsf3HF" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.11.0-19-generic (x86_64) X-Uptime: 13:06:47 up 202 days, 3:25, 7 users, load average: 0.50, 0.23, 0.13 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org --iCAsn4r8TXKsf3HF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Steven, * Steven Siebert (smsiebe@gmail.com) wrote: > At risk of adding more work for me, perhaps we can find a compromise > that would not create this backwards incompatible change while > addressing this and another issue that is related to gov requirements: > storing clear text passwords in configuration files. Similar to the > DBA/auditor role separation, there is a requirement to separate the > roles of the DBA/administrator, and what they have access to - in this > case access to the secret (radiussecret/ldapbindpasswd) the postgres > dba is using to authenticate. We've been able to mitigate this > because our dba is our admin -- but in reality this is an impediment > that each agency would need to work around as well. I agree that there is a requirement to not store passwords in config files, but having secrets stored in independent files actually solves that- those files are then *not* config files. Consider that Kerberos has a keytab file which certainly has secrets in it. As for trying to control what the DBA can see vs. the administrator- that's certainly good too, but not possible with PG if the DBA is a superuser. It doesn't matter if it's encrypted or not, PG must know the secret at some point and a superuser in PG can get access to pretty much anything that the postgres unix user can. This is why there is ongoing work to reduce the need for a superuser role, to make it possible to have an actual DBA role which is *not* a superuser but is still able to get their job done, while superuser would be reserved for system administrators. > 1) replace the secrets with a variable: 'myPassword' changes to > ${myPasswordRef}. We can simply have a new option for the radius auth method that is 'pwfile' or similar- there's no need for real variables. > 2) use pgadmin GUI or a new CLI command ('secphrase' or whatever) to > create a new encrypted phrase If you can demonstrate that this would actually be useful then perhaps it can be considered, but I don't see how this does anything for you- how would PG get the password to use with the radius server? You'd need a key somewhere for that which PG can read. > 3) while printing the hba line, the raw line will contain the variable > string but when the actual secret is requested the encrypted value > will be retrieved Sure, we can print the hba line w/ this new option and not have the secret be leaked to the logfile, but store the actual password for use by the authentication method. > Normally, storing anything in reversible encryption is really just the > same as storing it as clear text, but what I propose is to use the > same asymmetric keys used for secure SSL comms > (http://www.postgresql.org/docs/9.3/static/ssl-tcp.html). =20 Ok- and then what? You encrypt it with a different key than you use for decryption, sure, but PG still has to know the decryption key to be able to actually use the secret.. Now, if you fix radius to not use a shared secret structure... Thanks, Stephen --iCAsn4r8TXKsf3HF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUTn6uAAoJEO1sijiDR2RVv/kQAIzUOIY2LMmnhf9cduqy80z9 sx1JA4a7BLmC+JPm+pMXLSuQ0MwFrHMsTzzmu48v26AYQpRfZF0/d0VDUw9EA5M8 5eCz0dkf8+xxnc6IHAsN3K2wHcXERkLAIp5B/XzEWh0h901W/4vFApm/SrFvjSeW Gb3Timec9TNQ4X3HpPBtYiDSuubXz/y8h0qXXpLJjNem9DPKGwWiWtqVcmkHqJXT kzZpVZlKEpJSdo86+wVQV3x+xBNP8CTKuAjdLKGAvv0GL1htUECx7qTPrLv6VCXe VIqupx//NdcPMLYwDjihtymT6dstOpS+UxmR61sBtJd3+GYxpQCUS9KoBTz8RfKr OTUWKJ1Ub9/gQBPsb1fXpujEzfs6+Z1i7CbIdItf6MwJymH24zkB6ZzzISoJJyfh nmMWHwgxSJCvxSCGi/n2znB2eJgrb1KUSnhLe4OaoOUZ7mFzroPiOsGy0sEmBD0W Y2t5C6DqGeNblc+IYA8aw5FrPYg53GXTHhW6ThIfrUcBN8iGdkd/mwmr87pb/N9y 5Dk+ivmwJ3BZygfDndVnw/rKBB16Gy9HN4bZOKlvuIx4LSfxWKC6OJaSzYbeIgIZ USCl44MKC01UDnEMRNyvoLvPEeSlyYaKPUl+jY81v+6aNTc7zOUZXHQw8OTfQ4lQ L694EZ4D1qhvbxPYHPcC =lcxD -----END PGP SIGNATURE----- --iCAsn4r8TXKsf3HF--