Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAxHb-0007qi-QA for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 14:19:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iAxHa-0003YO-NN for pgsql-general@arkaria.postgresql.org; Thu, 19 Sep 2019 14:19:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAxHY-0003Xw-7U for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 14:19:42 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iAxHT-0001Tu-Ql for pgsql-general@lists.postgresql.org; Thu, 19 Sep 2019 14:19:39 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id B0F2E6AB; Thu, 19 Sep 2019 10:19:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 19 Sep 2019 10:19:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=X 42XXazO3MZGEcB3CKiz8tv+ZAfDsYAun5Bn0Dy0YU4=; b=6P9LNMeMzG+iw67Ph VDxlCbulygCAVeMFcyFrzfeO9OvMUm63DtKD/e6lW9AQDqqmQhXgX/7vC+mi3t0d fJT0LKhxkz0yHQYcaLUe9qlJtc0DSjLWKn0E4rBje5PNfjFtzlZOsojRvcip0uUh /snTxf+KCdm2B+H4FROYrVu+6ppGl3XotwoIILsSqvzgUHtoXoaijmQaIMWTqbtk mmATFsCvu2tNcsC6uNilDXlE4QmyOoe8VewQ765FUSZ4nJVeKKsvB4XxHAmpy6Hl cXIpVG+cJ2H1c8qz1qTFIt09Vkzp6KiGLoLAFmsx9H6pHPMhBXBS4zMox3//HncC Mwfyg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=X42XXazO3MZGEcB3CKiz8tv+ZAfDsYAun5Bn0Dy0Y U4=; b=c4BKAlWSswMne3jFBHdVJuFb07LQzN9SKGpPBpPM1mxXuIR6NUhlorCso oMVCkXrJkTDc6JUzpZ47+cI1pKm/1v36/utzgNR35po2rpGPuPv9hkF2wZW41ndX kisiwIq4r5KpCGhDO+2xoohaZW+du+vlyN6ADUQPPdjrDWaeWfXhBKCQnTZrARNa 2GkZdVSYi9ECccIn2aOP/qTwFkNJlBGUtddk22EdCcoYGfyY11VUrYWY/7BeHzdX e7MH3lmB7b8YOnApDTrJG6z3r3Pw6HJLUaDfXDaIzIUKhSxbYFkVi+U8ypurbsBL p70kgvSP0IuWx27fnYttzosGw3zhQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvddtgdejiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucfkphepudejgedrvddurdeihedrieefne curfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghv vghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.3] (174-21-65-63.tukw.qwest.net [174.21.65.63]) by mail.messagingengine.com (Postfix) with ESMTPA id 75858D60062; Thu, 19 Sep 2019 10:19:31 -0400 (EDT) Subject: Re: PGPASSWORD in crypted form, for example BlowFish or SHA-256 To: Matthias Apitz , pgsql-general@lists.postgresql.org References: <20190919103039.GA2501@c720-r342378> From: Adrian Klaver Message-ID: <39445fcd-dcd8-b971-8f59-38131e503dbd@aklaver.com> Date: Thu, 19 Sep 2019 07:19:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190919103039.GA2501@c720-r342378> Content-Type: text/plain; charset=utf-8; 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 9/19/19 3:30 AM, Matthias Apitz wrote: > > Hello, > > Our software, a huge ILS, is running on Linux with DBS Sybase. To > connect to the Sybase server (over the network, even on localhost), > credentials must be known: a user (say 'sisis') and its password. > > For Sybase we have them stored on the disk of the system in a file > syb.npw as: > > $ cat /opt/lib/sisis/etc/syb/syb.npw > sisis:e53902b9923ab2fb > sa:64406def48efca8c > > for the user 'sisis' and the administrator 'sa'. Our software has as > shared library a blob which knows how to decrypt the password hash above > shown as 'e53902b9923ab2fb' into clear text which is then used in the > ESQL/C or Java layer to connect to the Sybase server. > > For PostgreSQL the password must be typed in (for pgsql) or can be > provided in an environment variable PGPASSWORD=blabla > > Is there somehow an API in PG to use ciphered passwords and provide as a > shared library the blob to decrypt it? If not, we will use the mechanism same as There is not and I am not sure that would be much use even if it did exist. You would be right back at someone being able to grab the credentials from a file and feeding them to the database for access. The system you currently have at least seems to limit access to a specific program external to Postgres. > we use for Sybase. Or any other idea to not make detectable the > credentials? This was a request of our customers some years ago. > > matthias > > -- Adrian Klaver adrian.klaver@aklaver.com