Re: pgsql: Add pg_audit, an auditing extension

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add pg_audit, an auditing extension
Date: 2015-05-15 16:15:07
Message-ID: CAHGQGwE0XfGJPL6NUjaPcO6sZyiXEE4eCBR96XYkzL-N0mD8uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, May 14, 2015 at 11:36 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> Add pg_audit, an auditing extension
>
> This extension provides detailed logging classes, ability to control
> logging at a per-object level, and includes fully-qualified object
> names for logged statements (DML and DDL) in independent fields of the
> log output.
>
> Authors: Ian Barwick, Abhijit Menon-Sen, David Steele
> Reviews by: Robert Haas, Tatsuo Ishii, Sawada Masahiko, Fujii Masao,
> Simon Riggs
>
> Discussion with: Josh Berkus, Jaime Casanova, Peter Eisentraut,
> David Fetter, Yeb Havinga, Alvaro Herrera, Petr Jelinek, Tom Lane,
> MauMau, Bruce Momjian, Jim Nasby, Michael Paquier,
> Fabrízio de Royes Mello, Neil Tiffin
>
> Branch
> ------
> master
>
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/ac52bb0442f79076b14acd8ad5b696946c1053b8
>
> Modified Files
> --------------
> contrib/Makefile | 1 +
> contrib/pg_audit/.gitignore | 5 +
> contrib/pg_audit/Makefile | 21 +
> contrib/pg_audit/expected/pg_audit.out | 964 ++++++++++++++++
> contrib/pg_audit/pg_audit--1.0.0.sql | 22 +
> contrib/pg_audit/pg_audit.c | 1870 ++++++++++++++++++++++++++++++++
> contrib/pg_audit/pg_audit.conf | 1 +
> contrib/pg_audit/pg_audit.control | 5 +
> contrib/pg_audit/sql/pg_audit.sql | 617 +++++++++++
> doc/src/sgml/contrib.sgml | 1 +
> doc/src/sgml/filelist.sgml | 1 +
> doc/src/sgml/pgaudit.sgml | 678 ++++++++++++
> 12 files changed, 4186 insertions(+)

pg_audit uses 1.0.0 as its version number. But, is the third digit really
required? Why? We usually uses the version number with two digits in
contrib modules.

CREATE EXTENSION pg_audit failed with the following error message
when shared_preload_libraries and pg_audit.log are set to pg_audit and
ddl, respectively.

=# create extension pg_audit ;
ERROR: pg_event_trigger_ddl_commands() can only be called in an event
trigger function
CONTEXT: SQL statement "SELECT UPPER(object_type), object_identity
FROM pg_event_trigger_ddl_commands()"

In Makefile, PGFILEDESC should be added.

+# pg_audit/Makefile

should be "# contrib/pg_audit/Makefile" for the consistency.

The categories of some SQL commands are different between log_statement and
pg_audit. For example, REINDEX is treated as DDL in pg_audit, but not in
log_statement. That's confusing. We should use the same "category-mapping"
rule as much as possible.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2015-05-15 16:39:48 Re: pgsql: Add archive_mode='always' option.
Previous Message Heikki Linnakangas 2015-05-15 15:55:35 pgsql: Add archive_mode='always' option.

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2015-05-15 16:53:28 Re: WALWriteLock contention
Previous Message Robert Haas 2015-05-15 16:06:43 WALWriteLock contention