<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 7, 2018 at 10:50 AM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Usama,<br>
<br>
If a user has multiple Pgpool-II installation (typically with watchdog<br>
enabled), it may be annoying he/she needs to manage multiple copies of<br>
account information. Is there any workaround for this?<br></blockquote><div><br></div><div>I think we can device a way to sync the encrypted file over the watchdog.</div><div>But this needs a more brainstorming. I will update on this after sorting out</div><div>the details and best possible way for that.</div><div><br></div><div>Thanks</div><div>Best Regards</div><div>Muhammad Usama</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5"><br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
<br>
&gt; Pasting below the conversations we had on this topic off the thread to keep<br>
&gt; everyone in the loop.<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Feb 1, 2018 at 10:54 AM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; &gt;&gt; In my understanding the proposed feature requires Pgpool-II to have<br>
&gt;&gt; &gt;&gt; clear text passwords. That is different from the current<br>
&gt;&gt; &gt;&gt; implementation of md5 auth in Pgpool-II, at least it&#39;s not terribly<br>
&gt;&gt; &gt;&gt; easy to reconstruct original passwords from the md5 hashed password.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt; Enabling the SCRAM and other authentication methods supported by<br>
&gt;&gt; PostgreSQL<br>
&gt;&gt; &gt; and not by Pgpool-II would be one of the advantages of implementing the<br>
&gt;&gt; &gt; local authentication system. Apart form that as Korry mentioned another<br>
&gt;&gt; big<br>
&gt;&gt; &gt; benefit of this will be to provide a guard against unauthorised access to<br>
&gt;&gt; &gt; PostgreSQL through Pgpool-II, that can happen because of the<br>
&gt;&gt; &gt; misconfigurations between pg_hba.conf and pool_hba.conf,  (Similar issue<br>
&gt;&gt; is<br>
&gt;&gt; &gt; reported in <a href="http://www.pgpool.net/mantisbt/view.php?id=374" rel="noreferrer" target="_blank">http://www.pgpool.net/<wbr>mantisbt/view.php?id=374</a> bug).<br>
&gt;&gt; &gt; So effectively it will not only provide the framework for supporting new<br>
&gt;&gt; &gt; authentication methods but will also enhance the overall security of the<br>
&gt;&gt; &gt; Pgpool-II.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; So I am not sure the proposed feature (clear text + SCRAM) offeres<br>
&gt;&gt; &gt;&gt; a sperior authentication than current md5 auth.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I totally agree that storing the clear text password in a text file is a<br>
&gt;&gt; &gt; bad idea and can cause a serious security hole. But there can be ways to<br>
&gt;&gt; &gt; work around this problem. One solution that comes to my mind is to use a<br>
&gt;&gt; &gt; passphrase encrypted file for storing the user/password informations and<br>
&gt;&gt; at<br>
&gt;&gt; &gt; the time of startup, Pgpool-II asks for the passphrase, and decrypt the<br>
&gt;&gt; &gt; file contents in the memory.<br>
&gt;&gt;<br>
&gt;&gt; Loading all users passwords into memory at once a little bit worries<br>
&gt;&gt; me. Isn&#39;t it better to load the passphrase into the memory at startup<br>
&gt;&gt; and decrypt each time frontend connects to Pgpool-II so that only one<br>
&gt;&gt; password used by current session is decrypted?<br>
&gt;&gt;<br>
&gt;<br>
&gt; Yes I think it&#39;s a good workable idea.<br>
&gt;<br>
&gt; Kind regards<br>
&gt; Muhammad Usama<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Similar concept is also used by pgbouncer in form of<br>
&gt;&gt; authentication-file<br>
&gt;&gt; &gt;&gt; &gt;&gt; which contains the user-password pairs and pgbouncer use it to<br>
&gt;&gt; &gt;&gt; authenticate<br>
&gt;&gt; &gt;&gt; &gt;&gt; the connections with PostgreSQL backend and also the clients<br>
&gt;&gt; connecting<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt; pgbouncer.<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="https://pgbouncer.github.io/config.html#authentication-file-format" rel="noreferrer" target="_blank">https://pgbouncer.github.io/<wbr>config.html#authentication-<wbr>file-format</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; It seems pgbouncer only uses the clear text format passwords to work<br>
&gt;&gt; &gt;&gt; with old PostgreSQL clear text password auth according to their doc<br>
&gt;&gt; &gt;&gt; above.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; &gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; This is not a feature we want, but maybe a feature that we need.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; It&#39;s so easy to get an authentication mechanism wrong, and wrong in<br>
&gt;&gt; such<br>
&gt;&gt; &gt;&gt; a<br>
&gt;&gt; &gt;&gt; &gt; way that the mechanism provides unintended access.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Would be acceptable to support only single sign-on mechanisms instead?<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;        -- Korry<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Thu, Jan 18, 2018 at 3:58 AM, Ahsan Hadi &lt;<br>
&gt;&gt; <a href="mailto:ahsan.hadi@enterprisedb.com">ahsan.hadi@enterprisedb.com</a><br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Hi Guys,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Can you share your feedback on the proposal below?<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; -- Ahsan<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; ---------- Forwarded message ----------<br>
&gt;&gt; &gt;&gt; &gt;&gt; From: Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Date: Thu, Jan 18, 2018 at 11:06 AM<br>
&gt;&gt; &gt;&gt; &gt;&gt; Subject: Proposal to add local authentication along with local<br>
&gt;&gt; &gt;&gt; &gt;&gt; user-database store in pgpool-II<br>
&gt;&gt; &gt;&gt; &gt;&gt; To: pgpool-hackers &lt;<a href="mailto:pgpool-hackers@pgpool.net">pgpool-hackers@pgpool.net</a>&gt;, Tatsuo Ishii &lt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt;, Ahsan Hadi &lt;<a href="mailto:ahsan.hadi@enterprisedb.com">ahsan.hadi@enterprisedb.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Hi,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Since PostgreSQL10 has recently added a support for SCRAM<br>
&gt;&gt; authentication<br>
&gt;&gt; &gt;&gt; &gt;&gt; with future plans including its extension of channel binding. And<br>
&gt;&gt; &gt;&gt; because<br>
&gt;&gt; &gt;&gt; &gt;&gt; of the nature of SCRAM and other more secure authentication methods<br>
&gt;&gt; like<br>
&gt;&gt; &gt;&gt; &gt;&gt; ssl-certificate-<wbr>authentication, Pgpool-II is not able to allow these<br>
&gt;&gt; &gt;&gt; &gt;&gt; auth-methods because of its current authentication system design.<br>
&gt;&gt; &gt;&gt; &gt;&gt; As almost all modern authentication methods are designed to guard<br>
&gt;&gt; &gt;&gt; against<br>
&gt;&gt; &gt;&gt; &gt;&gt; man-in-middle kind of attacks and middleware applications like<br>
&gt;&gt; Pgpool-II<br>
&gt;&gt; &gt;&gt; &gt;&gt; tries to exploit this very vulnerability to provide seamless<br>
&gt;&gt; &gt;&gt; authentication<br>
&gt;&gt; &gt;&gt; &gt;&gt; to users by forwarding the credentials provided by clients<br>
&gt;&gt; application<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt; the backend servers. But fortunately or unfortunately with the modern<br>
&gt;&gt; &gt;&gt; auth<br>
&gt;&gt; &gt;&gt; &gt;&gt; protocols it is becoming almost next to impossible and it is a need<br>
&gt;&gt; of<br>
&gt;&gt; &gt;&gt; time<br>
&gt;&gt; &gt;&gt; &gt;&gt; to rethink the authentication system of Pgpool-II.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; My proposal is to add a configurable feature in the Pgpool-II 3.8 to<br>
&gt;&gt; &gt;&gt; allow<br>
&gt;&gt; &gt;&gt; &gt;&gt; it to have its own user-password database which it can use to<br>
&gt;&gt; &gt;&gt; authenticate<br>
&gt;&gt; &gt;&gt; &gt;&gt; the clients connecting to Pgpool-II and also use the same to<br>
&gt;&gt; &gt;&gt; authenticate<br>
&gt;&gt; &gt;&gt; &gt;&gt; the user with PostgreSQL backend.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Similar concept is also used by pgbouncer in form of<br>
&gt;&gt; authentication-file<br>
&gt;&gt; &gt;&gt; &gt;&gt; which contains the user-password pairs and pgbouncer use it to<br>
&gt;&gt; &gt;&gt; authenticate<br>
&gt;&gt; &gt;&gt; &gt;&gt; the connections with PostgreSQL backend and also the clients<br>
&gt;&gt; connecting<br>
&gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt; pgbouncer.<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="https://pgbouncer.github.io/config.html#authentication-file-format" rel="noreferrer" target="_blank">https://pgbouncer.github.io/<wbr>config.html#authentication-<wbr>file-format</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Also Pgpool-II already uses the password file for md5 authentication<br>
&gt;&gt; so<br>
&gt;&gt; &gt;&gt; &gt;&gt; this enhancement would not be a radical change to the existing users.<br>
&gt;&gt; &gt;&gt; And<br>
&gt;&gt; &gt;&gt; &gt;&gt; we can also provide the utility application with Pgpool-II to<br>
&gt;&gt; generate<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; pgpool-auth file from pg_shadow table to make this configuration<br>
&gt;&gt; hassle<br>
&gt;&gt; &gt;&gt; &gt;&gt; free. ( similar to mkauth.py included with pgbouncer)<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I think adding this feature will allow us make Pgpool-II more usable<br>
&gt;&gt; and<br>
&gt;&gt; &gt;&gt; &gt;&gt; secure and with this we will be able to support SCRAM and SSL-AUTH<br>
&gt;&gt; &gt;&gt; &gt;&gt; authentication methods in Pgpool-II. And it will also solve the<br>
&gt;&gt; problems<br>
&gt;&gt; &gt;&gt; &gt;&gt; like the one reported in the <a href="http://www.pgpool.net/mantisbt" rel="noreferrer" target="_blank">http://www.pgpool.net/mantisbt</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; /view.php?id=374<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Finally this email just outlines the overview of the feature and<br>
&gt;&gt; once if<br>
&gt;&gt; &gt;&gt; &gt;&gt; we agree to go in the direction we can discuss it in more details<br>
&gt;&gt; like<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; file-format, user-password management for Pgpool-II and<br>
&gt;&gt; data-encryption<br>
&gt;&gt; &gt;&gt; on<br>
&gt;&gt; &gt;&gt; &gt;&gt; that file.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Thoughts and comments are most welcome<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Thanks<br>
</div></div>&gt;&gt; &gt;&gt; &gt;&gt; Best Regards<br>
&gt;&gt; &gt;&gt; &gt;&gt; Muhammad Usama<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt; Ahsan Hadi<br>
&gt;&gt; &gt;&gt; &gt;&gt; Snr Director Product Development<br>
&gt;&gt; &gt;&gt; &gt;&gt; EnterpriseDB Corporation<br>
&gt;&gt; &gt;&gt; &gt;&gt; The Enterprise Postgres Company<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Phone: <a href="tel:%2B92-51-8358874" value="+92518358874">+92-51-8358874</a> &lt;+92%2051%208358874&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Mobile: <a href="tel:%2B92-333-5162114" value="+923335162114">+92-333-5162114</a> &lt;+92%20333%205162114&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Website: <a href="http://www.enterprisedb.com" rel="noreferrer" target="_blank">www.enterprisedb.com</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; EnterpriseDB Blog: <a href="http://blogs.enterprisedb.com/" rel="noreferrer" target="_blank">http://blogs.enterprisedb.com/</a><br>
&gt;&gt; &gt;&gt; &gt;&gt; Follow us on Twitter: <a href="http://www.twitter.com/enterprisedb" rel="noreferrer" target="_blank">http://www.twitter.com/<wbr>enterprisedb</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; This e-mail message (and any attachment) is intended for the use of<br>
&gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; individual or entity to whom it is addressed. This message contains<br>
&gt;&gt; &gt;&gt; &gt;&gt; information from EnterpriseDB Corporation that may be privileged,<br>
&gt;&gt; &gt;&gt; &gt;&gt; confidential, or exempt from disclosure under applicable law. If you<br>
&gt;&gt; are<br>
&gt;&gt; &gt;&gt; &gt;&gt; not the intended recipient or authorized to receive this for the<br>
&gt;&gt; &gt;&gt; intended<br>
&gt;&gt; &gt;&gt; &gt;&gt; recipient, any use, dissemination, distribution, retention,<br>
&gt;&gt; archiving,<br>
&gt;&gt; &gt;&gt; or<br>
&gt;&gt; &gt;&gt; &gt;&gt; copying of this communication is strictly prohibited. If you have<br>
&gt;&gt; &gt;&gt; received<br>
&gt;&gt; &gt;&gt; &gt;&gt; this e-mail in error, please notify the sender immediately by reply<br>
&gt;&gt; &gt;&gt; e-mail<br>
&gt;&gt; &gt;&gt; &gt;&gt; and delete this message.<br>
<div><div class="h5">&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt; On Thu, Jan 18, 2018 at 11:06 AM, Muhammad Usama &lt;<a href="mailto:m.usama@gmail.com">m.usama@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; Since PostgreSQL10 has recently added a support for SCRAM authentication<br>
&gt;&gt; with future plans including its extension of channel binding. And because<br>
&gt;&gt; of the nature of SCRAM and other more secure authentication methods like<br>
&gt;&gt; ssl-certificate-<wbr>authentication, Pgpool-II is not able to allow these<br>
&gt;&gt; auth-methods because of its current authentication system design.<br>
&gt;&gt; As almost all modern authentication methods are designed to guard against<br>
&gt;&gt; man-in-middle kind of attacks and middleware applications like Pgpool-II<br>
&gt;&gt; tries to exploit this very vulnerability to provide seamless authentication<br>
&gt;&gt; to users by forwarding the credentials provided by clients application to<br>
&gt;&gt; the backend servers. But fortunately or unfortunately with the modern auth<br>
&gt;&gt; protocols it is becoming almost next to impossible and it is a need of time<br>
&gt;&gt; to rethink the authentication system of Pgpool-II.<br>
&gt;&gt;<br>
&gt;&gt; My proposal is to add a configurable feature in the Pgpool-II 3.8 to allow<br>
&gt;&gt; it to have its own user-password database which it can use to authenticate<br>
&gt;&gt; the clients connecting to Pgpool-II and also use the same to authenticate<br>
&gt;&gt; the user with PostgreSQL backend.<br>
&gt;&gt;<br>
&gt;&gt; Similar concept is also used by pgbouncer in form of authentication-file<br>
&gt;&gt; which contains the user-password pairs and pgbouncer use it to authenticate<br>
&gt;&gt; the connections with PostgreSQL backend and also the clients connecting to<br>
&gt;&gt; pgbouncer.<br>
&gt;&gt; <a href="https://pgbouncer.github.io/config.html#authentication-file-format" rel="noreferrer" target="_blank">https://pgbouncer.github.io/<wbr>config.html#authentication-<wbr>file-format</a><br>
&gt;&gt;<br>
&gt;&gt; Also Pgpool-II already uses the password file for md5 authentication so<br>
&gt;&gt; this enhancement would not be a radical change to the existing users. And<br>
&gt;&gt; we can also provide the utility application with Pgpool-II to generate the<br>
&gt;&gt; pgpool-auth file from pg_shadow table to make this configuration hassle<br>
&gt;&gt; free. ( similar to mkauth.py included with pgbouncer)<br>
&gt;&gt;<br>
&gt;&gt; I think adding this feature will allow us make Pgpool-II more usable and<br>
&gt;&gt; secure and with this we will be able to support SCRAM and SSL-AUTH<br>
&gt;&gt; authentication methods in Pgpool-II. And it will also solve the problems<br>
</div></div>&gt;&gt; like the one reported in the <a href="http://www.pgpool.net/" rel="noreferrer" target="_blank">http://www.pgpool.net/</a><br>
<span class="">&gt;&gt; mantisbt/view.php?id=374<br>
&gt;&gt;<br>
&gt;&gt; Finally this email just outlines the overview of the feature and once if<br>
&gt;&gt; we agree to go in the direction we can discuss it in more details like the<br>
&gt;&gt; file-format, user-password management for Pgpool-II and data-encryption on<br>
&gt;&gt; that file.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Thoughts and comments are most welcome<br>
&gt;&gt;<br>
&gt;&gt; Thanks<br>
</span>&gt;&gt; Best Regards<br>
&gt;&gt; Muhammad Usama<br>
&gt;&gt;<br>
&gt;&gt;<br>
</blockquote></div><br></div></div>