5 Creating Audit Policies for Oracle Databases

You can create, retrieve, and provision audit settings from an Oracle Database.

5.1 About Audit Policies

Using the Audit Vault Server console, you can retrieve audit policies from Oracle database targets.

You can then modify the policies or create new ones, and then provision them to the Oracle databases. You can retrieve and modify the following types of Oracle Database audit policies.

  • SQL statements

  • Schema objects

  • Privileges

  • Fine-grained auditing

  • Unified audit policies

5.2 General Steps for Creating Audit Policies for Oracle Databases

To create audit policies for Oracle databases, you retrieve the target Oracle Database audit policy settings, modify them, and provision the policy.

The general steps that you follow are:
  1. Retrieve the current audit policy settings from the target Oracle database, and specify which of the current settings are needed.
  2. If necessary, define more audit settings to add to the needed settings.
  3. For unified auditing, select the necessary unified audit policy.
  4. Provision the audit policy to the target database. The policy settings you specified as needed, and the new ones you created, then become the policies in use in the database.

5.3 Retrieving and Modifying Audit Policies from an Oracle Database

You can retrieve audit policies from Oracle database.

5.3.1 Understanding the Columns on the Audit Policies Tab

When you retrieve audit policies from a target Oracle Database, you see the state of the database audit policies at that point in time.

Click the Policies tab in the Audit Vault Server console. The Audit Policies tab in the left navigation menu is displayed by default. This page contains a list of Oracle Database targets. It also lists the time at which the audit policies were last provisioned and retrieved.

Table 5-1 describes the columns shown in the Audit Policies page.

Table 5-1 Fields under Audit Policies tab

Column Description

Target

Name of the target.

Last Retrieved

The time that the audit information for the selected database was last retrieved.

Last Provisioned

The time that the audit settings were last provisioned to the database from Oracle Audit Vault and Database Firewall.

5.3.2 Retrieving Audit Policies from Multiple Oracle Databases

You can retrieve audit policies from several Oracle Database targets at once. You can schedule audit setting retrievals for individual targets.

  1. Log in to the Audit Vault Server console as an auditor.
  2. Click Policies tab.

    This page lists a summary of audit policies at this point in time for all targets with their status.

  3. In the Target column, select the check boxes for the target databases that you want to retrieve audit policies. You can only see the Oracle database targets to which you have access.

    Note:

    • Traditional auditing is supported for Oracle Database versions starting from 11g R2 (11.2.0.4).
    • Unified Auditing is supported for Oracle Database versions starting from 12.2.0.1.
  4. Click Retrieve button.

    To check the status of the retrieval, click the Settings tab. Then click on Jobs tab in the left navigation menu. When the audit policies retrieval is complete, the Audit Settings is displayed on this page under Job Type column.

5.3.3 Scheduling Retrieval of Audit Settings for a Single Oracle Database

You can schedule an audit settings retrieval job from a specific Oracle Database target.

  1. Log in to the Audit Vault Server console as an auditor.
  2. Click Targets tab.
  3. The Targets tab in the left navigation menu is selected by default. The main page lists all the available targets.
  4. Click on the name of the specific Oracle Database target for which the audit settings need to be retrieved.
  5. Scroll down to the Audit Policy section.

    From here you can either retrieve audit settings by clicking Retrieve. Or you can schedule retrieval.

  6. Next to Scheduled field, click on the Enable radio button.

    The scheduling fields appear.

  7. In the Start At field, click the calendar icon to select a date and time for the first retrieval.
  8. In the Repeat Every field, enter a number in the first field. Select a unit in the second field from the drop-down list. The available options are Hour, Days, Weeks, Months.
  9. Click Save.

    To check the status of a scheduled retrieval, click Settings tab. Click Jobs tab in the left navigation menu. When the audit settings retrieval is complete, it is listed on this page.

5.4 Provisioning Unified Audit Policies

Learn about provisioning Unified Audit policies.

5.4.1 Basic Auditing

Learn about basic auditing. It captures logon events, critical activity and schema changes.

The basic audit policy Critical Database Activity is defined as follows and is enabled for all the database users.


CREATE AUDIT POLICY ORA_AV$_CRITICAL_DB_ACTIVITY
PRIVILEGES EXEMPT ACCESS POLICY,EXEMPT REDACTION POLICY,
    ADMINISTER KEY MANAGEMENT,EXPORT FULL DATABASE,IMPORT FULL DATABASE,
    CREATE PUBLIC DATABASE LINK, ALTER PUBLIC DATABASE LINK, DROP PUBLIC DATABASE LINK,
    CREATE PUBLIC SYNONYM, DROP PUBLIC SYNONYM,
    SELECT ANY DICTIONARY, ADMINISTER DATABASE TRIGGER,
    PURGE DBA_RECYCLEBIN, LOGMINING
