All Products
Search
Document Center

Container Registry:GetScanRule

Last Updated:Dec 17, 2025
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

Queries a scan rule.

Operation description

Get scan 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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
cr:GetScanRuleget
*ScanRule
acs:cr:{#regionId}:{#accountId}:instance/{#instanceId}/scanrule/{#scanRuleId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The instance ID.

cri-xkx6vujuhay0****
ScanRuleIdstringYes

The scan rule ID.

crscnr-2sdveqjhpzdcafyq

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

Codestring

Return value

success
IsSuccessboolean

Indicates whether the API call was successful, valid values:

  • true: The API call was successful

  • false: The API call failed

true
RequestIdstring

The request ID.

C87993B5-7D61-5CAC-8D64-1AC732DD69FF
ScanRuleobject

The scan rule.

InstanceIdstring

The instance ID.

cri-szw6f6bhrky0c8jk
ScanRuleIdstring

The scan rule ID.

crscnr-aemytkwad2h7fyhb
RuleNamestring

The event rule name.

protection
ScanScopestring

The scan scope.

REPO
TriggerTypestring

The trigger type, valid values:

  • ALL: All triggers

  • TAG_LISTTAG: Trigger

  • TAG_REG_EXP: Expression trigger

AUTO
Namespacesarray

Names of namespaces where the event is effective.

Namespacesstring

Names of namespaces where the event is effective.

[\"lwc-app-group\"]
RepoNamesarray

Names of repositories where the event is effective.

RepoNamesstring

Names of repositories where the event is effective

[\"lesson-kit-api\",\"lesson-kit-consumer-gen\"]
RepoTagFilterPatternstring

Tag filter pattern for event triggering.

.*
CreateTimelong

The creation time.

2018-03-15T17:08Z
UpdateTimelong

The update time.

2025-08-28T20:07:33.164
ScanTypestring

The vulnerability type:

  • cve: System vulnerability

  • sca: Application vulnerability

SBOM

Examples

Sample success responses

JSONformat

{
  "Code": "success",
  "IsSuccess": true,
  "RequestId": "C87993B5-7D61-5CAC-8D64-1AC732DD69FF",
  "ScanRule": {
    "InstanceId": "cri-szw6f6bhrky0c8jk",
    "ScanRuleId": "crscnr-aemytkwad2h7fyhb",
    "RuleName": "protection",
    "ScanScope": "REPO",
    "TriggerType": "AUTO",
    "Namespaces": [
      "[\\\"lwc-app-group\\\"]"
    ],
    "RepoNames": [
      "[\\\"lesson-kit-api\\\",\\\"lesson-kit-consumer-gen\\\"]"
    ],
    "RepoTagFilterPattern": ".*",
    "CreateTime": 0,
    "UpdateTime": 0,
    "ScanType": "SBOM"
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2025-11-28Add OperationView Change Details