Data Security Center (DSC) provides a data audit feature that analyzes audit logs to help you track malicious activity, identify unauthorized access, and investigate security incidents. To use the data audit feature, you must configure an audit mode. DSC then collects audit logs from the relevant databases according to the configured mode. This topic explains how to configure auditing.
Prerequisites
You have activated the Free Edition of Data Security Center or purchased an Enterprise instance of Data Security Center.For more information, see Free Edition of Data Security Center or Purchase Data Security Center.
You have authorized data assets. For more information, see Asset authorization.
To enable the data audit feature for an ApsaraDB for OceanBase instance, you must first enable SQL Audit for a target tenant in the OceanBase instance. For more information, see SQL Audit.
ImportantYou can enable the audit mode for a target OceanBase instance as described in this document only after you enable SQL Audit for the target tenant in that instance. After you successfully enable the audit mode, the data audit service becomes available for all databases that belong to tenants with SQL Audit enabled in the OceanBase instance.
Background
The audit mode for a newly authorized instance is disabled by default. You must enable and configure an audit mode for your database assets. DSC then collects operation logs for the corresponding data assets and stores them as audit logs. Based on these audit logs and audit alert rules, DSC detects risks such as data breaches, vulnerability attacks, and SQL injection, and reports alerts.
Audit modes
DSC supports two audit modes: native log collection and traffic collection (agent). You can select the appropriate audit mode based on your actual situation.
Use the native log collection audit mode for native databases and the traffic collection (agent) audit mode for self-managed databases.
Audit mode comparison
Audit mode | Data asset types | Mechanism | Features |
native log collection |
| Data Security Center (DSC) automatically establishes a data collection link with the corresponding product to collect logs. The logs record all DQL, DML, and DDL operations. The database kernel outputs this information with minimal impact on CPU consumption. For more information, see the FAQ section in this topic. Warning In this audit mode, cloud products prioritize business operations over auditing. This may cause a small number of logs to be lost during periods of high business workload. |
|
traffic collection (agent) |
| A data collection link is established through PrivateLink. An agent is deployed on the application server or database server that accesses the database. The agent forwards log traffic to the DSC audit server to complete log collection. DSC provides a one-click Establish Network Connection feature to automatically configure PrivateLink. For more information about PrivateLink, see What is PrivateLink?. The one-click Establish Network Connection feature automatically configures PrivateLink by reading the security group and vSwitch of your ECS instance. Therefore, the vSwitch for the ECS instance where the agent is installed must be in a supported zone for the data audit service. For more information, see the Supported zones for ECS instances with traffic collection agents section in this topic. The one-click network connection feature works as follows:
Important
|
|
Supported zones for agents
Enable native log collection
Step 1: Grant SLS access to data assets
Native log collection requires SLS permissions to access your cloud resources.
Log on to the Data Security Center console.
In the left-side navigation pane, choose .
On the tab, click Authorize Now.
On the RAM Quick Authorization page, click Confirm Authorization.

Step 2: Enable an audit mode
On the Asset Configurations tab, select a cloud product type, such as RDS.
In the asset list, find the target asset and, in its Audit Mode column, select Cloud-native Audit Log Collection.

