Help & Documentation>TencentDB for MariaDB

Enabling Database Audit

Last updated: 2024-05-15 10:39:52

TencentDB for MariaDB has database audit capability, which can record accesses to databases and executions of SQL statements to help you manage risks and improve the database security.
Note
The database audit feature is currently available upon request. To use it, please submit a ticket for application.

Enabling SQL Audit

1. Log in to the MariaDB Console, select Database Audit from the left sidebar, and choose a region at the top. On the Audit Instance tab, click Not Enabled to filter instances without audit enabled.


Note
Alternatively, on the Audit Log tab, search for instances that have not been enabled and enable them directly.


2. On the Audit Instance tab, click the instance ID for which you want to enable auditing to enter the activation page. Check the box to agree to the terms and conditions, and click Next.
3. On the SQL Audit Service Settings page, select the audit retention period and click Enable.
Note
The audit log retention period can be set to 7 days, 30 days, 3 months, 6 months, 1 year, 3 years, or 5 years. After enabling the service, you can modify the retention period in the console. For more information, see Modify Log Retention Period.
In order to meet the security compliance requirements for the retention period of SQL logs, we recommend you select 180 days or above.

Viewing Audit Log

After enabling the audit, you can view the corresponding SQL audit logs on the Audit Log tab. For more information, see Viewing Audit Logs.