ACTIONS CREATE USER, ALTER USER, DROP USER,
        CREATE ROLE, DROP ROLE, ALTER ROLE, SET ROLE, GRANT, REVOKE,
        CREATE PROFILE, ALTER PROFILE, DROP PROFILE,
        CREATE PLUGGABLE DATABASE, DROP PLUGGABLE DATABASE, ALTER PLUGGABLE DATABASE,
        CREATE LOCKDOWN PROFILE, ALTER LOCKDOWN PROFILE, DROP LOCKDOWN PROFILE,
        ALTER DATABASE, ALTER SYSTEM,
        CREATE TABLESPACE, ALTER TABLESPACE, DROP TABLESPACE,
        CREATE ROLLBACK SEGMENT, ALTER ROLLBACK SEGMENT, DROP ROLLBACK SEGMENT,
        CREATE DIRECTORY, DROP DIRECTORY,
        CREATE DISK GROUP,ALTER DISK GROUP,DROP DISK GROUP,
        CREATE PFILE,CREATE SPFILE
ACTIONS COMPONENT = datapump EXPORT,IMPORT
ACTIONS COMPONENT = DIRECT_LOAD LOAD;
 
AUDIT POLICY ORA_AV$_CRITICAL_DB_ACTIVITY;
-- enabled for all users

The basic audit policy Logon/Logoff Events audits logon and logoff activities for database users except for a specified list of users and audits all unsuccessful logons and logoffs.

The following policies are provisioned on the target database for logon events category:


CREATE AUDIT POLICY ORA_AV$_LOGON_EVENTS ACTIONS LOGON,LOGOFF;
CREATE AUDIT POLICY ORA_AV$_LOGON_FAILURE ACTIONS LOGON,LOGOFF;

AUDIT POLICY ORA_AV$_LOGON_EVENTS EXCEPT <comma separated user list>;
AUDIT POLICY ORA_AVS$_LOGON_FAILURE whenever not successful;

The basic audit policy Database Schema is defined as follows and is enabled for all the database users.


CREATE AUDIT POLICY ORA_AV$_DB_SCHEMA_CHANGES
PRIVILEGES
        CREATE EXTERNAL JOB, CREATE JOB, CREATE ANY JOB
ACTIONS CREATE PROCEDURE, DROP PROCEDURE, ALTER PROCEDURE,
        CREATE PACKAGE, ALTER PACKAGE, DROP PACKAGE, CREATE PACKAGE BODY, ALTER PACKAGE BODY, DROP PACKAGE BODY,
        CREATE FUNCTION, DROP FUNCTION, ALTER FUNCTION,
        CREATE TRIGGER, ALTER TRIGGER, DROP TRIGGER,
        CREATE LIBRARY, ALTER LIBRARY, DROP LIBRARY,
        CREATE SYNONYM, DROP SYNONYM,
        CREATE TABLE, ALTER TABLE, DROP TABLE, TRUNCATE TABLE,
        CREATE DATABASE LINK, ALTER DATABASE LINK, DROP DATABASE LINK,
        CREATE INDEX, ALTER INDEX, DROP INDEX,
        CREATE OUTLINE, ALTER OUTLINE,DROP OUTLINE,
        CREATE CONTEXT, DROP CONTEXT,
        CREATE ATTRIBUTE DIMENSION,ALTER ATTRIBUTE DIMENSION,DROP ATTRIBUTE DIMENSION,
        CREATE DIMENSION,ALTER DIMENSION,DROP DIMENSION,
        CREATE INDEXTYPE,ALTER INDEXTYPE,DROP INDEXTYPE,
        CREATE OPERATOR,ALTER OPERATOR,DROP OPERATOR,
        CREATE JAVA,ALTER JAVA,DROP JAVA,
        CREATE MINING MODEL,ALTER MINING MODEL,DROP MINING MODEL,
        CREATE TYPE BODY,ALTER TYPE BODY,DROP TYPE BODY,
        CREATE TYPE,ALTER TYPE,DROP TYPE,
        CREATE MATERIALIZED VIEW,ALTER MATERIALIZED VIEW,DROP MATERIALIZED VIEW ,
        CREATE MATERIALIZED VIEW LOG, ALTER MATERIALIZED VIEW LOG,DROP MATERIALIZED VIEW LOG,
        CREATE MATERIALIZED ZONEMAP, ALTER MATERIALIZED ZONEMAP,DROP MATERIALIZED ZONEMAP,
        CREATE VIEW, ALTER VIEW, DROP VIEW,CREATE ANALYTIC VIEW, ALTER ANALYTIC VIEW, DROP ANALYTIC VIEW,
        CREATE SEQUENCE, ALTER SEQUENCE, DROP SEQUENCE,
        CREATE CLUSTER, ALTER CLUSTER, DROP CLUSTER,TRUNCATE CLUSTER;
 
AUDIT POLICY ORA_AV$_DB_SCHEMA_CHANGES;
-- enabled for all users

5.4.2 Admin Activity Auditing Policy

Learn about provisioning the Admin Activity Auditing policy.

