TencentDB for MongoDB provides database audit capabilities to record database access and SQL statement execution, helping enterprises control risks and improving the data security level.
Note:
Enabling audit may cause certain performance losses to the instance.
Prerequisites
The status of the replica set instance or sharded instance of TencentDB for MongoDB is Running.
Directions
2. In the left sidebar, select MongoDB > Database Audit.
3. At the top of the Database Audit page on the right, select Region.
4. In the upper right corner of the audit instance list, select an instance with Audit Status being Disabled.
5. Click the search box to search the target instance in the drop-down list by Instance ID, Instance Name, Tag Key, or Tag.
6. Click the target instance name to enter the Audit Log configuration guide.
7. On the Activate Audit Service configuration guide tab, learn about the audit billing instructions.
8. Select I agree to the Tencent Cloud Terms of Service and click Next.
9. On the Configure Audit configuration guide tab, select the audit Log Retention Period, and confirm the required fees next to Storage Fees.
Note:
You can select an audit log retention period of 7 days, 30 days, 3 months, 6 months, 1 year, 3 years, or 5 years. After enabling, you can also modify the retention period in the console, see Modifying the Retention Period of Audit Logs. To meet the security compliance requirements for the retention period of audit logs, it is recommended that you select a retention period of 180 days or more. 10. Click Next. On the Audit Rule Settings configuration guide tab, select the audit rule method next to Audit Rule.
11. You can select Full Audit or Rule-Based Audit based on requirements, and the default method is Full Audit.
Full Audit: audits all statements after it is enabled.
Rule-Based Audit: audits database statements based on configured audit items after it is enabled. Audit items that can be configured include SQL type, database name, collection name, client IP address, and username. Separate multiple items with commas, as shown in the figure below.
Note:
Separate multiple database names, collection names, client IP addresses, and usernames with commas.
Up to 5 database names, 5 collection names, 5 client IP addresses, and 5 usernames can be configured.
12. Click Create a Policy, and the audit service can be used after it is successfully enabled.
More Operations
After enabling the audit service, you can analyze database audit logs at any time to perform risk control. For detailed operations, see Viewing Audit Logs. The business scenarios are constantly changing, and it is necessary to adjust audit rules promptly to ensure efficient, accurate, and compliant regulation of databases. For detailed operations, see Modifying Audit Rules.