Updated on 2026-01-13 GMT+08:00

Querying Scan Rule Details

Function

This API is used to query details about a scan rule based on the specified rule ID and project ID, including the rule name, description, type, and matching logic.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/scan-rules/{rule_id}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which is used to identify a specific project.

rule_id

Yes

String

Rule ID, which is used to identify a specific scan rule.

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

category

String

Rule category, which is used to identify BUILT_IN (built-in rules) and BUILT_SELF (user-defined rules).

content

Array of ScanRuleContentInfo objects

Rule content list, including the rule content.

create_time

Long

Timestamp when a rule is created.

logic_operator

String

Logical operator, which can be AND, OR, or REGEX (regular expression).

match_rate

Integer

Match rate, indicating the accuracy or priority of rule matching.

min_match

Integer

Minimum matching times, that is, the minimum condition that must be met when a rule is matched.

rule_desc

String

Rule description, which briefly describes the rule function.

rule_id

String

Rule ID, which uniquely identifies a rule.

rule_name

String

Rule name, which is used to identify and manage rules.

rule_type

String

Rule type, which can be KEYWORD (keyword), REGEX (regular expression), or NLP (natural language).

templates

Array of ShowRuleTemplateInfo objects

Template association information, including the association details between the rule and the template.

update_time

Long

Timestamp when a rule is last updated.

Table 3 ScanRuleContentInfo

Parameter

Type

Description

effective_mode

String

Rule effective mode, indicating the application mode of the rule.

location

String

Rule application position, indicating the specific application position of the rule in the data.

rule_content

String

Detailed rule content.

Table 4 ShowRuleTemplateInfo

Parameter

Type

Description

classification_id

String

Classification and grading ID, which indicates the classification to which a rule belongs.

classification_name

String

Classification and grading name, indicating the name of the classification to which the rule belongs.

id

String

Rule template ID, which uniquely identifies a rule template.

is_used

Boolean

Whether the rule is enabled.

rule_id

String

Rule ID, which uniquely identifies a rule.

security_level_color

Integer

Risk level color, which is displayed on the GUI.

security_level_id

String

Risk level ID, which indicates the risk level of a rule.

security_level_name

String

Risk level name of a rule.

template_id

String

Template ID, which is used to identify a specific scan template.

template_name

String

Template name, which is used to identify and manage templates.

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

If the request is successful, the details of the scan rule are returned.

401

Unauthorized. The user is not logged in or the token is invalid.

403

Unauthorized to access the resource.

404

The specified rule is not found.

Error Codes

See Error Codes.