Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1awdsq-0005ia-Ga for pgsql-bugs@arkaria.postgresql.org; Sat, 30 Apr 2016 23:01:08 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1awdsq-0006Ba-3I for pgsql-bugs@arkaria.postgresql.org; Sat, 30 Apr 2016 23:01:08 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1awdsp-0006BT-LP for pgsql-bugs@postgresql.org; Sat, 30 Apr 2016 23:01:07 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1awdsl-0006M7-Vl for pgsql-bugs@postgresql.org; Sat, 30 Apr 2016 23:01:07 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1awdsi-0002i7-VP; Sat, 30 Apr 2016 19:01:00 -0400 Date: Sat, 30 Apr 2016 19:01:00 -0400 From: Bruce Momjian To: John R Pierce Cc: salianjag@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #14103: stored function encryption Message-ID: <20160430230100.GA8849@momjian.us> References: <20160420105947.22934.66599@wrigleys.postgresql.org> <57178A1D.8010309@hogranch.com> <20160430020130.GB28568@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160430020130.GB28568@momjian.us> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Fri, Apr 29, 2016 at 10:01:30PM -0400, Bruce Momjian wrote: > On Wed, Apr 20, 2016 at 06:54:37AM -0700, John R Pierce wrote: > > On 4/20/2016 3:59 AM, salianjag@gmail.com wrote: > > >how to encrypt functions in Postgresql so that we can hide all my business > > >logic ? > > > > write them in C or another compiled language, supply them as .SO (or .dll) > > files. > > FYI, you can often run 'strings' on the object file to see the SQL > queries. Seeing the SQL with 'strings' requires you have read access to the *.so library files. Also, this thread suggests that removing SELECT permission on pg_proc.prosrc allows you to prevent users from seeing the function, though it doesn't prevent a Postgres super-user from seeing it: http://www.postgresql.org/message-id/0100015338ce42f6-58727615-2385-4a80-9a73-c321c21c6928-000000@email.amazonses.com I am surprised you can still call the function if you do that. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs