Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YxsfF-0006nl-5a for pgsql-hackers@arkaria.postgresql.org; Thu, 28 May 2015 07:55:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YxsfE-0003y2-HP for pgsql-hackers@arkaria.postgresql.org; Thu, 28 May 2015 07:55:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YxsfC-0003xv-Q4 for pgsql-hackers@postgresql.org; Thu, 28 May 2015 07:55:38 +0000 Received: from mail-wi0-x229.google.com ([2a00:1450:400c:c05::229]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Yxsf8-0005C1-Bf for pgsql-hackers@postgresql.org; Thu, 28 May 2015 07:55:37 +0000 Received: by wifw1 with SMTP id w1so51146991wif.0 for ; Thu, 28 May 2015 00:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=kxsSUkSHvAcxbc0SmDgvdIyDcc/edIsKks7ysmZGnco=; b=w5cDXbkcDP0r97kOtYrwPg/erYA5C1GkZCKs2OOtdD5wSRaYWUL1sNwbur9sCqmkKf v5QoM+T4kw9Bw+UQ+VgejWV34MalI9jhyTnQ5ypM8EksiKvPKEjnMM+vOL5xgUBTlC1e Eb+7XCEyxYt6rxmo2L2Yl00twoBE3jHDWnsEyYjpMHcuIzx218li0kerpgtzdFGyN1+S kyA6U5ZlPefY18KXCOT5GbYw4TpWUhMy2CPcmcepAywJruTt+2e8kikYbqQ2ZNwCs7sm drsIeghFi58JxYjco41/rsFaPN8gp3yoduQIC6sBbabymVNQ++ANIWlfARAB3VL8ke2Y zWoQ== X-Received: by 10.180.99.69 with SMTP id eo5mr1889483wib.92.1432799732776; Thu, 28 May 2015 00:55:32 -0700 (PDT) Received: from [192.168.1.99] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by mx.google.com with ESMTPSA id hu1sm2692151wib.6.2015.05.28.00.55.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 May 2015 00:55:31 -0700 (PDT) Message-ID: <5566C9F1.6020103@iki.fi> Date: Thu, 28 May 2015 10:55:29 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: "Joshua D. Drake" , Stephen Frost CC: Noah Misch , Robert Haas , Tom Lane , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add pg_audit, an auditing extension References: <20150527001004.GD26667@tamriel.snowman.net> <20150527132429.GH26667@tamriel.snowman.net> <20150527203653.GN26667@tamriel.snowman.net> <20150528010042.GB4097628@tornado.leadboat.com> <20150528011125.GO26667@tamriel.snowman.net> <55666FB5.8090209@commandprompt.com> <20150528013840.GP26667@tamriel.snowman.net> <556673E1.8090109@commandprompt.com> <20150528020201.GQ26667@tamriel.snowman.net> <556685BF.2010604@commandprompt.com> In-Reply-To: <556685BF.2010604@commandprompt.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) 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 On 05/28/2015 06:04 AM, Joshua D. Drake wrote: > On 05/27/2015 07:02 PM, Stephen Frost wrote: >> regardless of if they are included in the main git repo >> or not. Being in the repo represents the support of the overall >> community and PGDG, which is, understandably in my view, highly valuable >> to the organizations which look to PostgreSQL as an open source >> solution for their needs. > > I can't get behind this. Yes, there is a mysticism about the "core" > support of modules but it is just that "mysticism". People are going to > run what the experts tell them to run. If pg_audit is that good the > experts will tell people to use it... Yeah, there are many popular tools and extensions that people use together with PostgreSQL. PostGIS, pgbouncer, slony, pgbarman etc. The criteria for what should be in contrib, in core, or a 3rd party extension is a contentious topic. The argument here is basically that if something is in core, it's officially supported and endorsed by the PGDG. If that's the argument for putting this in contrib, then you have to ask yourself if the PGDG community is really willing to endorse this. I'm hearing a lot of pushback from other committers, which points to "no", even if all their technical arguments and worries turn out to be wrong. I wrote the above without looking at the code or the documentation. I haven't followed the discussion at all. I'm now looking at the documentation, and have some comments based on just that: * I think it's a bad idea for the audit records to go to the same log as other messages. Maybe that's useful as an option, but in general there is no reason to believe that the log format used for general logging is also a good format for audit logging. You probably wouldn't care about process ID for audit logging, for example. Also, how do you prevent spoofing audit records with something like "SELECT \nAUDIT: SESSION, 2, ...". Maybe the log formatting options can be used to prevent that, but just by looking at the examples in the manual, I don't see how to do it. * I don't understand how the pg_audit.role setting and the audit role system works. * Using GUCs for configuring it seems like a bad idea, because: 1. it's not flexible enough. How do you specify that all READs on super_secret table must be logged, but on less_secret table, it's enough to log only WRITEs? 2. GUCs can be changed easily on-the-fly, and configured flexibly. But that's not really what you want for auditing. You want to have a clear specification in one place. You'd want it to be more like pg_hba.conf than postgresql.conf. Or more like Mandatory Access Control, rather than Discretionary Access Control. A separate config file in $PGDATA would be a better way to configure this. You would then have all the configuration in one place, and that file could have a more flexible format, with per-schema rules etc. (Wouldn't have to implement all that in the first version, but that's the direction this should go to) I recommend making pg_audit an external extension, not a contrib module. As an extension, it can have its own life-cycle and not be tied to PostgreSQL releases. That would be a huge benefit for pg_audit. There is a lot of potential for new features to be added: more flexible configuration, more details to be logged, more ways to log, email alerts, etc. As an extension, all of those things could be developed independent of the PostgreSQL life-cycle. If there is need to fix vulnerabilities or other bugs, those can also be fixed independently of PostgreSQL minor releases. - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers