All Products
Search
Document Center

Data Security Center:CreateRule

Last Updated:Nov 17, 2022

Creates a custom sensitive data detection rule.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
LangstringNo

The natural language of the request and response. Valid values:

  • zh: Chinese
  • en: English
zh
NamestringYes

The name of the sensitive data detection rule.

rule-tst
CategoryintegerNo

The content type of the sensitive data detection rule. Valid values:

  • 0: keyword
  • 2: regular expression
0
ContentstringYes

The content of the sensitive data detection rule. The content can be a regular expression or keywords used to match sensitive fields or text.

(?:\\D|^)((?:(?:25[0-4]|2[0-4]\\d|1\\d{2}|[1-9]\\d{1})\\.)(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){2}(?:25[0-5]|2[0-4]\\d|1[0-9]\\d|[1-9]\\d|[1-9]))(?:\\D|$)
StatExpressstringNo

The statistical expression.

1
RiskLevelIdlongNo

The risk level ID f data that hits the sensitive data detection rule. Valid values:

  • 1: N/A, which indicates that no sensitive data is detected.
  • 2: S1, which indicates sensitive data at level 1.
  • 3: S2, which indicates sensitive data at level 2.
  • 4: S3, which indicates sensitive data at level 3.
  • 5: S4, which indicates sensitive data at level 4.
2
RuleTypeintegerNo

The feature type of the rule. Valid values:

  • 1: data detection rule
  • 2: audit rule
  • 3: anomalous activity detection rule
  • 99: custom rule
1
ProductCodestringNo

The name of the service to which the columns belong. Valid values include MaxCompute, OSS, ADS, OTS, and RDS.

RDS
ProductIdlongNo

The ID of the service to which the data asset belongs. Valid values include 1, 2, 3, 4, and 5. A value of 1 indicates MaxCompute. A value of 2 indicates Object Storage Service (OSS). A value of 3 indicates AnalyticDB for MySQL. A value of 4 indicates Tablestore. A value of 5 indicates ApsaraDB RDS.

2
WarnLevelintegerNo

The severity level. Valid values:

  • 1: low severity level
  • 2: medium severity level
  • 3: high severity level
2
DescriptionstringNo

The description of the rule.

ID card information
ContentCategoryintegerNo

The type of the audit rule. Valid values include 1, 2, 3, 4, and 5. A value of 1 indicates Attempt to Exploit SQL Injections. A value of 2 indicates Bypass Attempt by Using SQL Injections. A value of 3 indicates Stored Procedure Abuse. A value of 4 indicates Buffer Overflow. A value of 5 indicates Error-based SQL Injection.

1
StatusintegerNo

The status of the rule. Valid values:

  • 1: The rule is enabled.
  • 0: The rule is disabled.
1
TargetstringNo

The service for which the rule is enabled. Valid values include MaxCompute, OSS, ADS, OTS, and RDS.

MaxCompute

Response parameters

ParameterTypeDescriptionExample
object
Idinteger

The unique ID of the sensitive data detection rule.

1
RequestIdstring

The ID of the request.

208B016D-4CB9-4A85-96A5-0B8ED1EBF271

Example

Normal return example

JSONFormat

{
  "Id": 1,
  "RequestId": "208B016D-4CB9-4A85-96A5-0B8ED1EBF271"
}

Error codes

For a list of error codes, visit the API error center.