Re: pgaudit - an auditing extension for PostgreSQL

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, MauMau <maumau307(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Ian Barwick <ian(at)2ndquadrant(dot)com>
Subject: Re: pgaudit - an auditing extension for PostgreSQL
Date: 2015-01-20 22:03:10
Message-ID: 54BED09E.3050304@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/20/15 2:20 PM, Robert Haas wrote:
> On Tue, Jan 20, 2015 at 1:05 AM, Abhijit Menon-Sen<ams(at)2ndquadrant(dot)com> wrote:
>> >So when I'm trying to decide what to audit, I have to:
>> >
>> > (a) check if the current user is mentioned in .roles; if so, audit.
>> >
>> > (b) check if the current user is a descendant of one of the roles
>> > mentioned in .roles; if not, no audit.
>> >
>> > (c) check for permissions granted to the "root" role and see if that
>> > tells us to audit.
>> >
>> >Is that right? If so, it would work fine. I don't look forward to trying
>> >to explain it to people, but yes, it would work (for anything you could
>> >grant permissions for).
> I think this points to fundamental weakness in the idea of doing this
> through the GRANT system. Some people are going want to audit
> everything a particular user does, some people are going to want to
> audit all access to particular objects, and some people will have more
> complicated requirements. Some people will want to audit even
> super-users, others especially super-users, others only non
> super-users. None of this necessarily matches up to the usual
> permissions framework.

+1. In particular I'm very concerned with the idea of doing this via roles, because that would make it trivial for any superuser to disable auditing. The only good option I could see to provide this kind of flexibility would be allowing the user to provide a function that accepts role, object, etc and make return a boolean. The performance of that would presumably suck with anything but a C function, but we could provide some C functions to handle simple cases.

That said, I think the best idea at this stage is either log everything or nothing. We can always expand upon that later.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-01-20 22:04:58 Re: B-Tree support function number 3 (strxfrm() optimization)
Previous Message Peter Geoghegan 2015-01-20 22:00:16 Re: B-Tree support function number 3 (strxfrm() optimization)