 |
|
Oracle audit command tips
Oracle security Tips by Burleson Consulting |
Question:
Can I use the Oracle audit command to audit updates to an
Oracle database? What alternative are there for the Oracle audit table
command? Which audit tool is best?
Answer:
First, see my notes on the different
types of Oracle auditing especially Oracle fine-grained auditing (FGA) and
Oracle logminer. For complete details on Oracle
auditing, see my my book "Oracle
Privacy Security Auditing", and you can buy Oracle at this link and get
instant access to Oracle auditing scripts.
Oracle auditing setup & configuration
The Oracle audit command is used to to create specific audit trails for
Oracle tables. to enable Oracle auditing you must set the initialization
parameter "audit_trail = true" and run the cataudit.sql scripts (as SYS).
Managing Oracle audit trails
The Oracle audit command write the audit information to specific data
dictionary views (BEWARE: These audit trail rows can quickly fill-up your
SYSTEM tablespace, and special care needs to be taken to ensure that you do not
"lock-up" your database fill filling the SYSTEM tablespace.
-
dba_audit_exists
-
dba_audit_object
-
dba_audit_session
-
dba_audit_statement
-
dba_audit_trail
We also have these metadata views for Oracle auditing
options:
-
dba_obj_audit_opts
-
dba_priv_audit_opts
-
dba_stmt_audit_opts
Auditing the audit trail
Today, we need to audit the audit trail itself to prevent "inside jobs" and
this Oracle command will record all changes to the audit trail. See my
notes on the types of "inside jobs" and
Oracle hackers horror stories:
audit
delete,
insert,
update
on
sys.aud$
by access;
Auditing user activity with the Oracle audit command
Oracle has syntax for auditing specific user activity. To audit the
activity of user FRED we could issue these audit commands:
Audit all Oracle user activity.
This audits everything including DDL (create table), DML (inserts, updates,
deletes) and login/logoff events:
audit all by FRED by access;
Audit all Oracle user viewing activity:
audit select
table by FRED by access;
Audit all Oracle user data change activity:
audit update
table, delete table,
insert table by FRED by access;
Audit all Oracle user viewing activity:
audit execute
procedure by FRED by access;
We can also query the dba_audit_trail view. Here are the column
descriptions from the Oracle documentation:
This query by Arup Nanda, co-author of "Oracle
Privacy Security Auditing", shows a sample query against dba_audit_trail
for standard Oracle auditing. You can download his complete set of
auditing scripts when you buy his book.
select 'standard audit', sessionid,
proxy_sessionid, statementid, entryid, extended_timestamp, global_uid,
username, client_id, null, os_username, userhost, os_process, terminal,
instance_number, owner, obj_name, null, new_owner,
new_name, action, action_name, audit_option, transactionid, returncode,
scn, comment_text, sql_bind, sql_text,
obj_privilege, sys_privilege, admin_option, grantee, priv_used,
ses_actions, logoff_time, logoff_lread, logoff_pread, logoff_lwrite,
logoff_dlock, session_cpu
from
dba_audit_trail;
This is just a tiny sample of the Oracle audit functionality and see the book
"Oracle
Privacy Security Auditing", for details and working scripts for Oracle
auditing.
 |
If you like Oracle tuning, see the book "Oracle
Tuning: The Definitive Reference", with 950 pages of tuning tips and
scripts.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot of Oracle tuning scripts. |