هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Database Security Service/ Best Practices/ Auditing a User-built Database on ECS

Auditing a User-built Database on ECS

Updated on 2023-06-16 GMT+08:00

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.

The following figure shows the architecture used for auditing a user-built database on ECS or BMS.
Figure 1 Auditing user-built databases on ECS and BMS

Scenario

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.

Table 1 ECS database information

Database Type

MySQL

Database Version

5.7

IP Address

192.168.1.5

Port

3306

OS

LINUX64

Limitations and Constraints

  • Disable SSL for a database before auditing it.
  • The database audit instance and the database to be audited must be in the same region.
  • For connection purposes, ensure the VPC of the database audit instance is the same as that of the agent node.

    For details about how to choose the node, see How Do I Determine Where to Install an Agent?

Step 1: Purchase Database Audit

Configure and purchase the database audit service. For details, see Purchasing Database Audit.

NOTE:

For connection purposes, ensure the VPC of the database audit instance is the same as that of the agent node.

For details about how to choose the node, see How Do I Determine Where to Install an Agent?

Step 2: Add a Database and Enable Audit

After purchasing database audit, add the example database to the database audit instance and enable the database audit function for the database.

  1. Log in to the management console.
  2. Select a region, click , and choose Security & Compliance > Database Security Service. The Dashboard page is displayed.
  3. In the navigation pane, choose Databases.
  4. Select an instance from the Instance drop-down list. Click Add Database.
  5. In the displayed dialog box, set database parameters described in Table 1, as shown in Figure 2.

    Figure 2 Add Database dialog box

  6. Click OK. The database will be displayed in the database list and its Audit Status will be Disabled.
  7. In the Operation column of the database, click Enable.

Step 3: Add an Agent

  1. In the Agent column of the database, click Add, as shown in Figure 3.

    Figure 3 Adding an agent

  2. In the displayed dialog box, select an addition mode.

    Figure 4 Adding an agent to a database

  3. Click OK.

Step 4: Add a Security Group Rule

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.
  • If the inbound rules of the security group have been configured for the installing node, go to Step 5: Install an Agent.
  • If no inbound rules have been configured, perform the following operations.
    NOTE:

    You can configure security group rules before or after installing an agent.

  1. Obtain the IP address of the installation node.
  2. On the Databases page, click Add Security Group Rule.
  3. In the dialog box that is displayed, check and make a note of the security group of the database audit instance, for example, default.

    Figure 5 Adding a security group rule

  4. Click Go to VPC. The Security Groups page will be displayed.
  5. Enter the security group name default in the search box in the upper right corner of the list, and click or press Enter. The group information is displayed in the list.
  6. Click default. The Summary tab will be displayed.
  7. On the Inbound Rules tab, click Add Rule.
  8. In the Add Inbound Rule dialog box, add TCP (port number 8000) and UDP protocols (port number from 7000 to 7100) for the installing node IP address.
  9. Click OK.

Step 5: Install an Agent

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.
NOTE:

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.

  1. Log in to the DBSS management console.
  2. In the navigation pane, choose Databases.
  3. In the Instance drop-down list, select an instance.
  4. Click next to the instance to expand agent details. In the Operation column, click Download Agent. See Figure 6.

    The agent installation package will be downloaded to your local PC.
    Figure 6 Downloading an agent

  5. Use a cross-platform transmission tool (for example, WinSCP) to upload the downloaded agent installation package xxx.tar to the node specified by Installing Node IP Address in Figure 6.
  6. Log in to the node as user root by using a cross-platform remote access tool (for example, PuTTY) via SSH.
  7. Run the following command to access the directory where the agent installation package xxx.tar is stored:
  8. cd Agent_installation_package_directory
  9. Run the following command to decompress the installation package xxx.tar:
  10. tar -xvf xxx.tar
  11. Run the following command to go to the directory in which the install.sh script is stored:
  12. cd install.sh_script_directory
  13. Run the following command to install the agent:
  14. sh install.sh
  15. If the following information is displayed, the agent has been installed successfully:

    1
    2
    3
    4
    5
    start agent
    starting audit agent
    audit agent started
    start success
    install dbss audit agent done!
    

Step 6: Verify the Communication Between the Agent and the Database Audit Instance

Check to ensure the communication between the agent and the database audit instance is normal.

  1. Run an SQL statement or perform an operation on the database (for example, Select 1;) on the node where the agent is installed.
  2. In the navigation pane, choose Dashboard.
  3. In the Instance drop-down list, select the instance whose slow SQL statement information you want to view.
  4. Click the Statements tab.
  5. The SQL statement list displays the record of database login.

    If no SQL statement is displayed, check your network connection. For details, see What Should I Do If the Communication Between the Agent and Database Audit Instance Is Abnormal?

Step 7: View Audit Results

You can check audit results on the Dashboard page, or generate, preview, or download reports.

  1. Check overview information.

    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.

    You can click the Statements or Sessions tab to view session distribution.

  2. Generate, download, or preview reports.

    1. In the navigation pane, choose Reports.
    2. Select an instance from the Instance drop-down list. Click the Report Management tab.
    3. In the Operation column of a report template, click Generate Report.
    4. In the displayed dialog box, click to set the start time and end time of the report, and select the database for which you want to generate a report.
    5. Click OK.

      See Figure 7.

      NOTICE:

      To preview a report online, use Google Chrome or Mozilla FireFox.

      Figure 7 Previewing or downloading an audit report

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback