Data Audit for Third-Party Cloud Platforms and On-Premises IDCs
For enterprises with self-built data assets on third-party cloud platforms and on-premises Internet Data Centers (IDCs), Huawei Cloud DSC can be used for unified management. This section describes how to configure DSC in cross-cloud scenarios to audit databases in other clouds.
How It Works
Enterprise data is stored on Huawei Cloud, third-party cloud platforms, and on-premises IDCs. Databases in third-party cloud platforms and local IDCs can be imported to DSC as user-built data assets for unified management. With a VPN, Huawei Cloud is connected to other clouds, and DSC scans databases on other clouds.

To import databases on third-party cloud platforms and on-premises IDCs to DSC and enable data audit, perform the following steps:
- Create a VPC: Third-party cloud platforms and on-premises IDCs need to access DSC through a VPC.
- Connect the network: To audit databases on third-party cloud platforms and on-premises IDCs, you need to connect the third-party cloud platforms or on-premises IDCs to the VPC via VPN gateways or Direct Connect (DC).
- Connect to DSC: Import databases on third-party cloud platforms and on-premises IDCs to DSC as user-built data assets.
- Configure access control policies: Configure security group policies for the data audit port. Ensure that the traffic collection function is normal.
- Enable database audit: Connect DSC to the VPC and install the agent to collect traffic.
- Verify the audit effect: View the audit logs on the console.
Prerequisites
You have purchased DSC.
Procedure
Step 1: Create a VPC on Huawei Cloud
You can create a VPC and use multiple Huawei Cloud network products to ensure security and stability. Third-party cloud platforms or local data center resources can be efficiently expanded and interconnected with Huawei Cloud.
- Go to the Create VPC page.
- Click Create VPC, and configure parameters for the VPC and subnet as prompted.
- Region: Select the region where you want to create cloud resources.
- IPv4 CIDR Block: Avoid IP address conflicts if you need to connect a VPC to an on-premises data center or connect two VPCs.
- You are advised to use the private IPv4 address ranges specified in RFC 1918 as the CIDR block.
- Do not use 100.64.0.0/10, 214.0.0.0/4, 198.18.0.0/15, 169.254.0.0/16, 0.0.0.0/8, 127.0.0.0/8, or 240.0.0.0/4.
- IPv4 CIDR Block under Subnet: A subnet mask can be between the netmask of its VPC CIDR block and the /29 netmask. If a VPC CIDR block is 10.0.0.0/16, its subnet mask can range from 16 to 29. For details about VPC subnet planning, see VPC Network Planning Suggestions.
- Set other parameters as prompted. For details, see Creating a VPC with a Subnet.
Step 2: Connect the Network
Connect the network via VPN gateway, DC, or Cloud Connect (CC) by referring to the references in the following table.
| Network Connection Mode | Scenario | Reference |
|---|---|---|
| VPN gateway | Used for users who are sensitive to costs and can tolerate certain network latency, especially enterprises that require fast deployment and flexible adjustment. | Configuring S2C Enterprise Edition VPN to Connect an On-premises Data Center to a VPC |
| DC | Used for medium- and large-sized enterprises that have high requirements on network quality and can afford high costs, especially industries that have strict requirements on data transmission stability, such as finance and healthcare. | |
| CC | Used for enterprises that require cross-region and cross-account VPC communication and efficient interconnection with local IDCs, especially those that have multiple data centers and want to simplify network management. | Connecting Multiple VPCs in Different Regions to On-Premises Data Centers |
Step 3: Add User-Built Databases on DSC
- Log in to the DSC console.
- Click
in the upper left corner and select a region or project. - In the navigation pane on the left, choose .
- Click User-built databases under Database. The Databases tab is displayed.
- Click the Database Instances tab.
- Click add in the upper left corner. Set related parameters based on Table 1 and click OK to add a user-built database instance. Figure 1 Adding a database instance

