# The Thrifty DBA Does Database Security

- URL: https://www.integrigy.com/security-resources/thrifty-dba-does-database-security
- Published: 2017-05-12
- Type: Webinar
- Products: Oracle Database
- Focus areas: Auditing, Encryption
- Audience: DBA
- Applies to: DB 11g, DB 12c
- PDF: https://www.integrigy.com/sites/default/files/Integrigy%20Thrifty%20DBA%20Does%20Database%20Security.pdf
- Recording: https://www.youtube.com/watch?v=D7mfs8SyOoA

> Webinar showing low-cost and free ways to handle Oracle Database auditing, Virtual Private Database, encryption, and data masking and redaction, from the Thrifty DBA series.

Securing an Oracle database properly takes significant effort and often expensive security add-on products. The Thrifty DBA likes secure databases but doesn't like spending money on expensive security products when equivalent free or low-cost solutions are available.

We show thrifty yet effective ways to meet the requirements for database auditing, Virtual Private Database (VPD), encryption, and data masking and redaction, using features included with Oracle Database Enterprise Edition and free tools instead of add-on options and commercial products. DBAs can then meet many of these requirements without new license costs. The Thrifty DBA is a trademark of Integrigy Corporation.

## Key Points

- Start the audit design from the 14 security events in our [Integrigy Guide to Database Auditing and Logging](https://www.integrigy.com/security-resources/integrigy-guide-database-auditing-and-logging) and send the audit trail to a free logging solution such as Splunk Free, ELK or Graylog, for example by syslog with `AUDIT_SYSLOG_LEVEL` and `AUDIT_TRAIL=OS`, traditional auditing settings which Oracle desupported in 23ai (now 26ai) in favor of Unified Auditing.
- To tie audit records to people, EBS R12 sets `CLIENT_IDENTIFIER` to the logged-on `FND_USER.USERNAME` and PeopleTools 8.50 and later set it to the `PSOPRID`, and DBAs can record a change ticket in `CLIENT_ID` with `SELECT sys.ticket(1234) FROM dual`, so auditors can sample changes by ticket and treat one without a ticket as a policy violation.
- Virtual Private Database (VPD), included with Enterprise Edition, can keep ad-hoc users from data such as Social Security numbers without Database Vault: a policy added with `DBMS_RLS.ADD_POLICY` appends a predicate such as `WHERE org_id = 1` to each query or, with `sec_relevant_cols` and `sec_relevant_cols_opt` set to `DBMS_RLS.ALL_ROWS`, returns nulls for a column such as `NATIONAL_IDENTIFIER`.
- For data in use, encrypt sensitive columns with `DBMS_CRYPTO` and AES, called by the application or through views and triggers, never hard-coding keys in a wrapped PL/SQL package or table but keeping them in a hardware security module or a key management server such as Vault by HashiCorp (free); `DBMS_OBFUSCATION_TOOLKIT` is deprecated.
- SQL*Net encryption, formerly part of the Advanced Security Option and now included with Enterprise Edition, stays off while client and server keep the default `ACCEPTED`, so set `SQLNET.ENCRYPTION_SERVER` to `requested` or `required` in the server's `sqlnet.ora`, check which sessions use it in `v$session_connect_info`, and review the algorithms, since weak ones are still supported.
- To mask test and development data, a simple SQL script usually suffices, or the free Standard Edition of Solix's data masking, and to redact columns, use views or VPD policies that return nulls, with Transparent Sensitive Data Protection (TSDP), new in 12.1 and included with Enterprise Edition, keeping an inventory of sensitive data.
