Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhwBv-00EALJ-U7 for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Mar 2024 18:40:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rhwBt-00D4g5-Ol for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Mar 2024 18:40:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhwBt-00D4fx-G4 for pgsql-bugs@lists.postgresql.org; Wed, 06 Mar 2024 18:40:33 +0000 Received: from tamriel.snowman.net ([70.109.60.50]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rhwBq-003BNg-AY for pgsql-bugs@lists.postgresql.org; Wed, 06 Mar 2024 18:40:32 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 5DC055F7B7; Wed, 6 Mar 2024 13:40:26 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=snowman.net; s=dkim; t=1709750426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=m7vzbKwWPzljcRAkKQ+htKiWavF8E9PCDZfeRKrKF+o=; b=XBEKKubOyq6kRpQSiGM/Ly06PW3PRngK4Sz9Im9tjNxD0LVlWi4Jx5tpJiUYizmr8hExPg tGam3wuT1mPQ3HNmG37lx4GhZWKb60Ou0m+GmSdc/908+ylF0zrqqMe7J05PgFac1BW36S RMeebM/VIYLRX+9Y4v+rxZp28vKJoQY= Date: Wed, 6 Mar 2024 13:40:26 -0500 From: Stephen Frost To: Tom Lane Cc: coelho.viniciusdf@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18379: LDAP bind password exposed Message-ID: References: <18379-385d04dcaa62d6fd@postgresql.org> <139544.1709739622@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="cHueemA4jM0n2zg2" Content-Disposition: inline In-Reply-To: <139544.1709739622@sss.pgh.pa.us> User-Agent: Mutt/2.1.4 (2021-12-11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --cHueemA4jM0n2zg2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > PG Bug reporting form writes: > > Whenever a login attempt is made using LDAP authentication, the entire > > configuration line from the pg_hba.conf file is being logged in the > > PostgreSQL log files. This includes the LDAP bind password (ldapbindpas= swd), > > which is being recorded in plaintext. This practice poses a serious sec= urity > > risk, as it exposes sensitive credentials in log files that might be > > accessed by unauthorized individuals. >=20 > We do not consider this a bug. There are very many ways that > sensitive information could appear in the postmaster log file. > There's no way to block them all, not least because some items > are ones that the server could not know are sensitive (consider > for instance credit card details, or medical information in a > database under HIPAA rules). You *must* make arrangements to > secure the postmaster log equally carefully as the database itself. While I agree that users should take steps to secure their log files, I'd argue that it's best practice to avoid dumping sensitive data into log files, which it seems like it would be in this case. I'm not suggesting that this is bug-worthy or that we should go to excessive lengths to try and prevent every such case, but if someone showed up with a reasonable patch to replace the sensitive information in a pg_hba line with ****, I would be on the side of supporting that. > Having said that, you might consider moving away from LDAP > authentication. It's not considered best practice anymore, > notably because it requires the server to see the user's > unencrypted password, and then turn around and pass that on > to the LDAP server. GSSAPI/SSPI (a/k/a Kerberos, or Active > Directory in the Microsoft universe) provide substantially > better centralized authentication technology that's more > secure in quite a few ways. Fully agree with this. The best approach to dealing with this is to move away from PG's 'ldap' auth type. Thanks! Stephen --cHueemA4jM0n2zg2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEwf6gbxKhD863zrx/7WyKOINHZFUFAmXouJcACgkQ7WyKOINH ZFUwGw//UzDh3aKV67TIb/i0aCbvQNdDCOwyYENp8NXduG4NDgIpMYITZd60x3y9 yvDqQ7TuqpwWiDrjOFDZMd5vfSqNQJZy76m1/idxbCDcylVTGGGml6H+lGm9fqaP QK/TR2Yk2D91kZO/FzE2GJzhOR7Gvo03lRmKXbJQSxZBuIXfxudCHrlbVP9knbd5 O2s58LMDfE5IMgXcaiboi/4o9sC2RTEQ3YjQO+P+eV9x3IGciA8GKQIeIe07H0R2 Mu5qj3793e0f1y1E7yfEgdFBvp76/fH2PRaMUnJ5xDe0iUbnb8Eqa2lQcJhiMrJS h5NJT4d+toFl6fvUwzju3fFfcEObeFMeS/0tJzh3Z3EWz7+EX2KBMsPxXPsnK2jA Zy5BOn7PGfhMpU2uPfgDpt6oKeGgudl9s0qqbGGqJbb7M+wItCt0Lz5R88B08U6U sQeJ6VxLfEMGJZT+oe8gcURjI+02tRIR9TuJ3J/d8NtR1gafQSEsT5+7DifQioBa xEceWqwysz0nw6TaOFeTDgxbFI4CHAFD4aNIW1hDPnxPImUhZ6UUOQeoo0pvu8Sq dtOnCZE7m5rsdDVTpTdL2BCzFUl3A1TVzHdcy0cEccy+k6l294BYil3OGGyq2YJD qq2nXNn8Bm/l8k4suKx+Q+bqJ3MqQC9Jst193vEaoZOlxSug7Fw= =pTXX -----END PGP SIGNATURE----- --cHueemA4jM0n2zg2--