Updated on 2026-04-03 GMT+08:00

Creating a WTP Configuration

Function

This API is used to create a WTP configuration.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

POST /v5/{project_id}/webtamper/protection-configs

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID.

To query assets in all enterprise projects, set this parameter to all_granted_eps.

Constraints

You need to set this parameter only after the enterprise project function is enabled.

Range

The value can contain 1 to 256 characters.

Default Value

0: default enterprise project.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Definition

Web tamper protection type.

Constraints

N/A

Range

  • container_wtp: container WTP

Default Value

N/A

protect_mode

No

String

Definition

Protection mode.

Constraints

N/A

Range

  • alarm: alarm mode

  • block: blocking mode

Default Value

alarm

monitor_process

No

Boolean

Definition

Whether to monitor processes to check for tampering.

Constraints

N/A

Range

  • true: Monitor tampering processes.

  • false: Do not monitor tampering processes.

Default Value

true

privileged_process_list

No

Array of strings

Definition

List of privileged process paths.

Constraints

This parameter is valid only when monitor_process is set to true. (If no process monitoring is performed, privileged processes cannot be checked.)

Range

0 to 10 items

Default Value

N/A

privileged_child

No

Boolean

Definition

Whether the subprocess of a privileged process still has privileges.

Constraints

This parameter is valid only when monitor_process is set to true. (If no process monitoring is performed, privileged processes cannot be checked.)

Range

  • true: The subprocess of a privileged process is still a privileged process.

  • false: The subprocess of a privileged process is no longer a privileged process.

Default Value

false

container_wtp_info

No

container_wtp_info object

Definition

Container WTP configuration.

Constraints

This parameter is valid only when type is set to container_wtp.

Range

N/A

Default Value

N/A

open_protection_immediately

No

Boolean

Definition

Whether to enable protection immediately.

Constraints

N/A

Range

  • true: Enable protection immediately.

  • false: Save the configuration and do not enable protection now.

Default Value

false

quota_info

No

quota_info object

Definition

The quota bound to a resource when protection was enabled for it.

Constraints

This field is valid only when the value of open_protection_immediately is true.

Range

N/A

Default Value

N/A

Table 5 container_wtp_info

Parameter

Mandatory

Type

Description

protect_type

Yes

String

Definition

Protection type.

Constraints

N/A

Range

  • cluster: web tamper protection for containers in a cluster

  • host: web tamper protection for containers on a server

Default Value

N/A

web_app_name

Yes

String

Definition

Website application name.

Constraints

N/A

Range

The value can contain 1 to 128 characters.

Default Value

N/A

cluster_id

No

String

Definition

Cluster ID.

Constraints

This parameter is valid only when protect_type is set to cluster.

Range

The value can contain 1 to 64 characters.

Default Value

N/A

host_id

No

String

Definition

Host ID.

Constraints

This parameter is valid only when protect_type is set to host.

Range

The value can contain 1 to 64 characters.

Default Value

N/A

cluster_label_list

No

Array of ClusterLabelInfo objects

Definition

Cluster tag list

Constraints

This parameter is valid only when protect_type is set to cluster.

Range

0 to 10 items

Default Value

N/A

protect_image_list

Yes

Array of ProtectImageInfo objects

Definition

Protected image list.

Constraints

N/A

Range

1 to 10 items

Default Value

N/A

Table 6 ClusterLabelInfo

Parameter

Mandatory

Type

Description

key

No

String

Definition

Key name of the cluster resource tag.

Constraints

N/A

Range

The value can contain 1 to 64 characters.

Default Value

N/A

value

No

String

Definition

Value of a cluster resource tag.

Constraints

N/A

Range

The value can contain 0 to 128 characters.

Default Value

N/A

Table 7 ProtectImageInfo

Parameter

Mandatory

Type

Description

image_name

Yes

String

Definition

Image

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

image_version

No

String

Definition

Image version

Constraints

N/A

Range

The value contains 0 to 64 characters.

Default Value

N/A

image_type

No

String

Definition

Image type.

Constraints

N/A

Range

  • registry: repository image

  • local: local image

  • custom: custom image

Default Value

custom

protect_directory_info_list

Yes

Array of ProtectDirectoryInfo objects

Definition

Protected directory information.

Constraints

N/A

Range

1 to 50 items

Default Value

N/A

exclude_file_types

No

Array of strings

Definition

List of excluded file types.

Constraints

N/A

Range

0 to 10 items

Default Value

N/A

Table 8 ProtectDirectoryInfo

Parameter

Mandatory

Type

Description

protect_directory

Yes

String

Definition

Protected directory.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

exclude_child_directory_list

No

Array of strings

Definition

List of subdirectories to be excluded.

Constraints

N/A

Range

0 to 10 items

Default Value

N/A

exclude_file_list

No

Array of strings

Definition

List of subfiles to be excluded.

Constraints

N/A

Range

0 to 10 items

Default Value

N/A

backup_directory

No

String

Definition

Backup directory.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

Table 9 quota_info

Parameter

Mandatory

Type

Description

charging_mode

Yes

String

Definition

Billing mode

Constraints

N/A

Range

  • packet_cycle: yearly/monthly

Default Value

N/A

resource_id_list

No

Array of strings

Definition

Quota ID list.

Constraints

If this parameter is left blank, the quota is randomly selected.

Range

0 to 10 items

Default Value

N/A

Response Parameters

Status code: 200

Request succeeded.

None

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.