All Products
Search
Document Center

Web Application Firewall:DescribeDefenseResource

Last Updated:Nov 15, 2024

Queries the information about a protected object.

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:
    • The required resource types are displayed in bold characters.
    • 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
yundun-waf:DescribeDefenseResourceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the Web Application Firewall (WAF) instance.

Note You can call the DescribeInstance operation to query the ID of the WAF instance.
waf_v3prepaid_public_cn-4xl****i60i
ResourceManagerResourceGroupIdstringNo

The ID of the Alibaba Cloud resource group.

rg-acfm***q
ResourcestringYes

The name of the protected object that you want to query. Only exact queries are supported.

example.aliyundoc.com-waf
RegionIdstringNo

The region in which the WAF instance is deployed. Valid values:

  • cn-hangzhou: Chinese mainland.
  • ap-southeast-1: outside the Chinese mainland.
cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

439AADF2-368C-5E98-B14E-3086****0573
Resourceobject

The information about the protected object.

GmtCreatelong

The time when the protected object was created. Unit: milliseconds.

1607493144000
GmtModifiedlong

The time when the protected object was modified. Unit: milliseconds.

1691720010000
Productstring

The name of the cloud service.

alb
Resourcestring

The name of the protected object.

alb-rencs***
ResourceGroupstring

The name of the protected object group to which the protected object belongs.

example_resource_group
Detailobject

The details of the protected object. Different key-value pairs indicate different attributes of the protected object.

{ "product": "waf", "domain": "demo.aliyundoc****.com" }
Patternstring

The pattern used for the protected object.

domain
XffStatusinteger

Indicates whether a Layer 7 proxy is deployed in front of WAF, such as Anti-DDoS Proxy and Alibaba Cloud CDN. Valid values:

  • 0: No Layer 7 proxy is deployed.
  • 1: A Layer 7 proxy is deployed.
0
CustomHeadersarray

The custom header fields.

Note If the value of XffStatus is 1, the first IP address in the specified header field is used as the originating IP address of the client to prevent X-Forwarded-For (XFF) forgery. If you specify multiple header fields, WAF reads the values of the header fields in sequence until the originating IP address is obtained. If the originating IP address cannot be obtained, the first IP address in the XFF header field is used as the originating IP address of the client.
CustomHeaderstring

The custom header field.

x-forwarded-for
ResourceOriginstring

The origin of the protected object. Valid values:

  • custom
  • access
custom
Descriptionstring

The description of the protected object.

This is Description
ResourceManagerResourceGroupIdstring

The ID of the Alibaba Cloud resource group.

rg-acfmoiy****p2oq
AcwCookieStatusinteger

The status of the tracking cookie.

  • 0: disabled.
  • 1: enabled.
0
AcwSecureStatusinteger

The status of the secure attribute of the tracking cookie.

  • 0: disabled.
  • 1: enabled.
0
AcwV3SecureStatusinteger

The status of the secure attribute of the slider CAPTCHA cookie.

  • 0: disabled.
  • 1: enabled.
0
OwnerUserIdstring

The user ID (UID) of the Alibaba Cloud account to which the protected object belongs.

170457******9107

Examples

Sample success responses

JSONformat

{
  "RequestId": "439AADF2-368C-5E98-B14E-3086****0573",
  "Resource": {
    "GmtCreate": 1607493144000,
    "GmtModified": 1691720010000,
    "Product": "alb",
    "Resource": "alb-rencs***\n",
    "ResourceGroup": "example_resource_group",
    "Detail": {
      "product": "waf",
      "domain": "demo.aliyundoc****.com"
    },
    "Pattern": "domain",
    "XffStatus": 0,
    "CustomHeaders": [
      "x-forwarded-for"
    ],
    "ResourceOrigin": "custom",
    "Description": "This is Description",
    "ResourceManagerResourceGroupId": "rg-acfmoiy****p2oq",
    "AcwCookieStatus": 0,
    "AcwSecureStatus": 0,
    "AcwV3SecureStatus": 0,
    "OwnerUserId": "170457******9107"
  }
}

Error codes

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