Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ysx5z-0000Ro-TA for pgsql-hackers@arkaria.postgresql.org; Thu, 14 May 2015 17:38:56 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ysx5z-0008In-9h for pgsql-hackers@arkaria.postgresql.org; Thu, 14 May 2015 17:38:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ysx5y-0008Ih-CU for pgsql-hackers@postgreSQL.org; Thu, 14 May 2015 17:38:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Ysx5v-0003ax-Eo for pgsql-hackers@postgreSQL.org; Thu, 14 May 2015 17:38:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t4EHcn6H006455; Thu, 14 May 2015 13:38:49 -0400 From: Tom Lane To: Stephen Frost cc: pgsql-hackers@postgreSQL.org Subject: Re: [COMMITTERS] pgsql: Add pg_audit, an auditing extension In-reply-to: <20150514171101.GG30322@tamriel.snowman.net> References: <20150514150047.GX30322@tamriel.snowman.net> <20458.1431615970@sss.pgh.pa.us> <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> Comments: In-reply-to Stephen Frost message dated "Thu, 14 May 2015 13:11:02 -0400" Date: Thu, 14 May 2015 13:38:49 -0400 Message-ID: <6454.1431625129@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> At least on dromedary, this seems to be the problem: >> >> pg_audit.c: In function 'stack_pop': >> pg_audit.c:387: warning: format '%ld' expects type 'long int', but argument 3 has type 'int64' >> pg_audit.c: In function 'stack_valid': >> pg_audit.c:406: warning: format '%ld' expects type 'long int', but argument 3 has type 'int64' >> pg_audit.c:406: warning: format '%ld' expects type 'long int', but argument 4 has type 'int64' >> pg_audit.c: In function 'log_audit_event': >> pg_audit.c:676: warning: format '%ld' expects type 'long int', but argument 4 has type 'int64' >> pg_audit.c:676: warning: format '%ld' expects type 'long int', but argument 5 has type 'int64' >> >> Will push a fix shortly and we'll see what happens. > Ah, ok. Pushed that, but some further notes: * 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. * 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. 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. (I assume BTW that we're not considering it a security problem that superusers can trivially escape auditing.) regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers