All Products
Search
Document Center

Security Center:AddContainerPluginRule

Last Updated:Feb 20, 2024

Creates a defense rule against container escapes.

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
LangstringNo

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

  • zh: Chinese
  • en: English
zh
RuleNamestringYes

The name of the rule. The name must be 1 to 80 characters in length, and can contain letters, digits, hyphens (-), forward slashes (/), periods (.), and underscores (_). The names of rules that are created for the same user must be unique.

tyest111
RuleTemplateIdintegerYes

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

86863
ModeintegerYes

The action that you want to specify for the rule. Valid values:

  • 1: triggers alerts.
  • 2: blocks escapes.
1
SelectedPolicyarrayYes

The check items that are enabled for the rule.

stringYes

The check item that is enabled for the rule.

system_triggered_task
RuleTypeintegerNo

The type of the rule. Valid values:

  • 0: custom rule
  • 1: system rule
0
WhiteImagesarrayNo

The images that are added to the whitelist.

stringNo

The image that is added to the whitelist.

centos

Response parameters

ParameterTypeDescriptionExample
object
Dataobject

The data returned.

RuleIdlong

The ID of the rule.

219
RuleNamestring

The name of the rule.

test2
SwitchIdstring

The ID of the switch.

USER-CONTAINER-RULE-SWITCH-TYPE_xxxx
RequestIdstring

The request ID.

24A20733-10A0-4AF6-BE6B-E3322413BB68

Examples

Sample success responses

JSONformat

{
  "Data": {
    "RuleId": 219,
    "RuleName": "test2",
    "SwitchId": "USER-CONTAINER-RULE-SWITCH-TYPE_xxxx"
  },
  "RequestId": "24A20733-10A0-4AF6-BE6B-E3322413BB68"
}

Error codes

HTTP status codeError codeError messageDescription
403NoPermissioncaller has no permissionYou are not authorized to do this operation.
500ServerErrorServerError-

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