Introduction to Auditing

Oracle AI Database provides the industry’s most comprehensive auditing capability, enabling the capture of detailed information relating to who, what, when the action was performed, and the associated context with the activity which generated the audit record.

Related Topics

What Is Auditing?

Database auditing is the most accurate record of any database activity. Auditing tracks the use of privileges, activities of highly privileged users, access to sensitive data, actions performed on database objects and modifications made to database settings.

Database auditing has steadily increased in both capability and popularity over the past decade, and today is mandatory in most organizations. They need to audit not only to detect any unauthorized use, but also to ensure that they comply with different regulations, such as General Data Protection Regulation (GDPR), Payment Card Industry (PCI), California Consumer Privacty Act (CCPA), and other privacy regulations across the globe.

Database auditing is typically used for the following use cases:

Database auditing is the most accurate record of any database activity, not just from connections happening over the wire but also through direct local logins, recursive SQLs, dynamic SQLs, and stored procedures.

An audit record gives you full execution context including details of the operation, type of SQL statement executed, use of powerful system privileges, operation performed, database object involved in the operation, and other session details that are useful for forensic analysis.

You can configure auditing for both successful and failed operations, however, parse or syntax errors are not audited. Additionally, you can include or exclude specific users from the audit. Auditing is independent of external connection factors like the network encryption, the access path, or the user, and is always available as a reliable source of actual events that have happened.

You can audit individual actions of the pluggable database (PDB) or individual actions in the entire multitenant container database (CDB). In addition to auditing the standard activities the database provides, auditing can include activities from Real Application Security, Oracle Automatic Storage Management, Oracle Recovery Manager, Oracle Data Pump, Oracle Machine Learning for SQL, Oracle Database Vault, Oracle Label Security, and Oracle SQL*Loader direct path events.

Oracle AI Database auditing has been enhanced with each successive release of the database. Traditional auditing was the historical database auditing approach in releases earlier than Oracle Database 12c. Unified auditing was introduced subsequently in Oracle Database 12c, where auditing functionality was significantly enhanced to provide a robust and highly customizable framework that can be fine-tuned to address specific security requirements. Traditional auditing is desupported in Oracle AI Database 26ai. Oracle recommends that you use unified auditing.

Oracle AI Database auditing (unified auditing) is enabled by default. Follow the below set of guidelines to ensure your database auditing requirements meet the most common security and compliance needs:

  1. Make the most of the always-on mandatory audits. Certain security-sensitive database activities are mandatorily audited in the Oracle AI Database and cannot be disabled. Do not duplicate them.

  2. Use the predefined unified audit policies. Oracle AI Database provides predefined unified audit policies that encompass the standard audit settings that most regulatory agencies require.

    1. The ORA_SECURECONFIG and ORA_LOGIN_LOGOUT pre-defined unified audit policies are automatically enabled in most deployments. Ensure to enable them if you have not done so already.

    2. Autonomous databases provides numerous predefined audit policies that are enabled by default.

    3. If you are using Oracle Data Safe or Oracle Audit Vault and Database Firewall (AVDF) to monitor the database activity across your enterprise, these products also offer a number of predefined audit policies to provision with a single click.

  3. Create custom audit policies for specialized use cases. Oracle AI Database provides the flexibility to create and enable custom audit policies for your specific needs. You can either define unified audit policies or fine-grained audit policies for specialized needs.

Database auditing is frequently augmented with Database Activity Monitoring (DAM) solutions that collect and store the audit data for alert generation, analysis, and reporting. Oracle AI Database security products that offer DAM solutions include Oracle Data Safe, and Oracle Audit Vault and Database Firewall (AVDF).

Related Topics

Why Is Auditing Used?

You typically use auditing to monitor user activity.

Auditing can be used to accomplish the following:

Oracle recommends that you audit your databases. Auditing is an effective method of enforcing strong internal controls so that your site can meet its regulatory compliance requirements. This enables you to monitor business operations, and find abnormal access patterns.

Auditing can not only monitor the database activity of database users, but also nondatabase users. “Nondatabase users” refers to the typical application service accounts and they are identified in the database using the CLIENT_IDENTIFIER attribute. To audit this type of user, you can use either unified audit or fine-grained audit policy, or Oracle Database Real Application Security.

Best Practices for Auditing

You should follow best practices guidelines for auditing.

Related Topics

Unified Auditing and Its Benefits

Unified auditing was introduced in Oracle Database 12c with significant enhancements to auditing functionality.

Unified auditing enables you to capture audit records from the following sources, and writes the audit records into a single consolidated unified audit trail:

The unified audit trail table AUD$UNIFIED is a specialized table in the AUDSYS schema in the SYSAUX tablespace which allows only INSERT activity. Any attempt to directly truncate, delete or update contents of the AUD$UNIFIED table fail, and generate audit records. Audit data is managed using the built-in audit data management DBMS_AUDIT_MGMT package. The audit data is made available in a uniform format in the UNIFIED_AUDIT_TRAIL data dictionary view for the end user. The unified audit trail also normalizes the audit record format, using standardized column names and data types across all audit sources. The consolidated, normalized unified audit trail simplifies collection, analysis, and management of audit records generated by different audit sources. Consistent formatting simplifies reporting and analysis of the audit data.

