Updated on 2025-09-10 GMT+08:00

Querying a Specified Risk Rule Policy

Function

Querying a Specified Risk Rule Policy

URI

GET /v2/{project_id}/audit/{instance_id}/rule/risk/{id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition:

Project ID You can obtain the value by calling the IAM API for querying the project list of a specified IAM user.

** Restrictions**:

N/A

Range:

The value is subject to the return value of the IAM service interface. The value contains 32 to 64 characters.

** Default value**:

N/A

instance_id

Yes

String

** Parameter description**:

Instance ID. The value can be obtained from the ID field of the API for querying the instance list.

** Restrictions**:

N/A

** Value range**:

The value is subject to the value of the API for querying the instance list. The value contains 32 to 64 characters.

** Default value**:

N/A

id

Yes

String

Definition:

Risky policy ID. The value can be obtained from the ID field of the API for querying risk rule policies.

** Restrictions**:

N/A

Range:

The value is subject to the value of the API for querying risk rule policies. The value is a string of 16 to 64 characters.

** Default value**:

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

** Parameter description**:

User token. You can obtain the token by calling the IAM API used to query the user token. The token is the value of X-Subject-Token in the response header.

** Restrictions**:

N/A

** Value range**:

Used by the IAM service to query the user token.

** Default value**:

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

rule_id

String

Risk rule ID

rule_name

String

Risk name

status

String

Risk rule status. The value can be:

  • OFF

  • ON

action

String

Operation set, which is separated by commas (,).LOGIN,CREATE_TABLE,CREATE_TABLESPACE,DROP_TABLE, DROP_TABLESPACE,DELETE,INSERT,INSERT_SELECT,SELECT,SELECT_FOR_UPDATE, UPDATE,CREATE_USER,DROP_USER,GRANT,OPERATE ALL

schemas

Array of schemas objects

Schema list

rank

Integer

Risk rule priority. A smaller value indicates a higher priority.

ignore_case

Boolean

Case insensitive or not.

risk_level

String

Risk level.

  • LOW

  • MEDIUM

  • HIGH

  • NO_RISK

db_ids

String

Database ID. Values are separated by commas (,). A single ID can contain up to 256 characters.

execution_symbol

String

Relationship between the execution duration and the execution duration threshold. The value can be:

  • GREATER

  • EQUAL

  • LESS

  • GREATER_EQUAL

  • LESS_EQUAL

  • NO_MATCH

execution_time

Integer

Execution duration threshold

affect_symbol

String

Relationship between the number of affected rows and the rows threshold. The value can be:

  • GREATER

  • EQUAL

  • LESS

  • GREATER_EQUAL

  • LESS_EQUAL

  • NO_MATCH

affect_rows

Integer

Threshold of affected rows

client_ips

String

Client IP address segment. The value is in the IP-IP format or IP/XX format. IP address segments are separated by commas (,).

Table 4 schemas

Parameter

Type

Description

schema

String

Schema name

table

String

Table name

column

String

Column name

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 6 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Status code: 403

Table 7 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 8 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Status code: 500

Table 9 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 10 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Example Requests

/v2/{project_id}/audit/{instance_id}/rule/risk/{id}

Example Responses

Status code: 200

Success

{
  "status" : "OFF",
  "action" : "LOGIN,SELECT,INSERT",
  "schemas" : [ {
    "schema" : "dbss_audit",
    "table" : null,
    "column" : null
  } ],
  "rank" : 6,
  "ignore_case" : false,
  "rule_id" : "AWT0HznX7At9UslqwTfm",
  "rule_name" : "risk_rule_name_00",
  "risk_level" : "MEDIUM",
  "db_ids" : "11111,22222",
  "execution_symbol" : "GREATER",
  "execution_time" : 10000,
  "affect_symbol" : "GREATER",
  "affect_rows" : 30,
  "client_ips" : "192.168.0.1"
}

Status Codes

Status Code

Description

200

Success

400

Incorrect request parameter.

403

Authorization failed.

500

Internal server error.

Error Codes

See Error Codes.