All Products
Search
Document Center

Data Security Center:CreateRule

Last Updated:Oct 17, 2024

Creates a custom sensitive data detection rule.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
yundun-sddp:CreateRulecreate
  • All Resources
    *
    none
none

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 changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details
2023-12-06The request parameters of the API has changedView Change Details