Unified auditing offers a high degree of integrity of audit trail by not allowing users to tamper with the audit trail. The unified audit trail is stored in the AUDSYS schema and no one is allowed to log in to that schema in the database. AUD$UNIFIED is a specialized table which allows only INSERT activity. Any attempt to directly truncate, delete or update contents of the AUD$UNIFIED table fail, and will generate audit records. You can use the the built-in audit data management DBMS_AUDIT_MGMT package to manage audit data. Additionally, you can encrypt the audit tablespace with Transparent Data Encryption (TDE). You can protect the unified audit table with an Oracle Database Vault realm.

With unified auditing, audit configuration is much simpler and focused for your needs. You can create named audit policies once and enforce them in multiple dimensions (for example, on users and roles), giving you a lot more flexibility and simplicity. You can selectively audit to capture relevant activity with unified audit. Audit conditions can be based on application contexts, session contexts, and built-in functions. The ONLY TOPLEVEL clause of the CREATE AUDIT POLICY statement helps audit only the SQL statements that are directly issued by an end user, thus focusing only on end-user-initiated actions on sensitive tables. Such configuration flexibility in unified audit helps fine-tune audit policies to collect audit data that is targeted to your needs.

Unified auditing provides different roles for separation of duties to manage and view the audit data: AUDIT_ADMIN and AUDIT_VIEWER.

For typical use cases of auditing privileged users or auditing key database operations with unified auditing, the performance impact is so low that it cannot even be measured due to low audit volume spread throughout the week. You could begin to see performance impact of 1 percent when the audit load increases to a few hundred audit events per second. For most use cases, you are not going to see overhead beyond this, but for cases where organizations want to audit application usage, it is best to tune the audit policies. Internal performance tests using a TPC-C mixed application workload show that with unified audit, you may see a CPU overhead in mid-single digit when auditing up to 360,000 audit records/hour. For extreme audit loads up to 1,800,000 audit records per hour, the additional overhead is still in a single digit. Note: 1. When the database is writeable, audit records are written to the unified audit trail. If the database is not writable (typically occurs when the database is closed or is read-only as in Oracle Data GuardADG), the Oracle Database writes audit records to external operating system spillover .BIN files in the $ORACLE_BASE/audit/$ORACLE_SID directory. The audit data present in the .BIN files is also surfaced in the UNIFIED_AUDIT_TRAIL data dictionary view.

Related Topics

Who Can Perform Auditing?

Oracle provides two roles for users who perform auditing: AUDIT_ADMIN and AUDIT_VIEWER, to enable separation of duties.

The privileges that these roles provide are as follows:

Related Topics

Handling the Desupport of Traditional Auditing

Traditional auditing is desupported, starting in Oracle AI Database 26ai. Oracle recommends that you use unified auditing instead.

If you used traditional auditing in previous releases, when you upgrade to Oracle AI Database 26ai, the existing traditional audit settings will continue to be honored and audit records will continue to be generated into their respective audit trails. However, you cannot create new traditional audit settings or update existing traditional audit settings. You can only delete the existing traditional audit settings.

Oracle strongly recommends that you transition from traditional audit configurations to unified audit policies as soon as possible. In most cases, the transition is simple. Oracle AI Database has always-on mandatory audits to ensure security-sensitive database activities are always audited. Oracle AI Database also provides a set of predefined unified audit policies to help you get started. If you have upgraded your Oracle AI Database installation from release 11g, then at a minimum, you should enable the following predefined policies, which address the most common security and compliance needs

All new Oracle Databases, created from release 12.2 and later, have the ORA_SECURECONFIG pre-defined unified audit policy enabled by default. Starting in release 26ai, the ORA_LOGIN_LOGOUT pre-defined unified audit policy is available and enabled by default. During database upgrades, these predefined unified audit policies are not enabled.

If you have highly customized traditional audit settings, then you have the following choices to transition them to unified audit policies:

After you have completed converting your traditional audit settings to unified audit policies, then carefully examine this generated script before you execute it to enable the unified audit policies and remove the existing traditional audit configurations.

For additional information about unified audit best practices, see the Oracle technical report Oracle Database Unified Audit: Best Practice Guidelines. Note: Unified auditing does not depend on the initialization parameters that were used by traditional auditing. See the Feature column in Considerations for Transitioning from Traditional to Unified Auditing for a list of these initialization parameters.

Related Topics

Unified Auditing in a Multitenant Environment

You can apply audit settings to individual PDBs or to the CDB, depending on the type of policy.

Each PDB, including the root, has its own unified audit trail.

Related Topics

Auditing in a Distributed Database

Auditing is site autonomous in that a database instance audits only the statements issued by directly connected users.

A local Oracle Database node cannot audit actions that take place in a remote database.