Creates a protected object.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-waf:CreateDefenseResource |
create |
*DefenseResource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Resource |
string |
No |
The name of the protected object. Note
|
abctest.com |
| Product |
string |
Yes |
The cloud product name. Valid values:
|
ecs |
| ResourceGroup |
string |
No |
The name of the protection group to which the protected object is added. This parameter is optional. |
testGroup |
| ResourceOrigin |
string |
Yes |
The source of the protected object. Valid values:
|
custom |
| Pattern |
string |
Yes |
The protection mode of the protected object. Valid values:
Note
Currently, only the following combinations are supported: when Product is set to alb, ecs, clb4, clb7, or nlb, Pattern must be set to domain. When Product is set to waf, Pattern must be set to multi_service. |
domain |
| Detail |
string |
Yes |
The specific parameter information of the protected object, which is a string converted from a JSON object constructed with a series of parameters. Note
The parameters vary depending on the specified cloud product (Product) and protection mode (Pattern). For more information, see Detail parameter description for protected objects. Important When Product is set to ecs, clb4, clb7, or nlb, domain names connected to regions in the Chinese mainland must have completed ICP filing. |
{\"domain\": \"zhhclb4test096-05111.test.com\"} |
| XffStatus |
integer |
No |
Specifies whether XFF proxy is enabled for the protected object. Valid values:
|
0 |
| CustomHeaders |
array |
No |
The list of specified header fields. Note
When XffStatus is set to 1, the first IP in the specified header field is used as the client source IP to prevent XFF spoofing. When multiple headers are specified, the system attempts to obtain the source IP from each header in order. If the first header does not contain an IP, the system tries the second header, and so on. If no specified header contains an IP, the first IP in the X-Forwarded-For header is used. When XffStatus is set to 1, the IP is obtained from the first available header. |
|
|
string |
No |
The specified header field. |
x-forwarded-for |
|
| Description |
string |
No |
The description of the protected object. |
ResourceTest |
| InstanceId |
string |
Yes |
The ID of the WAF instance. Note
You can call DescribeInstance to query the ID of the current WAF instance. |
waf_v3prepaid_public_cn-4xl******* |
| OwnerUserId |
string |
No |
The ID of the account to which the protected object belongs in multi-account scenarios. By default, the protected object belongs to the WAF administrator account. |
123221XXX |
| Tag |
array<object> |
No |
The tag list, which contains up to 20 items. |
|
|
object |
No |
The resource tag list, which contains up to 20 items. |
||
| Key |
string |
No |
The tag key. |
demoTagKey |
| Value |
string |
No |
The tag value. |
TagValue1 |
| ResourceManagerResourceGroupId |
string |
No |
The Alibaba Cloud resource group ID. |
rg-acfm***q |
| RegionId |
string |
No |
The region where the WAF instance resides. Valid values:
|
cn-hangzhou |
Detail parameter description for protected objects.
ALB Website Config (Product set to alb, Pattern set to domain)
Adds a domain name from an ALB instance that is already connected to WAF as a protected object.
Parameter description
| Name | Type | Required | Example | Description |
| instanceId | String | Yes | alb-cj3w3********1x | The instance ID of the ALB instance that is already connected to WAF. |
| domain | String | Yes | alb.test.com | The domain name to be protected by WAF. |
Example
{
"domain": "alb.test.com",
"instanceId": "alb-cj3w3********1x"
}
ECS Website Config (Product set to ecs, Pattern set to domain)
Adds a domain name from an ECS instance that is already connected to WAF as a protected object.
Parameter description
| Name | Type | Required | Example | Description |
| domain | String | Yes | ecs.test.com | The domain name to be protected by WAF. The domain name must have completed ICP filing when connected to regions in the Chinese mainland. |
Example
{
"domain": "ecs.test.com"
}
CLB Website Config (Product set to clb4 or clb7, Pattern set to domain)
Adds a domain name from a CLB instance that is already connected to WAF as a protected object.
Parameter description
| Name | Type | Required | Example | Description |
| domain | String | Yes | clb.test.com | The domain name to be protected by WAF. The domain name must have completed ICP filing when connected to regions in the Chinese mainland. |
Example
{
"domain": "clb.test.com"
}
NLB Website Config (Product set to nlb, Pattern set to domain)
Adds a domain name from an NLB instance that is already connected to WAF as a protected object.
Parameter description
| Name | Type | Required | Example | Description |
| domain | String | Yes | nlb.test.com | The domain name to be protected by WAF. The domain name must have completed ICP filing when connected to regions in the Chinese mainland. |
Example
{
"domain": "nlb.test.com"
}
WAF hybrid cloud service access (Product set to waf, Pattern set to multi_service)
Creates a protected object for a domain name path in a WAF hybrid cloud service access cluster.
Parameter description
| Name | Type | Required | Example | Description |
| domain | String | Yes | a.test.com | The domain name or IP address to be protected by WAF. |
| url | String | Yes | /abc | The URL path. |
Example
{
"domain": "a.test.com",
"url": "/abc"
}
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
1738C613-D054-5191-888B-DC0CF4C3A4A0 |
| Resource |
string |
The name of the created protected object. |
cdX.XXX-call.cn-alb |
Examples
Success response
JSON format
{
"RequestId": "1738C613-D054-5191-888B-DC0CF4C3A4A0",
"Resource": "cdX.XXX-call.cn-alb"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Waf.Pullin.ResourceExsit | Access resource already exists, resource:%s. | Access resource already exists, existing resource:%s. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.