The Admin Activity Auditing policy lets you audit all activities by privileged administrators. These administrators can make significant changes to the wider system. A database administrator (DBA) can have access to sensitive data that is not protected by realms, and can exfiltrate. The Admin Activity auditing policy audits all activities for non Oracle maintained user who has one of the following privileges or roles.

  • Admin privileges:

    SYSOPER, SYSDG, SYSKM, SYSRAC, and SYSBACKUP
  • Roles:

    DBA, DATAPUMP_EXP_FULL_DATABASE, DATAPUMP_IMP_FULL_DATABASE, EXP_FULL_DATABASE, IMP_FULL_DATABASE

Note:

  • Non Oracle maintained users are subset of users from dba_users group with oracle_maintained flag set to N.
  • Oracle maintained users are subset of users from dba_users group with oracle_maintained flag set to Y.

The following audit policy gets provisioned on the target database (version 12.1.0.1 or greater):


CREATE AUDIT POLICY ORA_AV$_ADMIN_USER_ACTIVITY ACTIONS ALL
WHEN SYS_CONTEXT('USERENV','CURRENT_USER') NOT IN
(<list of oracle maintained users>) EVALUATE PER STATEMENT

AUDIT POLICY ORA_AV$_ADMIN_USER_ACTIVITY BY USERS WITH GRANTED ROLES DBA,
DATAPUMP_EXP_FULL_DATABASE, DATAPUMP_IMP_FULL_DATABASE, EXP_FULL_DATABASE, 
IMP_FULL_DATABASE;

AUDIT POLICY ORA_AV$_ADMIN_USER_ACTIVITY BY PUBLIC, SYSDG, SYSKM, SYSRAC, SYSBACKUP;

On Oracle Database 19c and above, the system provisions an additional audit policy to monitor all top level activities of SYS as shown here:

CREATE AUDIT POLICY ORA_AV$_SYS_TOP_ACTIVITY ACTIONS ALL ONLY TOPLEVEL;
AUDIT POLICY ORA_AV$_SYS_TOP_ACTIVITY by SYS;

5.4.3 User Activity Auditing Policy

Learn about provisioning the User Activity Auditing policy.

The User Activity Auditing policy tracks all activity by users who may have access to sensitive data or who are under observation. These users could be “non-admin but privileged” users. When enabling this policy in the interface, you must specify non-Oracle maintained users to audit.

The following audit policy gets provisioned on the target database:


CREATE AUDIT POLICY ORA_AV$_USER_ACTIVITY ACTIONS ALL
WHEN SYS_CONTEXT('USERENV','CURRENT_USER') NOT IN
(<list of oracle maintained users>) EVALUATE PER STATEMENT

AUDIT POLICY ORA_AV$_USER_ACTIVITY BY <comma-separated non-Oracle maintained user list>

5.4.4 Center for Internet Security Recommendations Policy

Learn about provisioning CIS recommendations policy.

The Center for Internet Security (CIS) Recommendations policy is a predefined unified audit policy (ORA_CIS_RECOMMENDATIONS) in Oracle Database specifically designed to perform audits that the CIS recommends.

You can enable or disable this policy, along with other policies provided by Oracle Audit Vault and Database Firewall. This policy tracks many activities and can help you evaluate whether you are adhering to database compliance requirements. For example, you can track when a user, database link, profile, or procedure is created, altered, or dropped.

CIS is a world-recognized organization that provides consensus-based best practices for helping organizations assess and improve their cyber security posture. They provide resources, such as configuration assessment tools, secure configuration benchmarks, security metrics, and certifications. One of the main objectives of the organization is to help businesses prioritize what they need to do for security, and they strive to provide recommendations in simple, non-technical terms.

5.4.5 Custom and Oracle Predefined Unified Policies

Learn about provisioning custom and Oracle pre-seeded unified policies.

You can enable Oracle Predefined Policies or Custom Policies that you created on your target database using Oracle Audit Vault and Database Firewall. The following are Oracle Predefined Policies:

  • ORA_ACCOUNT_MGMT
  • ORA_DATABASE_PARAMETER
  • ORA_SECURECONFIG
  • ORA_DV_AUDPOL
  • ORA_DV_AUDPOL2 (Oracle Database 12.2.0.1 and later)
  • ORA_RAS_POLICY_MGMT
  • ORA_RAS_SESSION_MGMT
  • ORA_LOGON_FAILURES

5.4.6 Provisioning Unified Audit Policies from the Audit Vault Server

You can provision unified audit policies from the Audit Vault Server to the target Oracle database.

