All Products
Search
Document Center

Security Center:CreateOpaStrategyNew

Last Updated:Mar 24, 2026

Creates a rule to block at-risk images.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-sas:CreateOpaStrategyNew

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

StrategyId

integer

No

The rule ID.

Note

You can call the ListOpaClusterStrategyNew operation to query the rule ID.

Note

This parameter is invalid when you create a rule.

16

StrategyTemplateId

integer

No

The ID of the rule template.

Note

You can call the GetOpaStrategyTemplateSummary operation to query the ID of the rule template.

109

ClusterId

string

No

The cluster ID.

Note

This parameter is deprecated.

cfa7e2fb8c221483ba59e098c34c6****

StrategyName

string

No

The rule name.

default

Description

string

No

The rule description.

default policy

ClusterName

string

No

The cluster name.

Note

This parameter is deprecated.

*

UnScanedImage

boolean

No

Specifies whether the rule supports unscanned images. Valid values:

  • true

  • false

true

MaliciousImage

boolean

No

Specifies whether the rule supports malicious Internet images. Valid values:

  • true

  • false

true

ImageName

array

No

The image names.

string

No

The image name.

Note

You can call the GetOpaClusterImageList operation to query the image name.

testImage

Label

array

No

The container tags.

string

No

The container tag.

Note

You can call the GetOpaClusterLabelList operation to query the container tag.

app.kubernetes.io/component:collector

RuleAction

integer

No

The action that is performed when the rule is hit. Valid values:

  • 1: trigger alerts

  • 2: block

  • 3: allow

1

WhiteList

array

No

The whitelist.

string

No

The entry in the whitelist.

repo-06

AlarmDetail

object

No

The risks that you want to detect by using the rule.

Baseline

object

No

The baseline risks.

RiskLevel

array

No

The risk levels.

string

No

The risk level. Valid values:

  • high

  • medium

  • low

high

Item

array<object>

No

The baseline check items.

object

No

Id

string

No

The ID of the baseline check item.

Note

You can call the GetOpaClusterBaseLineList operation to query the ID.

hc.image.checklist.identify.hc_exploit_couchdb_linux.item

Name

string

No

The name of the baseline check item.

Note

You can call the GetOpaClusterBaseLineList operation to query the name.

Unauthorized access to CouchDB configuration risk

Vul

object

No

The vulnerability risks.

RiskLevel

array

No

The risk levels.

string

No

The risk level. Valid values:

  • high

  • medium

  • low

high

Item

array<object>

No

The vulnerabilities.

object

No

Id

string

No

The ID of the vulnerability.

Note

You can call the DescribeVulListPage operation to query the ID.

CVE-2023-36034

Name

string

No

The name of the vulnerability.

Note

You can call the DescribeVulListPage operation to query the name.

Microsoft Edge vul

RiskClass

array<object>

No

Risk type of vulnerability.

object

No

Id

string

No

The ID of the vulnerability types. Valid values:

  • cve: system vulnerability

  • app: application vulnerability

cve

Name

string

No

The name of the vulnerability. Valid values:

  • system vulnerability

  • application vulnerability

System vulnerability

MaliciousFile

object

No

The malicious sample risks.

RiskLevel

array

No

The risk levels.

string

No

The risk level. Valid values:

  • high

  • medium

  • low

high

Item

array<object>

No

The malicious samples.

object

No

Id

string

No

The ID of the malicious sample.

Note

You can call the DescribeMatchedMaliciousNames operation to query the ID.

3685699

Name

string

No

The name of the malicious sample.

Note

You can call the DescribeMatchedMaliciousNames operation to query the name.

abnormal binary file

SensitiveFile

object

No

The configuration of sensitive file.

RiskLevel

array

No

The risk levels.

string

No

The risk level. Valid values:

  • high

  • medium

  • low

low

Item

array<object>

No

The configuration of sensitive file.

object

No

Id

string

No

The ID of the sensitive files.

Note

You can call the GetSensitiveDefineRuleConfig operation to query the ID of the malicious sample.

key

Name

string

No

The name of the sensitive files.

Note

You can call the GetSensitiveDefineRuleConfig operation to query the ID of the malicious sample.

name

BuildRisk

object

No

The configuration of image build risk.

RiskLevel

array

No

The risk levels.

string

No

The risk level. Valid values:

  • high

  • medium

  • low

low

Item

array<object>

No

The configuration of image build risk.

object

No

Id

string

No

The ID of the image build risk.

Note

You can call the ListImageBuildRiskItem operation to query the ID of the malicious sample.

key

Name

string

No

The name of the image build risk.

Note

You can call the ListImageBuildRiskItem operation to query the ID of the malicious sample.

name

Scopes

array<object>

No

The application scope of the rule.

object

No

ClusterId

string

No

The ID of the cluster that is specified in the rule.

Note

You can call the DescribeGroupedContainerInstances operation to query the cluster ID.

cc50d***015d2

AllNamespace

integer

No

Specifies whether to include all namespaces. Valid values:

  • 1: includes all namespaces.

  • 0: does not include all namespaces.

1

NamespaceList

array

No

The namespaces.

Note

This parameter is valid only when the AllNamespace parameter is set to 0.

string

No

The namespace.

Note

You can call the GetOpaClusterNamespaceList operation to query the namespace.

namespace1

AckPolicyInstanceId

string

No

The ID of the cluster node to which the rule is applied.

Note

This parameter is not required when you create the instance.

ack-p-1

Response elements

Element

Type

Description

Example

object

BaseResult

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Code

string

The status code returned. The status code 200 indicates that the request was successful. Other status codes indicate that the request failed. You can identify the cause of the failure based on the status code.

200

Message

string

The returned message.

success

RequestId

string

The request ID.

CD380235-A0B8-540D-A0D5-D62884469E3C

HttpStatusCode

integer

The HTTP status code.

200

Data

array

The IDs of the clusters that failed to be saved.

string

The ID of the cluster that failed to be saved.

['cb8cd***b07ee5']

Examples

Success response

JSON format

{
  "Success": true,
  "Code": "200",
  "Message": "success",
  "RequestId": "CD380235-A0B8-540D-A0D5-D62884469E3C",
  "HttpStatusCode": 200,
  "Data": [
    "['cb8cd***b07ee5']"
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

500 ServerError ServerError
403 NoPermission caller has no permission You are not authorized to do this operation.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.