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 1p0pFm-0001yU-6C for pgsql-general@arkaria.postgresql.org; Thu, 01 Dec 2022 19:29:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p0pFk-00066S-LP for pgsql-general@arkaria.postgresql.org; Thu, 01 Dec 2022 19:29:48 +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 1p0pFk-00066J-AT for pgsql-general@lists.postgresql.org; Thu, 01 Dec 2022 19:29:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p0pFe-0006la-F3 for pgsql-general@lists.postgresql.org; Thu, 01 Dec 2022 19:29:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 2B1JTZFm1693765; Thu, 1 Dec 2022 14:29:35 -0500 From: Tom Lane To: "David G. Johnston" cc: Rizwan Shaukat , "pgsql-general@lists.postgresql.org" Subject: Re: how to secure pg_hba.conf In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Thu, 01 Dec 2022 12:06:19 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1693763.1669922975.1@sss.pgh.pa.us> Date: Thu, 01 Dec 2022 14:29:35 -0500 Message-ID: <1693764.1669922975@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Thu, Dec 1, 2022 at 11:36 AM Rizwan Shaukat > wrote: >> we hv requiremnt from security to secure pg_hba.conf file was encryption >> or password protected on server to protect ip visibilty because these >> server access by application n thy can amend as well. how we can achive it >> pls > You cannot with the present implementation of the system - pg_hba.conf is > read by the PostgreSQL process as a file. I do not think the server is > prepared for that file to be some kind of program whose stdout is the > contents and you could arrange for that program to do whatever it is you'd > like. Even more to the point: if you are afraid of hostile actors being able to access files inside your data directory, it seems to me that pg_hba.conf is very far down the list of things to worry about. What's to stop the same actors from examining/modifying other configuration files, or even the actual database contents? If you don't think your data directory is secure, you have problems that Postgres can't fix. regards, tom lane