Re: creating procedure for audit table
Posted in 2003
Topics: Stored Procedures & SPL, Security, Permissions & Auditing, Triggers, Constraints & Referential Integrity, Platform-Specific Issues, Versions, Editions & End-of-Life
Thank's Hari,
it's really help me.... will try it.
rgds
"Hari Gupta" <hariog@yahoo.com> wrote in message news:<KF9Ha.10$747.385@news.optus.net.au>...
> Hi,
>
> Not sure about implementation of procedure for auditing an updte of a table,
> however, you can try using onaudit and onshowaudit utilities (It works ok
> with IDS 9.21). Here are the example to use this:
>
> 1. First turn on auditing by :
> a) onaudit -l 1 {Pl. note -l is Lowercase letter "L"}
> OR
> b) Edit ADTMODE 1 # Audit Mode (Configuration Parameter)
>
> 2. Specify the dir. for audit dump files
> a) onaudit -p <any-dir-to-hold-audit-file-with-path>
>
> Example - Trace the manipulations (UPDATE) for user hari
>
> onaudit -a -u hari -e +UPRW>
> To analyse the audit file:
>
> onshowaudit -u hari
>
> NB: Pl. consult manual for details about various mask etc.
>
> Hari
>
> "abdoell" <abdoell@yahoo.com> wrote in message
> news:e05e140c.0306130035.2cdc6b6f@posting.google.com...
> > Hi All,
> > I'm running informix 9.30UC4W3 on Solaris 7/8.
> > I need your help as i'm new for informix to create a procedure.
> > This procedure purpose to audit a specific table if this table hit by
> > someone (UPDATE) and another procudure to denied any UPDATE on the
> > table.
> >
> > I have created but not working.
> >
> > Could someone pls to help me to create a working procedure to LOG
> > every update and to DENIED any update to specific table.
> > BRGDS
> > ABDOELL
> >
> > my procedure...
> > create table .audit_table
> > (
> > login char(16) not null ,
> > atime datetime year to minute not null ,
> > table char(20) not null ,
> > type char(20) not null ,
> > change char(300) not null
> > );
> >
> > and create triggers and procedures for each table that I need an audit
> > trail for.
> >
> > create table intrud
> > (
> > a integer,
> > b char(8)
> > );
> > revoke all on intrud from "public";> >
> >
> >
> > create trigger update_intrud insert on inrud referencing
> > new as post_upd
> > for each row
> > (
> > execute procedure audit_table(post_upd.a ,post_upd.b
> > ));> >
> > CREATE PROCEDURE audit_table(a int, b char(8))> > define change char(80);
> >
> > insert into audit_table values (user, current, "intrud", "INSERT",> > change);
> > END PROCEDURE;
> > let change = a || "," || b;
Try it on a test server first. Make sure to monitor disk space as well.
Good luck..
Hari
"abdoell" <abdoell@yahoo.com> wrote in message
news:e05e140c.0306170017.5b960b6@posting.google.com...
> Thank's Hari,
> it's really help me.... will try it.
> rgds
>
> "Hari Gupta" <hariog@yahoo.com> wrote in message
news:<KF9Ha.10$747.385@news.optus.net.au>...
> > Hi,
> >
> > Not sure about implementation of procedure for auditing an updte of a
table,
> > however, you can try using onaudit and onshowaudit utilities (It works
ok
> > with IDS 9.21). Here are the example to use this:
> >
> > 1. First turn on auditing by :
> > a) onaudit -l 1 {Pl. note -l is Lowercase letter "L"}
> > OR
> > b) Edit ADTMODE 1 # Audit Mode (Configuration Parameter)
> >
> > 2. Specify the dir. for audit dump files
> > a) onaudit -p <any-dir-to-hold-audit-file-with-path>
> >
> > Example - Trace the manipulations (UPDATE) for user hari
> >
> > onaudit -a -u hari -e +UPRW> >
> > To analyse the audit file:
> >
> > onshowaudit -u hari
> >
> > NB: Pl. consult manual for details about various mask etc.
> >
> > Hari
> >
> > "abdoell" <abdoell@yahoo.com> wrote in message
> > news:e05e140c.0306130035.2cdc6b6f@posting.google.com...
> > > Hi All,
> > > I'm running informix 9.30UC4W3 on Solaris 7/8.
> > > I need your help as i'm new for informix to create a procedure.
> > > This procedure purpose to audit a specific table if this table hit by
> > > someone (UPDATE) and another procudure to denied any UPDATE on the
> > > table.
> > >
> > > I have created but not working.
> > >
> > > Could someone pls to help me to create a working procedure to LOG
> > > every update and to DENIED any update to specific table.
> > > BRGDS
> > > ABDOELL
> > >
> > > my procedure...
> > > create table .audit_table
> > > (
> > > login char(16) not null ,
> > > atime datetime year to minute not null ,
> > > table char(20) not null ,
> > > type char(20) not null ,
> > > change char(300) not null
> > > );
> > >
> > > and create triggers and procedures for each table that I need an audit
> > > trail for.
> > >
> > > create table intrud
> > > (
> > > a integer,
> > > b char(8)
> > > );
> > > revoke all on intrud from "public";> > >
> > >
> > >
> > > create trigger update_intrud insert on inrud referencing
> > > new as post_upd
> > > for each row
> > > (
> > > execute procedure audit_table(post_upd.a ,post_upd.b
> > > ));> > >
> > > CREATE PROCEDURE audit_table(a int, b char(8))> > > define change char(80);
> > >
> > > insert into audit_table values (user, current, "intrud", "INSERT",> > > change);
> > > END PROCEDURE;
> > > let change = a || "," || b;