top of page

Unified Audit Policies for Administrators and SYS: What Auditors Actually Ask For

OmerNarman
Aug 19
3 min read

Updated: Oct 24

Fine-grained auditing watches the data. Unified audit policies watch the people who can do anything: administrators, service accounts with wide privileges, and SYS. An auditor asking for evidence of what the DBAs did last quarter is asking for these policies, and the defaults do not answer the question on their own.


The use case

A regulated organisation needs a complete record of privileged activity: who connected as an administrator and when, every change to users and grants, every DDL statement against the application schema, and any change to the audit configuration itself. The record must be readable by the security team without help from the DBAs it describes, and it must be kept for a defined period.


Start from what is already on

SQL

SELECT value FROM v$option WHERE parameter = 'Unified Auditing';

SELECT policy_name, enabled_option, entity_name, success, failure

FROM audit_unified_enabled_policies

ORDER BY policy_name;


On a current release two Oracle-supplied policies are usually enabled: ORA_SECURECONFIG, a baseline of security-relevant actions, and ORA_LOGON_FAILURES. They are a floor, not a programme. The policies below add what auditors actually ask for.


Step 1: privileged connections

SQL

CREATE AUDIT POLICY priv_logon_pol

ACTIONS LOGON, LOGOFF;

-- Apply to SYS, the system account and every holder of the DBA role

AUDIT POLICY priv_logon_pol BY SYS, SYSTEM;

AUDIT POLICY priv_logon_pol BY USERS WITH GRANTED ROLES DBA;


BY USERS WITH GRANTED ROLES, available from 12.2, applies the policy to whoever holds the DBA role now and in the future, so a new administrator is covered the day the role is granted.


Step 2: changes to users, privileges and the system

SQL

CREATE AUDIT POLICY admin_change_pol

ACTIONS CREATE USER, ALTER USER, DROP USER,

CREATE ROLE, ALTER ROLE, DROP ROLE,

GRANT, REVOKE,

ALTER SYSTEM, ALTER DATABASE

ONLY TOPLEVEL;

AUDIT POLICY admin_change_pol;


ONLY TOPLEVEL records the statements a person actually issued and skips the recursive SQL Oracle runs underneath them, which keeps the trail readable. Applying the policy without BY makes it apply to every user, which is right for this category: nobody should be changing grants unaudited.


Step 3: DDL and data access on the application schema by administrators

SQL

CREATE AUDIT POLICY app_schema_by_dba_pol

ACTIONS CREATE TABLE, ALTER TABLE, DROP TABLE, TRUNCATE TABLE,

CREATE PROCEDURE, ALTER PROCEDURE, DROP PROCEDURE,

SELECT ON app.customers,

SELECT ON app.payments,

DELETE ON app.customers

ONLY TOPLEVEL;

AUDIT POLICY app_schema_by_dba_pol BY USERS WITH GRANTED ROLES DBA;


Note the split: DDL on the schema and reads of the two sensitive tables are audited for administrators, while the application account carries on unaudited. If the application account should be watched as well, that is the fine-grained auditing policy from the previous article, not this one.


Step 4: changes to auditing itself

SQL

CREATE AUDIT POLICY audit_config_pol

ACTIONS AUDIT, NOAUDIT,

CREATE AUDIT POLICY, ALTER AUDIT POLICY, DROP AUDIT POLICY;

AUDIT POLICY audit_config_pol;


Anyone who can switch auditing off is exactly who needs to be on record for doing so. This policy applies to everyone, SYS included.


Step 5: read the trail without the DBAs

SQL

-- Give the security team read access and nothing more

GRANT AUDIT_VIEWER TO sec_reader;

SELECT event_timestamp, dbusername, os_username, client_program_name,

action_name, object_schema, object_name, unified_audit_policies,

return_code, sql_text

FROM unified_audit_trail

WHERE unified_audit_policies LIKE '%ADMIN_CHANGE_POL%'

AND event_timestamp > SYSTIMESTAMP - INTERVAL '7' DAY

ORDER BY event_timestamp DESC;


return_code deserves a column of its own: a non-zero value is a failed attempt, and failed attempts by privileged accounts are the first thing an investigator wants to see.


Step 6: retention and export

  • Move the audit trail to its own tablespace with DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION so growth never threatens SYSAUX.

  • Set the retention point with DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP after each export, and schedule DBMS_AUDIT_MGMT.CREATE_PURGE_JOB so only exported records are purged.

  • Export new records daily to a store the DBAs cannot write to: a SIEM, Oracle Data Safe, or an object-storage bucket with a retention rule.


On OCI, AWS, Azure and Google Cloud

  • Autonomous Database runs with unified auditing on and lets you create policies as above, but keeps audit records in the database only for a short fixed window; route them to Data Safe or your SIEM from day one.

  • Base Database, Exadata services, Oracle Database@Azure and Oracle Database@Google Cloud behave like on-premises databases for everything in this article.

  • Amazon RDS for Oracle supports unified auditing and the same views; purge and location changes go through RDS-provided procedures rather than DBMS_AUDIT_MGMT directly, so check the current RDS documentation for the supported calls.

  • Whatever the platform, apply the same four policies from version control. An auditor who sees one standard across four clouds asks far fewer questions.


Soro Consulting designs audit programmes for Oracle estates that satisfy auditors without drowning the DBAs. Book a consultation to talk it through.

Recent Posts

See All

Comments


bottom of page