The audit mechanism of OceanBase AI Database implements auditing for specific events through a series of filters. Filters can be applied based on dimensions such as account, event type, and event attribute. For each filter, you can choose whether to audit the filtered events.
Audit functions
Note
You can set a default filter that applies to all users who have not explicitly configured one.
The following table describes the audit functions (expressions) supported by the current version of OceanBase AI Database.
Function Name |
Description |
|---|---|
| AUDIT_LOG_FILTER_SET_FILTER | Creates a filter. |
| AUDIT_LOG_FILTER_SET_USER | Used to set filters on a user. |
| AUDIT_LOG_FILTER_REMOVE_USER | Removes a filter from the user. |
| AUDIT_LOG_FILTER_REMOVE_FILTER | Deletes a filter. |
Limitations and considerations
An expression must be placed directly and uniquely in the output column (i.e., select item) of a
SELECTstatement, with no restrictions on parent expressions.Expressions cannot be written in subqueries.
After a filter is defined, it must be applied to a user for it to take effect.
Filters and users have a many-to-one relationship. That is, one filter can be applied to multiple users, but a user can only have one filter.
The audit filter used by the current session is determined when the connection is established and remains unchanged throughout the session lifecycle.
- Calling
AUDIT_LOG_FILTER_SET_USERandAUDIT_LOG_FILTER_REMOVE_USERto modify the binding relationship between a filter and a user does not affect currently connected sessions. - Modifying the definition of a filter or deleting a filter affects connected sessions.
- Calling
AUDIT_LOG_FILTER_REMOVE_FILTERwill cascade and delete all audit user (Audit User) binding relationships for this filter, and operations performed by the corresponding users will no longer be audited.