Database audit is deployed in out-of-path mode. The database audit agent is deployed on the database or application server to obtain access traffic, upload traffic data to the audit system, receive audit system configuration commands, and report database monitoring results, implementing security audit on databases built on ECS or BMS.
Figure 1 shows the architecture used for auditing a self-built database on ECS and BMS. Figure 1 Auditing user-built databases on ECS and BMS
Assume you have created a database on Elastic Cloud Server (ECS). Table 1 describes its details. You need to locate and track internal violations and improper operations in the database to meet compliance requirements. This section describes how to install an agent on the database, enable the database audit function, and check audit results.
Database Type | MySQL |
|---|---|
Database Version | 5.7 |
IP Address | 192.168.1.5 |
Port | 3306 |
OS | LINUX64 |
Configure and apply for the database audit service. For details, see Database Security Service User Guide
After applying for database audit, add the example database to the database audit instance and enable the database audit function for the database.
and choose . The Dashboard page is displayed.Figure 2 Add Database dialog box

Figure 3 Adding an agent

Figure 4 Adding an agent to a database

Configure TCP (port 8000) and UDP (ports 7000 to 7100) in the security group inbound rule of the database audit instance to allow the agent to communicate with the audit instance. You can also add security group rules after the agent is installed.
Figure 5 Adding a security group rule

or press Enter. The group information is displayed in the list.Figure 6 Adding rules

Figure 7 Add Inbound Rule dialog box (ECS)

Download the agent package and install it on the required node. A database can be audited only after it is connected to a database audit instance. Each agent has a unique ID, which is used as the key for connecting to a database audit instance. If you delete an agent and add it back, you need to download and install the agent again.
The agent installation package will be downloaded. Figure 8 Downloading an agent
cd Agent_installation_package_directory
tar -xvf xxx.tar
cd install.sh_script_directory
sh install.sh
If the following information is displayed, the agent has been installed:
12345start agentstarting audit agentaudit agent startedstart successinstall dbss audit agent done!
Check to ensure the communication between the agent and the database audit instance is normal.
You can check audit results on the Dashboard page, or generate, preview, or download reports.
In the navigation pane, choose Dashboard.
The Dashboard page displays the audit duration, total number of SQL statements and risks, statements and risks today, and today's sessions of an instance.
In the navigation tree on the left, choose Data Reports. You can click the Statements or Sessions tab to view the SQL statement information and session distribution chart.
to set the start time and end time of the report, and select the database for which you want to generate a report.The Reports page will be displayed. You can view the report status on this page. After a report is generated, you can choose .
To preview a report online, use Google Chrome or Mozilla FireFox.
Figure 9 Previewing or downloading an audit report
