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 1jnWey-0005Qx-2c for pgsql-admin@arkaria.postgresql.org; Tue, 23 Jun 2020 00:19:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jnWex-0007lV-1P for pgsql-admin@arkaria.postgresql.org; Tue, 23 Jun 2020 00:19:31 +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 1jnWev-0007lK-Ar; Tue, 23 Jun 2020 00:19:30 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jnWes-0005Dk-5i; Tue, 23 Jun 2020 00:19:28 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1DEB75C0B81; Mon, 22 Jun 2020 20:19:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 22 Jun 2020 20:19:24 -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=J qpyXBzCHztU07QySe61hzpkshhdDqFH9jZFGQ55Upc=; b=TsYC1Worr2jOouh3Q ap9oGKuVSjTbVXYpq0XwVMiON8ClYhIRyUHGMluEr2v7vIDZv5567I5f2lxeZeDP XjsQxjgm3no1JYNTVfHp8kc1N01TI9vYclQeziaECWRJRL6fA61i7aLHRLgziPwz LCsmrwg943cgYXBsNeUklm8UDKIk3NxZ1hgfivi0z2ecntUPa0l3IDkJ66S28qiC sj+OXceuVCxTGZ0GZsS46pR6YD5XGqLEU4gEbS8xd1wKhzGtevw7N0keIgNkjGJI EOJS478A+ZUjh4x9/wl7+jwg9K8ak2qVBYYEvqMYt1PQslq9+zGx0sJ2bnmxitLS Q2J5Q== 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=JqpyXBzCHztU07QySe61hzpkshhdDqFH9jZFGQ55U pc=; b=eRW9evd7kKctqtoKgh337X51aBcYD0F8BxcwI/+uonmfGWfRFXAIxmVqY QQcGiOEz8X1jq3IDRsONuL32hCawK9TD3dTVFrYNHT4NAOxRKwLBmBmux+IHNaBf iHYOVAj0Afx+RSX4tpzcKD2sSH/+g85JU1efqvrPhZcuFhJxq6zzAdNzLi/7dvBs KlIgmbLuhx5tvBp2jXTqZNcLhd9Wrewn84BTQAguBf35NBjfORT/F1Nc2G1b3DMC mN3EMHpHakY9D/quS05QB0qTa7znBZ8iFNCy2j8e7D4WvvD63PCSsrqEF2ESPjqD fH1+eWJhxUtEBcqFhtBtTGIzzG5rA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudekfedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeettdekfefhgfdttdduuedtudeviedufeevteeffeek tddtveeigfeigffhtddvveenucffohhmrghinhepphhgsghouhhntggvrhdrohhrghenuc fkphepjeehrddujedvrdehrddvfedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homh X-ME-Proxy: Received: from [192.168.1.3] (75-172-5-231.tukw.qwest.net [75.172.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id 0B5B430673EE; Mon, 22 Jun 2020 20:19:22 -0400 (EDT) Subject: Re: scram-sha-256 encrypted password in pgpass To: Stephen Frost , Pavan Kumar Cc: "David G. Johnston" , Pgsql-admin , "pgsql-generallists.postgresql.org" References: <20200622225437.GK3125@tamriel.snowman.net> From: Adrian Klaver Message-ID: Date: Mon, 22 Jun 2020 17:19:22 -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: <20200622225437.GK3125@tamriel.snowman.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/22/20 3:54 PM, Stephen Frost wrote: > 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. The relevant section is: http://www.pgbouncer.org/config.html#authentication-file-format and it has quite a few caveats wrt SCRAM. > > Thanks, > > Stephen > -- Adrian Klaver adrian.klaver@aklaver.com