From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Add pg_audit, an auditing extension
Date: Thu, 14 May 2015 14:22:17 -0400
Message-ID: <20150514182217.GH30322@tamriel.snowman.net> (raw)
In-Reply-To: <6454.1431625129@sss.pgh.pa.us>
References: <20150514154619.GY30322@tamriel.snowman.net>
<21368.1431618712@sss.pgh.pa.us>
<20150514161032.GA30322@tamriel.snowman.net>
<4844.1431621244@sss.pgh.pa.us>
<20150514163551.GB30322@tamriel.snowman.net>
<5043.1431621669@sss.pgh.pa.us>
<20150514164330.GD30322@tamriel.snowman.net>
<5654.1431623278@sss.pgh.pa.us>
<20150514171101.GG30322@tamriel.snowman.net>
<6454.1431625129@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Stephen Frost <sfrost@snowman.net> writes:
> > Ah, ok.
>
> Pushed that, but some further notes:
Thanks! Looking much better.
> * The actual audit reports ought to be ereport() not elog(). I made them
> so but did not insert an errcode(). ISTM that it would likely be a good
> thing to assign a not-used-for-any-other-purpose errcode for this, but I'm
> not terribly sure what category to put it in.
Right, I had seen that too and had intended to change it, but somehow
missed it in the other changes I was doing. I'll take a look at the
categories and try to figure out what makes sense.
> * The comments in the code betray utter ignorance of how logging actually
> works, in particular this:
>
> * Administrators can choose which log level the audit log is to be logged
> * at. The default level is LOG, which goes into the server log but does
> * not go to the client. Set to NOTICE in the regression tests.
I had rewored that last night and will reword it again to be more clear.
> All the user has to do is change client_min_messages and he'll see all the
> reports, which means if you think that letting the user see the audit
> reports is a security problem then you have a hole a mile wide.
There are certainly use-cases for this where that's not an issue and
also ones where the user wouldn't be able to use pg_audit due to this.
I'll update the docs to make the risk of this clear. At least for the
use-cases we've been involved in, they've not been concerned about this.
Still, any thoughts you have on this would certainly be welcome. I've
been thinking about how we might re-route and tag messages in the
backend for a number of years and I feel like this summer I'll have
resources and time to spend working towards it. Providing a way to
decide if a message should be sent only to the server log, or only to
the client, or to an external system (syslog, pgQ, rabbitMQ, etc), or to
some combination of those, is definitely one of the items on that list.
> (I assume BTW that we're not considering it a security problem that
> superusers can trivially escape auditing.)
No, that's entirely understood and expected, which is one of the reasons
it'd be good to reduce the number of superusers running around.
Thanks!
Stephen
Attachments:
signature.asc (application/pgp-signature, 818B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, pgsql-hackers@postgreSQL.org
Subject: Re: [COMMITTERS] pgsql: Add pg_audit, an auditing extension
In-Reply-To: <20150514182217.GH30322@tamriel.snowman.net>
References: <20150514154619.GY30322@tamriel.snowman.net> <21368.1431618712@sss.pgh.pa.us> <20150514161032.GA30322@tamriel.snowman.net> <4844.1431621244@sss.pgh.pa.us> <20150514163551.GB30322@tamriel.snowman.net> <5043.1431621669@sss.pgh.pa.us> <20150514164330.GD30322@tamriel.snowman.net> <5654.1431623278@sss.pgh.pa.us> <20150514171101.GG30322@tamriel.snowman.net> <6454.1431625129@sss.pgh.pa.us> <20150514182217.GH30322@tamriel.snowman.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox