Help Center> Data Security Center> User Guide> Asset Management> Asset Center> Authorizing Access to a Database Asset
Updated on 2024-04-11 GMT+08:00

Authorizing Access to a Database Asset

If your asset is a self-built database, add a self-built database instance and then authorize the database instance.

If your asset is a cloud database, authorize DSC to access the database by following the instructions provided in Authorizing Access to a Database Assets.

Prerequisites

  • DSC has been allowed to access the database assets. For details, see Allowing or Disallowing Access to Cloud Assets.
  • RDS, GaussDB(DWS), DDS, or GaussDB service has been enabled, you have assets on them, and there are available IP addresses in the corresponding subnets.
  • The Status of the database instance is Normal, and the number of security groups is 1.

Constraints

Only data sources and versions supported by DSC can be added. For details, see Table 1.

Table 1 Data sources and versions supported by DSC

Data Source

Version

MySQL

5.6, 5.7, 5.8, and 8.0

SQL Server

  • 2017_SE, 2017_EE, and 2017_WEB
  • 2016_SE, 2016_EE, and 2016_WEB
  • 2014_SE and 2014_EE
  • 2012_SE, 2012_EE, and 2012_WEB
  • 2008_R2_EE and 2008_R2_WEB

KingBase

V8

DMDBMS

7 and 8

PostgreSQL

11, 10, 9.6, 9.5, 9.4, and 9.1

TDSQL

10.3.X

Oracle

11, 12

Authorizing Access to a Database Assets

This section uses the RDS database as an example to describe how to authorize access to database assets. To authorize access to other types of database assets, click the corresponding database type.

  1. Log in to the management console.
  2. Click in the upper left corner and select a region or project.
  3. In the navigation tree on the left, click . Choose Security and Compliance > Data Security Center .
  4. In the navigation tree on the left, choose Asset Management > Asset Center. The Asset Center page is displayed.
  5. Click RDS to go to the RDS database instance list page. If you need to authorize other types of databases, click the corresponding database type. The RDS database type is just used as an example.

    Figure 1 RDS DB instances

  6. Authorization can be performed in either of the following ways:

    1. Method 1: Click Authorize in the Operation column of the database instance list, and enter the database information for authorization.
      • Grant the read-only permission: Only the sensitive data identification function can be used.
      • Grant the read and write permission: The sensitive data identification and data anonymization functions can be used.
      • After the RDS read-only permission is authorized, DSC creates an account dsc_readonly in RDS.
        • After the password of the dsc_readonly account is reset in RDS, it will not be automatically synchronized to DSC. As a result, the sensitive data identification task fails. Therefore, do not reset the password of this account.
        • If you have reset the password of dsc_readonly in RDS, delete the authorized RDS DB instance in DSC and re-authorize the instance.
      • DSC cannot scan and mask sensitive data in MySQL databases which SSL has been enabled for on the RDS DB instance.
      Figure 2 Authorizing access to databases
    2. Method 2: Click an instance name to go to the instance details page. In the Operation column, click Authorize to authorize access to the database.
      Figure 3 Instance details

  7. After the authorization is complete, click the Databases tab to view the connection status of the authorized database.

    Figure 4 Connection status
    After the asset authorization is complete, the Connection Status of the asset is Checking, which means DSC is checking the database connectivity.
    • DSC can access the added database normally if the Connection Status of the database is Succeeded.
    • DSC cannot access the added database normally if the Connection Status of the database is Failed. Move the cursor to Failed to view the failure cause or rectify the fault by referring to section How Do I Troubleshoot the Failure in Connecting to the Added Database?

Adding a Self-Built Database Instance

You can add and delete self-built database instances. For details about the database types and versions supported by DSC, see Table 1. This section describes how to add a self-built database. For details about how to delete a database, see Related Operations.

  1. Log in to the management console.
  2. Click in the upper left corner and select a region or project.
  3. In the navigation tree on the left, click . Choose Security and Compliance > Data Security Center .
  4. In the navigation tree on the left, choose Asset Management > Asset Center. The Asset Center page is displayed.
  5. Choose Databases > Self-built Databases. The Database Instances tab page is displayed.
  6. Click Add Instance in the upper left corner of the database instance list. The Add Database Instance dialog box is displayed, as shown in Figure 5.

    Figure 5 Adding a database instance

  7. Set related parameters based on Table 2 and click OK to add the self-built database instance.

    Table 2 Configuring database instance information

    Parameter

    Description

    ECS

    Select the ECS of the self-built database instance from the drop-down list.

    Security group

    Select a security group from the drop-down list.

    Database Engine

    Select a DB engine from the drop-down list. Currently, the following DB engines are supported:

    • MySQL
    • TDSQL
    • KingBase
    • DMDBMS
    • PostgreSQL
    • SQLServer
    • Oracle

    Version

    Select a DB engine version from the drop-down list box. For details about the supported asset types and versions, see Constraints.

    Database Server Address

    Select a server address from the drop-down list box.

    If the database is deployed in the cluster mode and data masking is required, set this parameter to the IP address of the primary node.

    Database Port

    Enter an integer ranging from 0 to 65535.

    Database Name

    Enter the database name. Only letters, digits, hyphens (-), and "_" are allowed.

    Username/Password

    Enter the username and password of the database.

    Asset

    Enter 4 to 255 characters. Only letters, digits, hyphens (-), and "_" are allowed. The value must start with a letter.

    Creating a metadata drawing task

    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.

  8. After the database instance is added, you can authorize access to the database instance. For details, see Authorizing Access to a Database Assets.

Drawing Metadata of an Instance

  • If the number of authorized databases of a cloud database instance is greater than 0, click Refresh in the Operation column of the instance list to obtain the database, table, and column information of the instance.

    Cloud databases that do not support metadata collection, such as DDS, are excluded. For details, see section Creating a Metadata Collection Task.

  • If you enable the function of automatically creating a metadata task when adding a self-built database instance, the system automatically creates a metadata task to obtain all metadata of the instance after the instance is created.

    Self-built databases that do not support metadata collection, such as SQL Server, are excluded. For details, see section Creating a Metadata Collection Task.

  • Manually create a metadata task by referring to section Creating a Metadata Collection Task.

Related Operations

  • Deleting a DB instance

    A database instance can be deleted only when it is self-built and the number of authorized databases in the instance is 0.

    Select multiple self-built database instances and click Batch Delete in the upper left corner of the instance list to delete the instances. You can also click Delete in the Operation column of the instance list to delete a single DB instance.

  • Creating an identification task

    On the Databases tab page, click Create Identification Task in the Operation column of the asset list to create an identification task for an asset. For details, see section Creating an Identification Task.