Table 1 Configuring database instance information Parameter
Description
Region
By default, it is the region selected in the upper left corner of the console.
Organization Member Account
This parameter is displayed if you have added an organization member to DSC based on multi-account management. Click to select an account and view its information.
ECS
Select the ECS of the user-built database instance from the drop-down list.
Security Group
Select a security group from the drop-down list.
Database Engine
Select the engine of the user-built database from the drop-down list.
Version
Select a database engine version from the drop-down list.
Connection Method
This parameter is displayed when Database Engine is set to Oracle. Select a connection mode from the drop-down list.
- Service Name: Enter the service name.
- SID: Enter the SID.
Schema
Enter the database schema name when Database Engine is set to DMDBMS.
Database Server Address
Select a server address from the drop-down list.
In cluster deployment mode, set this parameter to the IP address of the primary node if data masking is required.
Port
Enter an integer ranging from 0 to 65535.
Database
Enter a database name.
Username/Password
Enter the username and password of the database.
Asset
Enter 4 to 255 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. The value must start with a letter.
Creating a metadata drawing task
Databases of a metadata task are supported. After this function is enabled, metadata tasks are automatically delivered based on the default database of the instance to obtain the database, table, and column information of the instance.
If Database Engine is set to SQL Server, Oracle, MongoDB, or GaussDB, metadata drawing tasks cannot be created.
Step 4: Configure a Security Group Access Control Policy
Add a new agent or choose an existing agent for the database to be audited, depending on your database type. The agent will obtain database access traffic, upload traffic statistics to the audit system, receive audit system configuration commands, and report database monitoring data.
After the agent is added, you need to 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.
- Add an agent.
- Download and install the agent.
- In the navigation pane on the left, choose Databases.
- In the Instance drop-down list, select the instance whose security group rule is to be added.
- Record the IP address of the agent node.
Locate the target database and click View Agent in the Agent column. In the Agents area, record the value in the Installing Node IP Address column.
Figure 2 Installing node IP address
- Click Add Security Group Rule.
- In the displayed dialog box, record the security group name (for example, default) of the database audit instance.
- Click Go to VPC.
- In the search box above the list, select an attribute or enter a keyword to search for a security group. Then, click the security group name.
- Click the Inbound Rules tab.
Check whether TCP (port number 8000) and UDP protocols (port number from 7000 to 7100) are configured in the inbound rules of the security group for the IP address of the installing node.
- If the inbound rules of the security group have been configured for the installing node, go to Step 5: Enable Database Audit.
- If no inbound rules of the security group have been configured for the installing node, go to 11.
- Add an inbound rule for the installing node.
- On the Inbound Rules tab, click Add Rule. Figure 3 Adding rules
- In the Add Inbound Rule dialog box, add TCP (port number 8000) and UDP protocols (port number from 7000 to 7100).
The source can be an IP address, an IP address segment, or a security group. Examples:
- IP address: 192.168.10.10/32
- IP address segment: 192.168.52.0/24
- All IP addresses: 0.0.0.0/0
- Security group: sg-abc
Figure 4 Add Inbound Rule dialog box
- Click OK.
- On the Inbound Rules tab, click Add Rule.
Step 5: Enable Database Audit
By default, database audit complies with a full audit rule, which is used to audit all databases that are connected to the database audit instance. You can enable audit and check audit results.
- Log in to the DSC console.
- Click
in the upper left corner and select a region or project. - In the navigation pane on the left, choose .
- In the navigation pane on the left, choose Databases.
- Select a database audit instance from the Instance drop-down list.
- In the database list, click Enable in the Operation column of the database you want to audit.
The Audit Status of the database is Enabled. You do not need to restart the database.
Step 6: Verify the Audit Effect on the DBSS Page
- Run an SQL statement (for example, show databases) in the target database.
- In the navigation tree on the left, choose Data Reports.
- In the Instance drop-down list, select the instance that audits the target database.
- Click the Statements tab.
- Expand the drop-down list and select All time, Last 30 minutes, 1 hour, Today, 7 days, 30 days, or set a custom time range. Click the search box, select a filter, or enter a keyword.
- If the SQL statement is displayed in the SQL statements, the audit is successful.
- If the SQL statement is not displayed in the SQL statements, the network communication between the agent and the database audit instance is abnormal. For details, see What Do I Do If the Communication Between the Agent and Database Audit Instance Is Abnormal?
Figure 5 Viewing SQL statements
Table 2 SQL statement parameters Parameter
Description
SQL Statements
Entire SQL statement.
Client IP Address
IP address of the client where an SQL statement is executed
Database IP Address/Domain Name
IP address or the domain name of the database where an SQL statement is executed
Database User
Database user for executing an SQL statement
Name
Database name for executing an SQL statement
Risk Level
Risk level of executing an SQL statement.
- High
- Medium
- Low
- No risk
Rule
Name of the rule for executing an SQL statement.
Operation Type
Type of an SQL statement operation
Result
Response to an SQL statement
Generated
Time when an SQL statement is generated
Operation
Operations that can be performed on SQL statements
- Add to Whitelist: Add an SQL statement to the whitelist.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot