Обсуждение: [MASSMAIL]Auditing in Postgres

Поиск
Список
Период
Сортировка

[MASSMAIL]Auditing in Postgres

От
Tejaswi K T
Дата:
Hi Team,
I am from an oracle background and new to postgres.

We recently provisioned postgres database for our application, and have a requirement.

Our banking organisation, we have enabled auditing to capture all failed DML , in oracle we do with commands like 
AUDIT INSERT ANY TABLE WHENEVER NOT SUCCESSFUL; 

Do we have similar commands in pgaudit , which captures only failed DML and not the successful ones. 

In OLTP, we have millions of data inserts and we are not interested in capturing all successful inserts. 

thanks in advance
Tejas

Re: Auditing in Postgres

От
Anjul Sahu
Дата:
Hi Tejaswi

You can check in Pgaudit docs.

pgaudit.log

Specifies which classes of statements will be logged by session audit logging. Possible values are:

  • READSELECT and COPY when the source is a relation or a query.

  • WRITEINSERTUPDATEDELETETRUNCATE, and COPY when the destination is a relation.

  • FUNCTION: Function calls and DO blocks.

  • ROLE: Statements related to roles and privileges: GRANTREVOKECREATE/ALTER/DROP ROLE.

  • DDL: All DDL that is not included in the ROLEclass.

  • MISC: Miscellaneous commands, e.g. DISCARDFETCHCHECKPOINTVACUUMSET.

  • MISC_SET: Miscellaneous SET commands, e.g. SET ROLE.

  • ALL: Include all of the above.



Thanks,

Anjul Sahu
Founder and CEO
Phone: +916268918953


On Tue, 9 Apr 2024 at 5:30 PM, Tejaswi K T <tejaswi.kt@gmail.com> wrote:
Hi Team,
I am from an oracle background and new to postgres.

We recently provisioned postgres database for our application, and have a requirement.

Our banking organisation, we have enabled auditing to capture all failed DML , in oracle we do with commands like 
AUDIT INSERT ANY TABLE WHENEVER NOT SUCCESSFUL; 

Do we have similar commands in pgaudit , which captures only failed DML and not the successful ones. 

In OLTP, we have millions of data inserts and we are not interested in capturing all successful inserts. 

thanks in advance
Tejas

Re: Auditing in Postgres

От
Scott Ribe
Дата:
> Do we have similar commands in pgaudit , which captures only failed DML and not the successful ones.

Not in pgaudit. Just in the standard PG config, in the logging section, you can choose if/how errors are logged. Not at
thegranularity of your example, but you can log all errors, then in your monitoring filter and classify them. 


Re: Auditing in Postgres

От
Tejaswi K T
Дата:

👍

Tejaswi K T reacted via Gmail


On Tue, Apr 9, 2024 at 2:15 PM Scott Ribe <scott_ribe@elevated-dev.com> wrote:
> Do we have similar commands in pgaudit , which captures only failed DML and not the successful ones.

Not in pgaudit. Just in the standard PG config, in the logging section, you can choose if/how errors are logged. Not at the granularity of your example, but you can log all errors, then in your monitoring filter and classify them.

Re: Auditing in Postgres

От
"Satish Chikkathammaiah [NMC - IT]"
Дата:

From: Tejaswi K T <tejaswi.kt@gmail.com>
Sent: Tuesday, April 9, 2024 5:03:56 PM
To: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: Auditing in Postgres
 
***This email was sent from a source outside of NMC***
Do NOT ACT on any instructions given on email unless you recognize the Sender, If in doubt please contact the Sender directly for confirmation.Do not click on links or open attachments unless you recognize the sender.


👍

Tejaswi K T reacted via Gmail


On Tue, Apr 9, 2024 at 2:15 PM Scott Ribe <scott_ribe@elevated-dev.com> wrote:
> Do we have similar commands in pgaudit , which captures only failed DML and not the successful ones.

Not in pgaudit. Just in the standard PG config, in the logging section, you can choose if/how errors are logged. Not at the granularity of your example, but you can log all errors, then in your monitoring filter and classify them.
Classification: Restricted
Disclaimer: This e-mail message including any attachments is intended solely for the addressee(s) and may contain privileged information. If you have received this email by mistake, please notify the sender and delete the message destroying any hard copies of the original message. This message does not contain financial instructions or commitments of any kind. Any views expressed in this message are those of the individual sender. NMC accepts no liability for any damage caused by any virus/worms transmitted by this email..