This updates the audit policies in the target without the intervention of a database administrator. However, a database administrator can modify or delete these audit policies, as well as add new ones. For this reason, you should periodically retrieve the settings to ensure that you have the latest audit policies.
  1. Log in to the Audit Vault Server console as an auditor.
  2. Click on Policies tab.

    The Audit Settings page is displayed, showing the Oracle database targets to which you have access.

  3. Click the name of a target database.
  4. Click Unified Auditing sub tab on the main page.
  5. Select one or more check boxes to enable or disable the policy.
  6. Click Provision Unified Policy button in the top right corner.

    To check the provisioning status, click the Settings tab. Then click on Jobs tab in the left navigation menu. When the job is submitted successfully, the Unified Audit Policy job is displayed on the page under Job Type column.

    Note:

    Ensure the target user has sufficient privileges granted for audit policy management using the privilege script. If the target database is protected with Oracle Database Vault, ensure that the user has been granted the AUDIT SYSTEM and AUDIT ANY privileges. If there is an audit command rule in place, ensure the command is enabled and the user whose name you enter is able to execute the command.

    For Unified audit policy retrieval and provisioning for CDBs and PDBs, the audit policies can be provisioned or retrieved by treating every PDB as an independent target. A CDB can be registered for audit policy management. While provisioning a CDB, audit policies can be included for CDB only, or for CDB and all PDBs. In case CDB and all PDBs are selected, it propogates policies for all the PDB instances. Log in to the Audit Vault Server console and click the Policies tab. In the left navigation menu, select Audit Policies. Under the Unified Auditing sub tab and under the Core Policies section of the main page, there are two radio buttons at the bottom:

    1. Container & All Pluggable Databases
    2. Container Database Only

    Choose these options accordingly and complete the audit policy provisioning. Upon successfully provisioning of the audit policies for a CDB target, the buttons are disabled and cannot be selected again.

5.5 Provisioning Traditional Audit Policies

Traditional audit policies are used to monitor SQL statements, schema objects, privileges, and fine-grained auditing.

5.5.1 About Creating Audit Policy Settings

After you retrieve audit policy settings from the target Oracle database, and selected the settings you need, you can create new policy settings for the Oracle database.

Caution:

  • Any audit setting that is not indicated as Needed in the Audit Vault Server console will be turned off on the target. See "Specifying which Audit Policies are needed".

  • After you have updated and/or created the audit policies for a target Oracle Database, you can provision the audit policy changes to that database.

5.5.2 Specifying which Audit Policies are needed

After you retrieve the audit policies from the target Oracle Database, you can view and modify them as needed.

Remember that you are modifying audit policies in use at the time you retrieved them. If you think they may have changed, you should retrieve them again.

  1. Log in to the Audit Vault Server console as an auditor.

  2. Click Policies tab. The Audit Policies tab in the left navigation menu is selected by default.

  3. Click on the name of the specific Oracle Database target for which you want to change the audit policies.

  4. An overview page for the target displays two sections:

    • Unified Auditing
    • Traditional Auditing
  5. Click Traditional Auditing. It displays the audit policies in use and marked as needed for the audit types:

    • Statement

    • Object

    • Privilege

    • FGA

  6. Click on the link of the specific audit type to update the settings. For example, Object.

    The Object audit policies for the specific target is displayed on the page. This is the current audit policies. The second column displays a problem icon if there is a difference between the setting at the target database, and the setting in Oracle Audit Vault and Database Firewall.

  7. Select the check boxes for each audit setting you determine is needed, then click Set as Needed button on the top right corner.

  8. To remove audit policies, select the check boxes for the ones you want to remove, then click Set as Not Needed.

  9. To create new audit policies for the audit type, click Create.

5.5.3 Creating Audit Policies for SQL Statements

Auditors can create and manage audit policies for SQL statements.

5.5.3.1 About SQL Statement Auditing

Statement auditing audits SQL statements by type of statement, not by the specific schema objects on which the statement operates.

Statement auditing can be broad or focused (for example, by auditing the activities of all database users or only a select list of users). Typically broad statement auditing audits the use of several types of related actions for each option. These statements are in the following categories:

  • Data definition statements (DDL). For example, AUDIT TABLE audits all CREATE TABLE and DROP TABLE statements. AUDIT TABLE tracks several DDL statements regardless of the table on which they are issued. You can also set statement auditing to audit selected users or every user in the database.

  • Data manipulation statements (DML). For example, AUDIT SELECT TABLE audits all SELECT ... FROM TABLE or SELECT ... FROM VIEW statements, regardless of the table or view.

5.5.3.2 Defining SQL Statement Audit Settings

