All Products
Search
Document Center

Data Management:ListSensitiveDataAuditLog

Last Updated:Aug 28, 2026

Queries audit logs of sensitive data access.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:ListSensitiveDataAuditLog

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

StartTime

string

Yes

The start of the time range to query. Format: yyyy-MM-DD HH:mm:ss.

2022-11-18 10:00:00

EndTime

string

Yes

The end of the time range to query. Format: yyyy-MM-DD HH:mm:ss.

2022-11-18 11:00:00

ModuleName

string

No

The function module to filter by. If not specified, all audit logs are returned. Valid values:

  • SQL_CONSOLE: data query

  • SQL_CONSOLE_EXPORT: query result export

  • DATA_CHANGE: data change

  • DATA_EXPORT: data export

SQL_CONSOLE

OpUserName

string

No

The username of the requester.

ExampleOpUserName

DbName

string

No

The name of the database that stores the sensitive data.

ExampleDbName

TableName

string

No

The name of the table that stores the sensitive data.

ExampleTableName

ColumnName

string

No

The name of the column that contains sensitive data.

ExampleColumnName

PageSize

integer

Yes

The number of entries per page.

100

PageNumber

integer

Yes

The number of the page to return.

1

Tid

integer

No

The ID of the tenant.

3***

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

E0D21075-CD3E-4D98-8264-FD8AD04A63B6

TotalCount

integer

The total number of entries returned.

100

ErrorCode

string

The error code returned if the request failed.

403

ErrorMessage

string

The error message returned if the request failed.

UnknownError

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

SensitiveDataAuditLogList

array<object>

The audit logs for sensitive data.

array<object>

UserName

string

The username of the requester.

ExampleUserName

UserId

integer

The user ID of the requester.

1**

ModuleName

string

The function module associated with the audit log.

SQL_CONSOLE

DbDisplayName

string

The name of the database that stores the sensitive data.

ExampleDbName@xxx.xxx.xxx.xxx:3306

OpTime

string

The time when the operation was performed. Format: yyyy-MM-DD HH:mm:ss.

2022-11-18 10:01:00

InstanceId

integer

The ID of the instance.

12****

TargetName

string

The object on which the operation was performed. Returned in one of the following formats:

  • Object name - object ID

  • Object name (object ID)

Ticket - 1****

SensitiveDataLog

array<object>

The logs for sensitive data.

object

TableName

string

The name of the table that stores the sensitive data.

ExampleTableName

ColumnName

string

The name of the column that contains sensitive data.

ExampleColumnName

SecurityLevel

string

The sensitivity level of the data. Valid values:

  • Low

  • Medium

  • High

Low

ColumnPermissionType

string

The permission that the user has on the column. Valid values:

  • No permission

  • Partial redaction

  • Plaintext

  • Change

  • Enable data masking

  • Disable data masking

Change

DesensitizationRule

string

The algorithm used for data masking.

System default - full masking

Examples

Success response

JSON format

{
  "RequestId": "E0D21075-CD3E-4D98-8264-FD8AD04A63B6",
  "TotalCount": 100,
  "ErrorCode": "403",
  "ErrorMessage": "UnknownError",
  "Success": true,
  "SensitiveDataAuditLogList": [
    {
      "UserName": "ExampleUserName",
      "UserId": 0,
      "ModuleName": "SQL_CONSOLE",
      "DbDisplayName": "ExampleDbName@xxx.xxx.xxx.xxx:3306",
      "OpTime": "2022-11-18 10:01:00",
      "InstanceId": 0,
      "TargetName": "Ticket - 1****",
      "SensitiveDataLog": [
        {
          "TableName": "ExampleTableName",
          "ColumnName": "ExampleColumnName",
          "SecurityLevel": "Low",
          "ColumnPermissionType": "Change",
          "DesensitizationRule": "System default - full masking"
        }
      ]
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.