Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fq3Xi-0007gy-Hk for pgsql-admin@arkaria.postgresql.org; Wed, 15 Aug 2018 21:41:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fq3Xf-0005HP-Py for pgsql-admin@arkaria.postgresql.org; Wed, 15 Aug 2018 21:41:23 +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.89) (envelope-from ) id 1fq3Xf-0005HI-IZ for pgsql-admin@lists.postgresql.org; Wed, 15 Aug 2018 21:41:23 +0000 Received: from ook.raf.org ([139.99.156.21]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fq3Xb-0004dY-Sh for pgsql-admin@lists.postgresql.org; Wed, 15 Aug 2018 21:41:23 +0000 Received: from localhost (localhost [127.0.0.1]) by ook.raf.org (Postfix) with ESMTP id A5B775E614 for ; Thu, 16 Aug 2018 07:41:14 +1000 (AEST) X-Virus-Scanned: Debian amavisd-new at ook.raf.org Received: from ook.raf.org ([127.0.0.1]) by localhost (ook.raf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VyfZVl3glcm9 for ; Thu, 16 Aug 2018 07:41:11 +1000 (AEST) Received: by ook.raf.org (Postfix, from userid 1001) id B77155E615; Thu, 16 Aug 2018 07:41:11 +1000 (AEST) Date: Thu, 16 Aug 2018 07:41:11 +1000 From: raf To: pgsql-admin@lists.postgresql.org Subject: Re: How to revoke privileged from PostgreSQL's superuser Message-ID: <20180815214111.xy4y7j5hg5jl7pgo@raf.org> References: <913907.28546.qm@web103014.mail.kks.yahoo.co.jp> <20180810194105.GD7840@momjian.us> <20180814195919.GA29140@momjian.us> <20180815145912.GA11573@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180815145912.GA11573@momjian.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Bruce Momjian wrote: > On Tue, Aug 14, 2018 at 03:59:19PM -0400, Bruce Momjian wrote: > > On Fri, Aug 10, 2018 at 04:06:40PM -0400, Benedict Holland wrote: > > > I also would take Bruce's comment with a massive grain of salt. Everything that > > > everyone does on a database is logged somewhere assuming proper logging. Now do > > > you have the person-power to go through gigs of plain text logs to find out if > > > someone is doing something shady... that is a question for your management > > > team. Also, if you suspect someone of doing something shady, you should > > > probably revoke their admin rights.  > > > > Agreed, the best way to limit the risk of undetected DBA removal of data > > is secure auditing --- I should have mentioned that. > > So, how do you securely audit? You ship the logs to a server that isn't > controlled by the DBA, via syslog? How do you prevent the DBA from > turning off logging when the want to so something undetected? Do you > log the turning off of logging? > > -- > Bruce Momjian http://momjian.us Yes. You can set up terminal session logging with redhat's tlog (https://github.com/Scribery/tlog) which can record all terminal activity done via ssh, ship it offsite and replay it for auditing purposes. So if an administrator does turn off any logging (presumably including tlog itself), you'll at least be able to see them turning it off. cheers, raf