Enable traffic collection (agent)
A traffic collection agent captures, analyzes, and reports network traffic data for security detection, performance monitoring, or troubleshooting. It is typically deployed on network devices, servers, or virtual machines.
Install agent
Log on to the Data Security Center console.
In the left-side navigation pane, choose .
On the tab, select a cloud product type.
In the Audit Mode column for the target asset, select Traffic Collection (Agent).
In the Enable Traffic Collection (Agent) panel, configure the network and install the agent.
If an agent is already installed on a host, you do not need to install it again. You can click View Hosts With Installed Agents at the top of the panel.
Configure network: Select the region and the VPC where you want to install the agent.
If a network connection is not established for this VPC, click Establish Network Connection. In the confirmation message, click OK. After the network connection is established, click Next.
Install agent: Select automatic deployment for an Alibaba Cloud ECS instance. Select manual deployment for a server outside of Alibaba Cloud.
Automatic deployment (recommended)
On the Auto-deploy Agent sub-tab, if the PrivateLink Connection Status of the target asset is not Connected, click Establish Network Connection in the Actions column of the target instance.
To perform this operation on multiple instances, select the instances and click Batch Establish Network Connection.
After the PrivateLink Connection Status changes to Connected, click Auto Install in the Actions column.
To perform this operation on multiple instances, select the instances and click Batch Auto Install.
After the installation is successful, the Agent Status of the target asset changes to Running.
NoteIf the target instance is not in the list, click Asset synchronization. After the synchronization is complete, retry the operation.
Manual Agent Deployment
On the Manual Agent Deployment sub-tab, deploy the agent by following the steps for your server's operating system.
Windows
On the Windows tab, click Download Installation Package.
The installation package downloads to your browser's default directory.
Log on to your Windows server.
Upload the downloaded agent installation package to the Windows server.
Decompress the agent installation package to a specified runtime directory and then run the installation application.
ImportantThe decompression path cannot contain special characters, including
<space>,(),[],{},^,=,;,!,',+,,,`,~, and&. If you must run the script in a directory that contains special characters, run the script from a command prompt with administrator privileges.Select Install winpcap or Install npcap, and then click Next.
If the database asset is an RDS or PolarDB instance, select Install winpcap.
If the database asset is a self-managed database and the database application and the database reside on the same ECS instance, select Install npcap. Otherwise, select Install winpcap.
Click Install and follow the prompts. Accept the default options to complete the installation.
Linux
On the Linux tab, click Download Installation Package.
The installation package downloads to your browser's default directory.
Log on to your Linux server.
Upload the downloaded agent installation package to a specified directory on the Linux server.
You can customize the directory where the agent installation package is stored.
Run the
tar -xf dbagent_linux_V2.29.tar.gzcommand to decompress the agent installation package.Replace
dbagent_linux_V2.29.tar.gzwith the actual file name of the installation package.ImportantThe decompression path cannot contain special characters, including
<space>,(),[],{},^,=,;,!,',+,,,`,~, and&. If you must run the script in a directory that contains special characters, run the script from a command prompt with administrator privileges.Go to the installation directory and run the
./install.shcommand to install and enable the agent.ImportantDo not run the binary file directly.
You must run the agent installation script as the
rootuser and specifybashas the interpreter, or leave the interpreter unspecified.The
./install.shcommand includes thestart.shoperation. You only need to run./install.sh. No further action is required.
After completing the configuration, click OK.
Other actions
Collection Configuration: After the agent is running, you can click Collection Configuration in the Actions column to configure parameters such as Collection Direction, Rows Saved, and Maximum Save Length.
Agent Configuration: The traffic collection (agent) audit mode consumes server resources such as CPU, memory, and network bandwidth. After the agent is running, click Agent Configuration in the Actions column to manage its resource use and monitoring parameters. For more information, see Manage Agents.
Manage agents
On the Asset Management tab, click the Agents tab.
View the resource consumption trend graph.
In the Actions column for the target asset, click Monitoring.
In the monitoring information dialog box, click the tab for the corresponding resource and select a time range in the upper-right corner to view its resource usage.

Configure monitoring parameters for the agent.
In the Actions column for the target asset, click Configuration.
In the Configuration panel, expand the relevant configuration items and adjust the settings according to your server's operating conditions.

Parameter
Description
Data collection protection
System protection
Process protection
Packet capture and filtering settings
Local loopback audit configuration
Other
Suspend, stop, or uninstall the agent on a target asset.
In the Actions column for the target asset, click the
icon, and then click Suspend, Stop, or Uninstall.In the dialog box that appears, review the impact of the Suspend, Stop, or Uninstall operation, and then click OK.
Suspend

Stop

Uninstall

Other operations
Network Management:
In the upper-right corner of the list, click Network Management.
In the Network Management panel, enable or disable the VPC network connection.
Install Agent: In the upper-right corner of the list, click Install Agent to install an agent on an asset in the target VPC. For more information, see Install Agent.
Configure audit alerts
By default, DSC provides built-in audit rules for data assets, including database audit rules, OSS audit rules, and MaxCompute audit rules. DSC also supports custom audit rules. After you enable audit alert rules, you can use audit logs to detect risks such as abnormal operations, data breaches, vulnerability attacks, and SQL injections. For more information, see Configure and enable audit alert rules.
After you enable audit alert rules, DSC reports matching behaviors as DSC audit alerts. You can use the alert information and audit logs to analyze and handle related risks. For more information, see View and handle audit alerts.
FAQ
Related documents
After you configure the audit mode for a data asset, you can view its audit logs on the Log Analysis page. For more information, see View audit logs.
Data Security Center saves audit logs for online queries to its storage space. You can view your current storage usage and manage storage rules for online and archived logs. For more information, see Manage log storage.