Any auditor can define a SQL statement audit policy.

  1. Log in to the Audit Vault Server console as an auditor.
  2. If necessary, retrieve and update the current audit settings.
  3. Click the Policies tab. The Audit Policies tab in the left navigation menu is selected by default.
  4. Click on a specific Oracle Database target.
  5. An overview page for the target displays two sections:
    • Unified Auditing
    • Traditional Auditing
  6. Click Traditional Auditing. Click Statement in the column Audit Type.

    The statement audit settings of the specific target is displayed.

  7. Click the Create button.
  8. In this page, define the audit policy as follows:
    • Audit Actions By - Choose the users to audit:

      • Both: Audits all users, including proxy users.

      • Proxy: Audits the proxy user for the database. When you select this option, the Proxy User field appears, in which you must specify at least one user.

      • User: Audits the user to which this setting applies. If you select this option, you must select a user from the Users drop-down list.

    • Execution Condition - Choose one of the following:

      • Both: Audits both successful and failed statements

      • On Success: Audits the statement if it is successful

      • On Failure: Audits the statement if it fails

    • DML Audit Granularity - Choose audit granularity for DML statements:

      • Access: Creates an audit record each time the operation occurs

      • Session: Creates an audit record the first time an operation occurs in the current session

      DDL statements are always audited by access.

    • Statements Audit Type - Select the SQL statements to audit by double clicking a statement type to move it to the box on the right. You can use the double arrows to move all statements to the right or back to the left.

  9. Click Save.
5.5.3.3 Understanding the Statement Audit Settings

The Statement Audit Settings page shows status information such as whether the statement is audited or if the statement audit policy is active.

Table 5-2 lists the columns used in the Statement page.

Table 5-2 Columns in the Statement Audit Settings

Column Description

(Left most column)

A checkbox for selecting the audit setting.

(Problem icon)

An exclamation mark icon indicates one of the following conditions:

  • The setting is marked as needed in Oracle Audit Vault and Database Firewall, but is not in use in the target database.

  • The setting is in use at the target database, but is not marked as needed in Oracle Audit Vault and Database Firewall.

Setting

The statement that is audited.

In Use

A green check mark indicates if the setting is active in the target database. A red cross mark indicates if it has not been provisioned or is not active.

Needed

A green check mark indicates if the audit setting is marked as needed in Oracle Audit Vault and Database Firewall. A red cross mark indicates if the audit setting is marked as not needed.

If an audit setting that is not in use is set to needed, a green check mark appears after provisioning in the In Use column. If an audit setting that is in use is set to not needed, the audit setting is no longer displayed after provisioning.

Audit granularity

The granularity of auditing: ACCESS or SESSION

Execution Condition

The execution condition audited: SUCCESS, FAILURE, or BOTH

Proxy User

The proxy user for the database, if any.

User

The user to which this setting applies, if any.

5.5.4 Creating Audit Policies for Schema Objects

Auditors can create and manage schema object audit policies.

5.5.4.1 About Schema Object Auditing

Schema object auditing is the auditing of specific statements on a particular schema object, such as AUDIT SELECT ON HR.EMPLOYEES.

Schema object auditing is very focused, auditing only a specific statement on a specific schema object for all users of the database.

For example, object auditing can audit all SELECT and DML statements permitted by object privileges, such as SELECT or DELETE statements on a given table. The GRANT and REVOKE statements that control those privileges are also audited.

Object auditing lets you audit the use of powerful database commands that enable users to view or delete very sensitive and private data. You can audit statements that reference tables, views, sequences, standalone stored procedures or functions, and packages.

Oracle Database sets schema object audit options for all users of the database. You cannot set these options for a specific list of users.

5.5.4.2 Defining Schema Object Audit Settings

Any auditor can define a schema object audit policy.

  1. Log in to the Audit Vault console as an auditor.
  2. If necessary, retrieve and update the current audit settings.
  3. Click Policies tab. The Audit Policies tab in the left navigation menu is selected by default.
  4. Click on a specific target Oracle database.

    An overview page for the target displays two sections:

    • Unified Auditing
    • Traditional Auditing
  5. Click on Traditional Auditing.
  6. Click Object to display the Object Audit Settings of the specific target.
  7. Click the Create button.
  8. In the Object Audit Settings page, define the settings as follows:
    • Object Type - Select the type of object to audit from the drop-down list, such as TABLE, LOB, RULE, or VIEW.

    • Object - Select a specific object of the object type you selected.

    • Execution Condition - Choose one of the following:

      • Both: Audits both successful and failed statements

      • On Success: Audits the statement if it is successful

      • On Failure: Audits the statement if it fails

    • DML Audit Granularity - Choose audit granularity for DML statements:

      • Access: Creates an audit record each time the operation occurs

      • Session: Creates an audit record the first time an operation occurs in the current session

      DDL statements are always audited by access.

    • Statements Audit Type - Select the SQL statements to audit by double clicking a statement type to move it to the box on the right. You can use the double arrows to move all statements to the right or back to the left.

  9. Click Save.

    The newly defined object audit settings is added to the Object Audit Settings page.

5.5.4.3 Understanding the Object Audit Settings Page

The Object Audit Settings page shows object status information such as the object that is being audited and whether the policy is active.

Table 5-3 lists the columns used in the Object page.

Table 5-3 Columns in the Object Audit Settings Page

Column Description

(Leftmost column)

A checkbox for selecting the audit setting

Problem icon

An exclamation mark icon indicates one of the following conditions:

  • The setting is marked as needed in Oracle Audit Vault and Database Firewall, but is not in use in the target database.

  • The setting is in use at the target database, but is not marked as needed in Oracle Audit Vault and Database Firewall.

