All Products
Search
Document Center

Data Security Center:CreateRule

Last Updated:Mar 28, 2024

Creates a custom sensitive data detection rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
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. You can specify a regular expression or keywords that are 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 sensitivity level of the sensitive 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 the low sensitivity level.
  • 3: S2, which indicates the medium sensitivity level.
  • 4: S3, which indicates the high sensitivity level.
  • 5: S4, which indicates the highest sensitivity level.
2
RuleTypeintegerNo

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

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

The name of the service to which data in the column of the table belongs. 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. The value 1 indicates MaxCompute. The value 2 indicates Object Storage Service (OSS). The value 3 indicates AnalyticDB for MySQL. The value 4 indicates Tablestore. The value 5 indicates ApsaraDB RDS.

2
WarnLevelintegerNo

The risk level of the alert that is triggered. Valid values:

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

The description of the rule.

ID card
ContentCategoryintegerNo

The type of the content in the sensitive data detection rule. Valid values include 1, 2, 3, 4, and 5. The value 1 indicates attempts to exploit SQL injections. The value 2 indicates bypass by using SQL injections. The value 3 indicates abuse of stored procedures. The value 4 indicates buffer overflow. The value 5 indicates SQL injections based on errors.

1
StatusintegerNo

Specifies whether to enable the sensitive data detection rule. Valid values:

  • 1: yes
  • 0: no
1
TargetstringNo

The code of the service to which the sensitive data detection rule is applied. Valid values include MaxCompute, OSS, ADS, OTS, and RDS.

MaxCompute
MatchTypeintegerNo

The match type. Valid values:

  • 1: rule-based match
  • 2: dictionary-based match
1
SupportFormintegerNo

The type of the data asset. Valid values:

  • 0: all data assets
  • 1: structured data asset
  • 2: unstructured data asset
Note If you set the parameter to 1 or 2, rules that support all data assets and rules that support the queried data asset type are returned.
1
SourceIpstringNo

This parameter is deprecated.

39.170.XX.XX
LangstringNo

The language of the content within the request and response. Valid values:

  • zh: Chinese
  • en: English
zh

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

Examples

Sample success responses

JSONformat

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

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-03-25The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: SourceIp
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang
2023-12-06The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: Lang