Data Audit

  • Upload
    risjak

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

  • 8/2/2019 Data Audit

    1/11

    Creating an Audit Log with an online viewing facility

    By Tony Marston

    24th August 2004 Amended 30th June 2007

    As of 10th April 2006 the software discussed in this article can be downloaded fromwww.radicore.org

    Introduction Database Design - AUDIT_SSN table - AUDIT_TRN table - AUDIT_TBL table - AUDIT_FLD table - AUDIT_LOGON_ERRORS table Implementation - Changes to my DML class - New AUDIT_SSN class - New AUDIT_TRN class - New AUDIT_TBL class - New AUDIT_FLD class Viewing the Audit Log - Enter search criteria - List Audit Log details - List Audit Log details for an Object - List Logon Errors Conclusion Amendment History

    Introduction

    It is sometimes necessary to keep track of what changes were made to the database, and bywhom. This is known as Audit Logging or an Audit Trail . I have seen several different ways of implementing Audit Logging, but each method tends to have its own set of advantages anddisadvantages.

    A common method I have seen in the past requires that each application table to be audited has

    its own separate audit table. This is a duplicate of the original, but with extra fields such as DateChanged , Time Changed and Who Changed . This method has the following characteristics:-

    This effectively doubles the number of tables in the entire database. The logging may be performed either by program code or database procedures/triggers. It may be difficult to turn logging on or off for individual tables. It is usually only possible to record one set of values, those that were written to thedatabase, which means that you must look elsewhere to find the original values. If each audit table only contains the fields that were changed there is a potential problemwith a null value. Was it changed to null? Was it changed at all? If the structure of any application database table is changed then the audit table mustalso be changed to keep in line. Due to the potentially large number of audit tables it is difficult to have a single onlineenquiry which is capable of showing the contents of those tables. The usual solution istherefore to have a separate screen to show the contents of each audit table.

    http://www.radicore.org/http://www.tonymarston.net/php-mysql/auditlog.html#introduction%23introductionhttp://www.tonymarston.net/php-mysql/auditlog.html#database.design%23database.designhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_ssn%23audit_ssnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_trn%23audit_trnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl%23audit_tblhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld%23audit_fldhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_logon_errors%23audit_logon_errorshttp://www.tonymarston.net/php-mysql/auditlog.html#implementation%23implementationhttp://www.tonymarston.net/php-mysql/auditlog.html#dml.class.changes%23dml.class.changeshttp://www.tonymarston.net/php-mysql/auditlog.html#audit_ssn.class%23audit_ssn.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_trn.class%23audit_trn.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld.class%23audit_fld.classhttp://www.tonymarston.net/php-mysql/auditlog.html#viewing%23viewinghttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(search).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)2.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#conclusion%23conclusionhttp://www.tonymarston.net/php-mysql/auditlog.html#history%23historyhttp://www.tonymarston.net/php-mysql/auditlog.html#introduction%23introductionhttp://www.tonymarston.net/php-mysql/auditlog.html#database.design%23database.designhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_ssn%23audit_ssnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_trn%23audit_trnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl%23audit_tblhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld%23audit_fldhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_logon_errors%23audit_logon_errorshttp://www.tonymarston.net/php-mysql/auditlog.html#implementation%23implementationhttp://www.tonymarston.net/php-mysql/auditlog.html#dml.class.changes%23dml.class.changeshttp://www.tonymarston.net/php-mysql/auditlog.html#audit_ssn.class%23audit_ssn.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_trn.class%23audit_trn.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld.class%23audit_fld.classhttp://www.tonymarston.net/php-mysql/auditlog.html#viewing%23viewinghttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(search).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)2.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#conclusion%23conclusionhttp://www.tonymarston.net/php-mysql/auditlog.html#history%23historyhttp://www.radicore.org/
  • 8/2/2019 Data Audit

    2/11

    I was never happy with this method as it required a great deal of effort and the online enquirywas clumsy. As soon as I had the opportunity I decided to design a far more elegant method.My first implementation was in a language called UNIFACE , and I have successfully convertedthis design to PHP and MySQL.

    Back to TOP .

    Database Design

    Before designing a solution it is first necessary to analyse the problem and identify therequirements. When somebody updates the database we have the following 'things', entities' or 'objects':

    User A system may be accessible my many users, so it is important to be able toidentify updates by user.

    Session A session covers the time period between a user logging on and logging off the

    system. Note that some systems allow a user to have more than one sessionactive at the same time.

    Transaction Within a session a user may process a transaction, also known as 'task' or 'unit of work'. This is the same as a database transaction which covers all updatesbetween a 'start' and a 'commit'.

    DatabaseTable

    Within a transaction any number of database tables may be modified.

    DatabaseField

    Within a database table any number of fields may be modified.

    As well as being able to store this information, the design should allow for any details to beviewed in a single screen. These details should make it easy to see exactly what informationhas changed, preferably showing both the original and newest values. Impossible? Only tothose of limited ability.

    The design I produced has only four database tables, as described below.

    AUDIT_SSN (audit session)

    This has the following structure in MySQL:

    CREATE TABLE IF NOT EXISTS `audit_ssn` ( `session_id` bigint(20) unsigned NOT NULL auto_increment, `user_id` varchar(16) NOT NULL default 'UNKNOWN', `date` date NOT NULL default '2000-01-01' , `time` time NOT NULL default '00:00:00' ,

    PRIMARY KEY ( `session_id` ));

    The AUDIT_SSN table

    SESSION_ID A unique number given to each session as the first set of details are logged.

    USER_ID User identity. This links to the USER table in my Role Based Access Control database .

    DATE The date the AUDIT_SSN record was created.

    http://www.tonymarston.co.uk/uniface/auditlog.htmlhttp://www.compuware.com/products/uniface/default.htmhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/menuguide/section04.html#userhttp://www.tonymarston.net/php-mysql/role-based-access-control.html#current-designhttp://www.tonymarston.net/php-mysql/role-based-access-control.html#current-designhttp://www.tonymarston.co.uk/uniface/auditlog.htmlhttp://www.compuware.com/products/uniface/default.htmhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/menuguide/section04.html#userhttp://www.tonymarston.net/php-mysql/role-based-access-control.html#current-designhttp://www.tonymarston.net/php-mysql/role-based-access-control.html#current-design
  • 8/2/2019 Data Audit

    3/11

    TIME The time the AUDIT_SSN record was created.

    AUDIT_TRN (audit transaction)

    This has the following structure in MySQL:

    CREATE TABLE IF NOT EXISTS `audit_trn` (

    `session_id` bigint(20) unsigned NOT NULL default '0' , `tran_seq_no` smallint(6) unsigned NOT NULL default '0' , `date` date NOT NULL default '2000-01-01' , `time` time NOT NULL default '00:00:00' , `task_id` varchar(40) NOT NULL default '' ,

    PRIMARY KEY ( `session_id` , `tran_seq_no` ));

    The AUDIT_TRN table

    SESSION_ID As above

    TRAN_SEQ_NO Transaction Sequence Number. This starts at 1 for each Session.

    Each time the database is updated - when the user presses the SUBMITbutton which initiates a start transaction and ends with a commit - this istreated as a separate database transaction. This may include any number of database additions, deletions and updates.

    DATE The date the Transaction started.

    TIME The time the Transaction started.

    TASK_ID The name of the component from which the user initiated the transaction. Thislinks to the TASK table in my Role Based Access Control database .

    AUDIT_TBL (audit table)

    This has the following structure in MySQL:

    CREATE TABLE IF NOT EXISTS `audit_tbl` ( `session_id` bigint(20) unsigned NOT NULL default '0' , `tran_seq_no` smallint(6) unsigned NOT NULL default '0' , `table_seq_no` smallint(6) unsigned NOT NULL default '0' , `base_name` varchar(64) NOT NULL default '' ,

    `table_name` varchar(64) NOT NULL default '' , `pkey` varchar(255) NOT NULL default '' ,PRIMARY KEY ( `session_id` , `tran_seq_no` , `table_seq_no` ),KEY `pkey` ( `pkey` )

    );The AUDIT_TBL table

    SESSION_ID As above

    TRAN_SEQ_NO As above.

    TABLE_SEQ_NO Table Sequence Number. This starts at 1 for each Transaction.

    There may be changes to several occurrences of the same table, so eachoccurrence is given its own sequence number.

    BASE_NAME Database Name. An application may have more than one database, and it is

    http://www.tonymarston.net/php-mysql/menuguide/section04.html#taskhttp://www.tonymarston.net/php-mysql/role-based-access-control.html#current-designhttp://www.tonymarston.net/php-mysql/menuguide/section04.html#taskhttp://www.tonymarston.net/php-mysql/role-based-access-control.html#current-design
  • 8/2/2019 Data Audit

    4/11

    possible for the same table name to exist in more than one database.

    TABLE_NAME Table Name. The name of the database table being updated.

    PKEY Primary Key. The primary key of the database record, shown in the format of the WHERE clause of an sql SELECT statement, as in field='value' ANDfield='value' .

    AUDIT_FLD (audit field)

    This has the following structure in MySQL:

    CREATE TABLE IF NOT EXISTS `audit_fld` ( `session_id` bigint(20) unsigned NOT NULL default '0' , `tran_seq_no` smallint(6) unsigned NOT NULL default '0' , `table_seq_no` smallint(6) unsigned NOT NULL default '0' , `field_id` varchar(255) NOT NULL default '' , `old_value` text, `new_value` text,

    PRIMARY KEY ( `session_id` , `tran_seq_no` , `table_seq_no` , `field_id` ),KEY `field_id` ( `field_id` ));

    The AUDIT_FLD table

    SESSION_ID As above

    TRAN_SEQ_NO As above.

    TABLE_SEQ_NO As above.

    FIELD_ID Field (column) name.

    OLD_VALUE The value in this field before the database update.

    NEW_VALUE The value in this field after the database update.

    The contents of the old_value and new_value fields depends on how the database waschanged:

    Insert - old_value will be empty, new_value will be full Update - both fields will only contain those values which have actually changed. Delete - old_value will be full, new_value will be empty.

    AUDIT_LOGON_ERRORS

    This table is only used for recording instances of failed logon attempts.

    This has the following structure in MySQL:

    CREATE TABLE `audit_logon_errors` ( `id` int(11) NOT NULL auto_increment, `timestamp` datetime NOT NULL default '0000-00-00 00:00:00' , `ip_address` varchar(16) NOT NULL default '0.0.0.0' , `user_id` varchar(16) NOT NULL default '' , `user_password` varchar(16) NOT NULL default '' ,

    PRIMARY KEY ( `id` ));

    The AUDIT_LOGON_ERRORS table

    http://www.tonymarston.net/php-mysql/menuguide/mnu_logon.htmlhttp://www.tonymarston.net/php-mysql/menuguide/mnu_logon.html
  • 8/2/2019 Data Audit

    5/11

    ID Technical primary key

    TIMESTAMP Date and time of the error.

    IP_ADDRESS IP address of the request which generated the error.

    USER_ID Part of the input which generated the error.

    USER_PASSWORD Part of the input which generated the error.

    Back to TOP .

    Implementation

    The next step was to find a way to integrate this design within my existing development infrastructure . What I needed was a way to implement this facility without having to modify amultitude of scripts. Fortunately my modular design , where each component has a specificfunction, made it easy. Every database table is accessed through its own database table class ,and each of these classes is implemented as a subclass of a generic table class whichcommunicates with the database through a separate DML class . This enabled me to implementaudit logging with the following steps:

    I wanted a way to turn logging ON or OFF for individual tables, so I created a classvariable called $audit_logging (boolean, default value = YES) within the generic table class .

    This variable is set by default to ON when the table details are imported into the Data Dictionary . This setting can be modified as desired before the dictionary details are exported to PHP .

    Each user transaction utilises a standard controller script which communicates with adatabase table class through a series of generic methods such as insertRecord() ,updateRecord() and deleteRecord() . These in turn pass their data to a correspondingmethod in the DML class to actually update the physical database. All I had to do here wasto include the contents of the $audit_logging variable in the list of passed values.

    Within the relevant methods of the DML class I added calls to my newly created AUDIT_TBL class immediately after each database update. These are detailed below.

    Changes to my DML classWithin the class constructor I include the definition for the AUDIT_TBL class , as follows:

    require_once 'classes/audit_tbl.class.inc' ;

    Other methods were modified as follows:

    $this ->query = "INSERT INTO $tablename SET ...." ;....if ( $this ->audit_logging) {

    $auditobj =& singleton::getInstance( 'audit_tbl' ); // add record details to audit database $auditobj ->auditInsert( $dbname , $tablename , $pkey , $fieldarray ); $this ->errors = array_merge( $auditobj ->getErrors(), $this ->errors);

    } // if $this ->query = "UPDATE $tablename SET ...." ;

    http://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/infrastructure.htmlhttp://www.tonymarston.net/php-mysql/infrastructure.htmlhttp://www.tonymarston.net/php-mysql/infrastructure.html#figure5http://www.tonymarston.net/php-mysql/infrastructure.html#table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#generic.table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#generic.table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#generic.table.classhttp://www.tonymarston.net/php-mysql/data-dictionary.htmlhttp://www.tonymarston.net/php-mysql/data-dictionary.htmlhttp://www.tonymarston.net/php-mysql/data-dictionary.htmlhttp://www.tonymarston.net/php-mysql/menuguide/dict_table(upd4)export.htmlhttp://www.tonymarston.net/php-mysql/menuguide/dict_table(upd4)export.htmlhttp://www.tonymarston.net/php-mysql/infrastructure.html#component.scripthttp://www.tonymarston.net/php-mysql/infrastructure.html#controller.scripthttp://www.tonymarston.net/php-mysql/infrastructure.html#table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.classhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/infrastructure.htmlhttp://www.tonymarston.net/php-mysql/infrastructure.htmlhttp://www.tonymarston.net/php-mysql/infrastructure.html#figure5http://www.tonymarston.net/php-mysql/infrastructure.html#table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#generic.table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#generic.table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#generic.table.classhttp://www.tonymarston.net/php-mysql/data-dictionary.htmlhttp://www.tonymarston.net/php-mysql/data-dictionary.htmlhttp://www.tonymarston.net/php-mysql/menuguide/dict_table(upd4)export.htmlhttp://www.tonymarston.net/php-mysql/menuguide/dict_table(upd4)export.htmlhttp://www.tonymarston.net/php-mysql/infrastructure.html#component.scripthttp://www.tonymarston.net/php-mysql/infrastructure.html#controller.scripthttp://www.tonymarston.net/php-mysql/infrastructure.html#table.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/infrastructure.html#dml.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.classhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl.class%23audit_tbl.class
  • 8/2/2019 Data Audit

    6/11

    ....if ( $this ->audit_logging) {

    $auditobj =& singleton::getInstance( 'audit_tbl' ); // add record details to audit database $auditobj ->auditUpdate( $dbname , $tablename , $where , $fieldarray ,$oldarray ); $this ->errors = array_merge( $auditobj ->getErrors(), $this ->errors);

    } // if $this ->query = "DELETE FROM $tablename WHERE $where" ;

    ....if ( $this ->audit_logging) { $auditobj =& singleton::getInstance( 'audit_tbl' ); // add record details to audit database $auditobj ->auditDelete( $dbname , $tablename , $where , $fieldarray ); $this ->errors = array_merge( $auditobj ->getErrors(), $this ->errors);

    } // if

    New AUDIT_SSN class

    The only custom code in this class is as follows:

    function _cm_getInitialData ( $fieldarray ) // Perform custom processing for the getInitialData method.

    {if (!isset( $fieldarray [ 'user_id' ])) {

    $fieldarray [ 'user_id' ] = $_SESSION [ 'logon_user_id' ]; $fieldarray [ 'date' ] = getTimeStamp( 'date' ); $fieldarray [ 'time' ] = getTimeStamp( 'time' );

    } // if

    return $fieldarray ;

    } // _cm_getInitialData

    New AUDIT_TRN class

    The only custom code in this class is as follows:

    function _cm_getInitialData ( $fieldarray ) // Perform custom processing for the getInitialData method.

    {if (!isset( $fieldarray [ 'tran_seq_no' ])) {

    $session_id = $fieldarray [ 'session_id' ]; // obtain the next value for tran_seq_no $select = "SELECT max(tran_seq_no)

    FROM $this ->tablename WHERE session_id=' $session_id '" ;

    $count = $this ->getCount( $select ); $fieldarray [ 'tran_seq_no' ] = $count + 1; // fill in other data $fieldarray [ 'task_id' ] = $GLOBALS[ 'task_id' ]; $fieldarray [ 'date' ] = getTimeStamp( 'date' ); $fieldarray [ 'time' ] = getTimeStamp( 'time' );

    } // if

    return $fieldarray ;

    } // _cm_getInitialData

    New AUDIT_TBL class

  • 8/2/2019 Data Audit

    7/11

  • 8/2/2019 Data Audit

    8/11

  • 8/2/2019 Data Audit

    9/11

    foreach ( $oldarray as $item => $value ) {if (!array_key_exists( $item , $newarray )) {

    unset ( $oldarray [ $item ]);} // if

    } // foreach} // if

    $table_seq_no = $fieldarray [ 'table_seq_no' ];

    $fieldarray = array();

    $ix = 0;

    foreach ( $oldarray as $field_id => $old_value ) { $ix ++; $fieldarray [ $ix ][ 'session_id' ] = $session_id ; $fieldarray [ $ix ][ 'tran_seq_no' ] = $tran_seq_no ; $fieldarray [ $ix ][ 'table_seq_no' ] = $table_seq_no ; $fieldarray [ $ix ][ 'field_id' ] = $field_id ; $fieldarray [ $ix ][ 'old_value' ] = $old_value ;

    if (isset( $newarray [ $field_id ])) { $fieldarray [ $ix ][ 'new_value' ] = $newarray [ $field_id ]; // remove matched entry from $newarray

    unset( $newarray [ $field_id ]);} else { $fieldarray [ $ix ][ 'new_value' ] = '' ;

    } // if} // foreach

    // process any unmatched details remaining in $newarrayforeach ( $newarray as $field_id => $new_value ) {

    $ix ++; $fieldarray [ $ix ][ 'session_id' ] = $session_id ; $fieldarray [ $ix ][ 'tran_seq_no' ] = $tran_seq_no ; $fieldarray [ $ix ][ 'table_seq_no' ] = $table_seq_no ; $fieldarray [ $ix ][ 'field_id' ] = $field_id ; $fieldarray [ $ix ][ 'old_value' ] = '' ; $fieldarray [ $ix ][ 'new_value' ] = $new_value ;

    } // foreach

    // add all these records to the databaserequire_once 'audit_fld.class.inc' ;

    $fld_obj =& singleton::getInstance(' audit_fld' );

    $fieldarray = $fld_obj ->insertMultiple( $fieldarray ); $this ->errors = $fld_obj ->getErrors();

    // switch from AUDIT back to original database name $this ->selectDB( $dbname );

    return;

    } // auditWrite

    New AUDIT_FLD class

    This does not require any custom code to augment what was created by the dictionary export function.

    Back to TOP .

    Viewing the Audit Log

    http://www.tonymarston.net/php-mysql/menuguide/dict_table(upd4)export.htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/menuguide/dict_table(upd4)export.htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23top
  • 8/2/2019 Data Audit

    10/11

    As there are only a small number of tables to hold the audit log details the contents can beviewed with a few simple screens:

    Search Audit Details List Audit Details List Audit Details for an Object List Logon Errors

    There is also a task Generate SQL which will write an SQL query based on the selected auditlog entry to a file. This will enable the database change to be duplicated in another copy of thedatabase.

    Back to TOP .

    Conclusion

    As you can see this is a simple yet flexible design which has the following characteristics:-

    Only four extra audit tables are required for any number of application tables in anynumber of databases. All logging is performed within the standard infrastructure code - there is no need for anyadditional code in any application components, nor any database procedures or triggers. Logging for individual tables can be turned on or off via a simple switch inside the table'sdefinition within the Data Dictionary . For each change both the 'old' and 'new' values are recorded. Fields which have not changed are not shown. There is no potential confusion with null values. The structure of any application database table can be changed at will without requiring

    any corresponding changes to the structure of the tables in the audit database. As there are only four audit tables in a strict hierarchy their contents can easily be viewedonline via a single screen, and filtered via a variety of selection criteria. As well as being a useful tool in a production environment in order to see who changedwhat, and when, it is also a useful tool in a development environment as it can instantlyshow how the database was changed after each user transaction.

    The only disadvantage to this implementation is that it can only log those changes which areperformed through the application. Any changes done through other means, such as directly viaSQL or through other applications, will not be logged. When you weigh up the cost of providingsuch comprehensive logging - the number of audit tables, the number of database triggers, the

    number of enquiry screens - you just have to ask the question "is it worth it?"

    Back to TOP .

    Tony Marston 24th August 2004

    http://www.tonymarston.net http://www.radicore.org

    Amendment history:

    30th June2007

    Added a new task Generate SQL which will write an SQL query based on theselected audit log entry to a file. This will enable the database change to be

    http://www.tonymarston.net/php-mysql/menuguide/audit_dtl(search).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)2.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_tbl(upd4).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_tbl(upd4).htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/data-dictionary.html#$audit_logginghttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/http://www.radicore.org/http://www.tonymarston.net/php-mysql/menuguide/audit_tbl(upd4).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(search).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)2.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_tbl(upd4).htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/php-mysql/data-dictionary.html#$audit_logginghttp://www.tonymarston.net/php-mysql/auditlog.html#top%23tophttp://www.tonymarston.net/http://www.radicore.org/http://www.tonymarston.net/php-mysql/menuguide/audit_tbl(upd4).html
  • 8/2/2019 Data Audit

    11/11

    duplicated in another copy of the database.

    10th March2006

    Added a new database table AUDIT_LOGON_ERRORS and a new screen List Logon Errors .

    2ndJanuary2006

    Replaced database tables AUDIT_HDR and AUDIT_DTL with the more normalised AUDIT_SSN , AUDIT_TRN , AUDIT_TBL and AUDIT_FLD .

    21st June2005 Added a screenshot for List Audit Log details for an Object .

    17th June2005

    Amended Implementation section to include reference to the Data Dictionary .

    http://www.tonymarston.net/php-mysql/auditlog.html#audit_logon_errors%23audit_logon_errorshttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_ssn%23audit_ssnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_trn%23audit_trnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl%23audit_tblhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld%23audit_fldhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld%23audit_fldhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#implementation%23implementationhttp://www.tonymarston.net/php-mysql/data-dictionary.htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_logon_errors%23audit_logon_errorshttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/menuguide/audit_logon_errors(list).htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_ssn%23audit_ssnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_trn%23audit_trnhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_tbl%23audit_tblhttp://www.tonymarston.net/php-mysql/auditlog.html#audit_fld%23audit_fldhttp://www.tonymarston.net/php-mysql/menuguide/audit_dtl(list)3.htmlhttp://www.tonymarston.net/php-mysql/auditlog.html#implementation%23implementationhttp://www.tonymarston.net/php-mysql/data-dictionary.html