Setting

The statement that is audited

In Use

The arrow points upward if the setting is active in the target database, and downward if it has not been provisioned or is not active.

Needed

The arrow points upward if the audit setting is marked as needed in Oracle Audit Vault and Database Firewall, and downward if the audit setting is marked as not needed.

If an audit setting that is not in use is set to needed, the In Use arrow points up after provisioning. If an audit setting that is in use is set to not needed, the audit setting is no longer displayed after provisioning.

Name

The name of the object in the specified schema.

Type

The object (such as a database table) to which this setting applies

Owner Name

The database schema to which this setting applies

Audit Granularity

The granularity of auditing: ACCESS or SESSION

Execution Condition

The execution condition audited: SUCCESS, FAILURE, or BOTH

5.5.5 Creating Audit Policies for Privileges

Auditors can create and manage privilege audit policies.

5.5.5.1 About Privilege Auditing

Privilege auditing is the auditing of SQL statements that use a system privilege.

You can audit the use of any system privilege. Like statement auditing, privilege auditing can audit the activities of all database users or only a specified list of users.

For example, if you enable AUDIT SELECT ANY TABLE, Oracle Database audits all SELECT tablename statements issued by users who have the SELECT ANY TABLE privilege. This type of auditing is very important for the Sarbanes-Oxley (SOX) Act compliance requirements. Sarbanes-Oxley and other compliance regulations require the privileged user be audited for inappropriate data changes or fraudulent changes to records.

Privilege auditing audits the use of powerful system privileges enabling corresponding actions, such as AUDIT CREATE TABLE. If you set both similar statement and privilege audit options, then only a single audit record is generated. For example, if the statement clause TABLE and the system privilege CREATE TABLE are both audited, then only a single audit record is generated each time a table is created. The statement auditing clause, TABLE, audits CREATE TABLE, ALTER TABLE, and DROP TABLE statements. However, the privilege auditing option, CREATE TABLE, audits only CREATE TABLE statements, because only the CREATE TABLE statement requires the CREATE TABLE privilege.

Privilege auditing does not occur if the action is already permitted by the existing owner and schema object privileges. Privilege auditing is triggered only if these privileges are insufficient, that is, only if what makes the action possible is a system privilege.

Privilege auditing is more focused than statement auditing for the following reasons:

  • It audits only a specific type of SQL statement, not a related list of statements.

  • It audits only the use of the target privilege.

5.5.5.2 Defining Privilege Audit Settings

Any auditor can define a privilege audit policy.

  1. Log in to the Audit Vault Server console as an auditor.
  2. If necessary, retrieve and update the current audit settings.
  3. Click Policies tab. The Audit Policies tab in the left navigation menu is selected by default.
  4. Click on the name of the specific Oracle Database target for which you want to change the audit settings.
  5. An overview page for the target displays two sections:
    • Unified Auditing
    • Traditional Auditing
  6. Click Privilege.

    The Privilege Audit Settings for a specific target is displayed.

  7. Click the Create button.
  8. In the Create Privilege Audit Settings page, define the privilege audit policy as follows:
    • Audited By - Choose the users to audit:

      • Both: Audits all users, including proxy users.

      • Proxy: Audits the proxy user for the database. When you select this option, the Proxy Users field appears, in which you must specify at least one user. To display a list of proxy users and their targets for selection, click up-arrow icon on the right of the field.

      • User: Audits the user to which this setting applies. When you select this option, the Users field appears, and you must specify a user from the drop-down list.

    • Execution Condition - Choose one of the following:

      • Both: Audits both successful and failed privilege use

      • On Success: Audits the privilege use if it is successful

      • On Failure: Audits the privilege use if it fails

    • DML Audit Granularity - Choose audit granularity for DML statements:

      • Access: Creates an audit record each time the operation occurs

      • Session: Creates an audit record the first time an operation occurs in the current session

      DDL statements are always audited by access.

    • Statements Audit Type - Select the privileges to audit by double clicking a statement type to move it to the box on the right.

      You can use the double arrows to move all statements to the right or back to the left.

  9. Click Save.

    The newly defined privilege audit settings is added to the list in the Privilege Audit Settings page.

5.5.5.3 Understanding the Privilege Audit Settings Page

The Privilege Audit Settings page shows status information such as the privileges being audited and whether an audit policy is active.

Table 5-4 lists the columns used in the Privilege Audit Settings page.

Table 5-4 Columns in the Privilege Audit Settings Page

Column Description

(Leftmost column)

A checkbox for selecting the audit setting

Problem icon

An exclamation mark icon indicates one of the following conditions:

  • The setting is marked as needed in Oracle Audit Vault and Database Firewall, but is not in use in the target database.

  • The setting is in use at the target database, but is not marked as needed in Oracle Audit Vault and Database Firewall.

Setting

The statement that is audited

In Use

The arrow points upward if the setting is active in the target database, and downward if it has not been provisioned or is not active.

