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 1jnV3M-0001XU-4h for pgsql-admin@arkaria.postgresql.org; Mon, 22 Jun 2020 22:36:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jnV3L-0008Ly-15 for pgsql-admin@arkaria.postgresql.org; Mon, 22 Jun 2020 22:36:35 +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 1jnV3K-0008Kn-Pb; Mon, 22 Jun 2020 22:36:34 +0000 Received: from [64.147.123.19] (helo=wout3-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnV3I-0004Eq-21; Mon, 22 Jun 2020 22:36:33 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3D52C1290; Mon, 22 Jun 2020 18:36:20 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 22 Jun 2020 18:36:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=b 7/Pq39wXGILqIDpqv5nxWKBxuAd7iagrj7F3jMSuAg=; b=k0arUe4lIRF7cmWy8 WiVH/La+WDt75O2TP9uKgjl7o+e3x1g3KFIJ2W07O5KZ1otKbUFgm7cOaRD+q61S VFZMaeKwFlXkBpkwgn1tW7Z+G3QEAm8zdDi73LZ5HGwFRHrKR9rzIDhaxMX91obf 9sdjRwIFE8Ons1Wu1CSuIuRVDHoDIi8zycMIGtg36EIB3INNdclF6kRhCRAQadFC xXf05JHnuNwV7+bsunbVOtssRTw+wlqk0r9wFV3N623iMcHJvBbb8yULQQS0QUx8 yircVzsUCqvQ1F6FumHgCrjDwA1jUZ3wSk4jOIF1vslx/yfTrisAG7bdyZ1szBAE 5K3fQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=b7/Pq39wXGILqIDpqv5nxWKBxuAd7iagrj7F3jMSu Ag=; b=puAFU67KhyB68PuJQMoxd7S0qjETEBjx5iOOfX78N2wwQOCtLE/4WsCAw /sxGoCVL9STtpLYCoH8/p88urkhISF7wA5/ATi3lSaf9Bs1B/Nfw3HePq76Ck1q6 PcR9Wx/XFNP/McHh8uy9CLM0UTycYxHSLsWVQYdGpMyFRrGMBo9ol3XB0CzMpM9i hqyIeHirjtG4c4BjSPivIyssyXvIfYNjgBbHZgqQfJ0Z50TF3kEmY6fapJ/JKUrq zfFQhijKeNTjkYg9KFEb9M1GHKZn/N/i0L0LEJd06pJsPoL6Q4HIYIMqBOTROYox sB5jy/UwQUG5WupgUdfoQXmnlWYvw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekfedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeevveefveefueegffekkefhgeeiueffgfetueejvdfg hfeujeejhfekjeelgedtgeenucfkphephedtrdduleejrdektddrvdenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghv vghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: from ranger.suse (50-197-80-2-static.hfc.comcastbusiness.net [50.197.80.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 0D40E3067415; Mon, 22 Jun 2020 18:36:18 -0400 (EDT) Subject: Re: scram-sha-256 encrypted password in pgpass To: Pavan Kumar , "David G. Johnston" Cc: Pgsql-admin , "pgsql-generallists.postgresql.org" References: From: Adrian Klaver Message-ID: <582060cb-79b9-1091-e464-dd8ee45c8624@aklaver.com> Date: Mon, 22 Jun 2020 15:36:18 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.19 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/22/20 3:32 PM, Pavan Kumar wrote: > Adrian, David, > > Thank you so much for the quick response. > > 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. But if you want to log in with encrypted password and someone can grab it from the file not sure what the difference is from grabbing the plain text one if they both end up logging the user in? > 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. > > > > > On Mon, Jun 22, 2020 at 5:04 PM David G. Johnston > > wrote: > > Please don't cross-post. > > On Mon, Jun 22, 2020 at 1:35 PM Pavan Kumar > wrote: > > scram-sha-256 encrypted passwords are supported in .pgpass file > ? If yes kindly provide us an example. > > I am using below format and it is not working for me > > /|pglnx1|/:/|5432|/:pgbouncer:/|pgadmin|/:"SCRAM-SHA-256$4096:6IDsjfedwsdpymp0Za7jaMew==$rzSoYL4ZYsW1WJAj7Lt3JtNLNR73AVY7sfsauikweblk][=:Hxx/juPXJZHy5djPctI=*/"/* > > The documentation doesn't say so one way or the other so I would go > with no.  The password in the pgpass file has to be the plaintext > password.  The client, upon speaking with the server, will decide > whether to send the plaintext password to the server or encrypt it > prior to transmission. > > What would be the point of storing the encrypted password instead of > the plaintext one? > > David J. > > > > -- > *Regards, > > #!  Pavan Kumar > ----------------------------------------------*- > *Sr. Database Administrator..!* > *NEXT GENERATION PROFESSIONALS, LLC* > *Cell    #  267-799-3182 #  pavan.dba27 (Gtalk) * > *India   # 9000459083* > > *Take Risks; if you win, you will be very happy. If you lose you > will be Wise * > -- Adrian Klaver adrian.klaver@aklaver.com