Needed

The arrow points upward if the audit setting is marked as needed in Oracle Audit Vault and Database Firewall, and downward if the audit setting is marked as not needed.

If an audit setting that is not in use is set to needed, the In Use arrow points up after provisioning.

If an audit setting that is in use is set to not needed, the audit setting is no longer displayed after provisioning.

Audit granularity

The granularity of auditing: BY ACCESS or BY SESSION

Execution Condition

The execution condition audited: SUCCESS, FAILURE, or BOTH

User

The user to which this setting applies, if any

Proxy User

The proxy user for the database, if any

5.5.6 Creating Audit Policies for Fine-Grained Auditing (FGA)

Auditors can create and manage fine-grained audit policies.

5.5.6.1 About Fine-Grained Auditing

Fine-grained auditing (FGA) enables you to create a policy that defines specific conditions that must exist for the audit to occur.

For example, fine-grained auditing lets you audit the following types of activities:

  • Accessing a table between 9 p.m. and 6 a.m. or on Saturday and Sunday

  • Using an IP address from outside the corporate network

  • Selecting or updating a table column

  • Modifying a value in a table column

A fine-grained audit policy provides granular auditing of select, insert, update, and delete operations. Furthermore, you reduce the amount of audit information generated by restricting auditing to only the conditions that you want to audit. This creates a more meaningful audit trail that supports compliance requirements. For example, a central tax authority can use fine-grained auditing to track access to tax returns to guard against employee snooping, with enough detail to determine what data was accessed. It is not enough to know that a specific user used the SELECT privilege on a particular table. Fine-grained auditing provides a deeper audit, such as when the user queried the table or the computer IP address of the user who performed the action.

5.5.6.2 Using Event Handlers in Fine-Grained Auditing

In a fine-grained audit policy, you can specify an event handler to process an audit event.

The event handler provides flexibility in determining how to handle a triggering audit event. For example, it could write the audit event to a special audit table for further analysis, or it could send a pager or an email alert to a security administrator. This feature enables you to fine-tune audit responses to appropriate levels of escalation.

For additional flexibility in implementation, you can employ a user-defined function to determine the policy condition, and identify a relevant column for auditing (audit column). For example, the function could allow unaudited access to any salary as long as the user is accessing data within the company, but specify audited access to executive-level salaries when they are accessed from outside the company.

5.5.6.3 Auditing Specific Columns and Rows

A fine-grained audit policy can target one or more specific columns, called a relevant column, to be audited if a condition is met.

This feature enables you to focus on particularly important, sensitive, or privacy-related data to audit, such as the data in columns that hold credit card numbers, patient diagnoses, Social Security numbers, and so on. A relevant-column audit helps reduce the instances of false or unnecessary audit records, because the audit is triggered only when a particular column is referenced in the query.

You further can fine-tune the audit to specific columns and rows by adding a condition to the audit policy. For example, suppose you enter the following fields in the Create Fine Grained Audit page:

  • Condition: department_id = 50

  • Columns: salary, commission_pct

This setting audits anyone who tries to select data from the salary and commission_pct columns of employees in Department 50.

If you do not specify a relevant column, then Oracle Database applies the audit to all the columns in the table; that is, auditing occurs whenever any specified statement type affects any column, whether or not any rows are returned.

5.5.6.4 Defining Fine-Grained Audit Settings

Any auditor can define a fine-grained audit policy.

  1. Log in to the Audit Vault Server console as an auditor.
  2. If necessary, retrieve and update the current audit settings.
  3. Click Policies tab. The Audit Policies tab in the left navigation menu is selected by default.
  4. Click on the name of the specific Oracle Database target for which you want to change the audit settings.

    An overview page for the target displays two sections:

    • Unified Auditing
    • Traditional Auditing
  5. Click on Traditional Auditing.
  6. Click FGA. It displays the Fine Grained Audit Settings page of the specific target.
  7. Click the Create button.
  8. Define the audit policy as follows:
    • Policy Name - Enter a name for this fine-grained audit policy.

    • Audit Trail - Select from one of the following audit trail types:

      Definition Description

      Database

      Writes the policy records to the database audit trail SYS.FGA_LOG$ system table.

      Database with SQL Text

      Performs the same function as the Database option, but also populates the SQL bind and SQL text CLOB-type columns of the SYS.FGA_LOG$ table.

      XML

      Writes the policy records to an operating system XML file. To find the location of this file, a database administrator can run the following command in SQL*Plus:

      SQL> SHOW PARAMETER AUDIT_FILE_DEST

      XML with SQL Text

      Performs the same function as the XML option, but also includes all columns of the audit trail, including SQLTEXT and SQLBIND values.

      WARNING:

      Be aware that sensitive data, such as credit card numbers, appear in the audit trail if you collect SQL text.

    • Schema - Select a schema to audit.

    • Objects - Select an object to audit.

    • Statements - Select one or more SQL statements to audit by double clicking each statement to move it to the box on the right. You can select: DELETE, INSERT, SELECT, or UPDATE.

    • Columns - (Optional) Enter the names of the database columns (relevant columns) to audit. Separate each column name with a comma. If you enter more than one column, select All or Any as the condition that triggers this policy.

    • Conditions - (Optional) Enter a boolean condition to filter row data. For example, department_id = 50 .

      If this field is blank or null, auditing occurs regardless of condition.

    • Handler Schema - (Required if you specify an event handler function) Enter the name of the schema account in which the event handler was created. For example: SEC_MGR

    • Handler Package - (Required if you specify an event handler function) Enter the name of the package in which the event handler was created. For example: OE_FGA_POLICIES

    • Handler Function - (Optional) Enter the name of the event handler. For example: CHECK_OE_VIOLATIONS

  9. Click Save.
5.5.6.5 Understanding the Fine-Grained Audit Settings Page

The Fine-Grained Audit Settings page shows status information, such as the object to which the policy applies.

Table 5-5 lists the columns used in the Fine-Grained Audit Settings page.

Table 5-5 Columns in the Fine-Grained Audit Settings Page

Field Description

(Leftmost column)

A checkbox for selecting the audit setting

Problem

An exclamation mark icon indicates one of the following conditions:

  • The setting is marked as needed in Oracle Audit Vault and Database Firewall, but is not in use in the target database.

  • The setting is in use at the target database, but is not marked as needed in Oracle Audit Vault and Database Firewall.

Name

The name of this fine-grained audit policy

In Use

The arrow points upward if the setting is active in the target and downward if it has not been provisioned or is not active.

Needed

The arrow points upward if the audit setting is marked as needed in Oracle Audit Vault and Database Firewall, and downward if the audit setting is marked as not needed.

If an audit setting that is not in use is set to needed, the In Use arrow points up after provisioning. If an audit settings that is in use is set to not needed, the audit setting is no longer displayed after provisioning.

Object Owner

The schema to which this audit setting applies

Object

The object, in the specified schema, to which this audit setting applies

Statement Types

The SQL statement to which this audit setting applies. Values are:

  • S: SELECT

  • I: INSERT

  • U: UPDATE

  • D: DELETE

  • M: MERGE

Columns

The database columns being audited, also referred to as the relevant columns. If this field is empty, all columns are audited.

5.5.7 Exporting Audit Settings to a SQL Script

You can export audit policy settings for a target to a SQL script from Oracle Audit Vault and Database Firewall.

Then you can give the script to a database administrator for the target Oracle Database to use to update the audit settings on that database.
  1. Log in to the Audit Vault console as an auditor.
  2. Click the Policy tab.

    The Audit Settings page is displayed, showing the Oracle database targets to which you have access.

  3. Click the name of a target database.

    The Audit Settings Overview for that database appears.

  4. Select one or more check boxes for the audit types that you want to export: Statement, Object, Privilege, or FGA.
  5. Click Export/Provision.

    The Export/Provision Audit Settings page appears, displaying the exportable audit commands.

  6. Click the Export radio button, then click the Export button, and then click OK to confirm.
  7. Save the SQL file to a location on your system.
  8. Give the saved script to the database administrator for that target.

    The database administrator can then apply the policies to the target. To verify that the settings have been updated, you can retrieve the audit settings.

5.5.8 Provisioning the Audit Policies from the Audit Vault Server

You can provision the audit policy settings directly from the Audit Vault Server to the target Oracle Database.

This updates the audit policies in the target without the intervention of a database administrator. However, a database administrator can modify or delete these audit policies, as well as add new ones. For this reason, you should periodically retrieve the settings to ensure that you have the latest audit policies.
  1. Log in to the Audit Vault Server console as an auditor.
  2. Click Policies tab.

    The Audit Policies tab in the left navigation menu is selected by default. It displays Oracle Database targets to which you have access.

  3. Click the name of the specific target database.
  4. Click Traditional Auditing sub tab on the main page.
  5. Select one or more check boxes for the audit types that you want to provision: Statement, Object, Privilege, or FGA.
  6. Click Provision Traditional Policy button.

    The Export/Provision Audit Settings page appears. It displays the exportable audit commands, and allowing you to verify them before provisioning. The audit settings can be either exported to a file or provisioned directly to the target.

  7. Click the Provision radio button below the box.
  8. Ensure the target user has sufficient privileges granted for audit policy management using the privilege script.

    If the target database is protected with Oracle Database Vault, ensure that the user has been granted the AUDIT SYSTEM and AUDIT ANY privileges. If there is an audit command rule in place, ensure the command is enabled and the user whose name you enter is able to execute the command.

  9. Click the Provision button in the top right corner.
  10. Click OK to confirm.

    To check the provisioning status, click the Settings tab. Then click on Jobs tab in the left navigation menu. When the job is submitted successfully, the Audit Settings job is displayed on the page under Job Type column.