All Products
Search
Document Center

Web Application Firewall:DescribeDefenseResource

Last Updated:Jun 25, 2026

Query a single protected object.

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-waf:DescribeDefenseResource

get

*DefenseResource

acs:yundun-waf:{#regionId}:{#accountId}:defenseresource/{#Resource}

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The ID of the WAF instance.

Note

You can call the DescribeInstance API operation to query the ID of the current WAF instance.

waf_v3prepaid_public_cn-4xl****i60i

ResourceManagerResourceGroupId

string

No

The ID of the Alibaba Cloud resource group.

rg-acfm***q

Resource

string

Yes

The name of the protected object to query. You can set this parameter to precisely query a protected object that has been added to WAF.

example.aliyundoc.com-waf

RegionId

string

No

The region where the WAF instance resides. Valid values:

  • cn-hangzhou: Chinese mainland.

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

cn-hangzhou

Response elements

Element

Type

Description

Example

object

The response structure.

RequestId

string

The request ID.

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

Resource

object

The information about the protected object.

GmtCreate

integer

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

1607493144000

GmtModified

integer

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

1691720010000

Product

string

The name of the cloud service.

alb

Resource

string

The name of the protected object.

alb-rencs***

ResourceGroup

string

The name of the protected object group to which the protected object is added.

example_resource_group

Detail

object

The detailed description of the protected object. Different key-value pairs in the Map represent different attributes of the protected object.

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

Pattern

string

The protection form of the protected object.

domain

XffStatus

integer

Indicates whether a Layer 7 proxy (Anti-DDoS/CDN, etc.) is deployed in front of WAF. Valid values:

  • 0: not enabled.

  • 1: enabled.

0

CustomHeaders

array

The list of specified header fields.

Note

When XffStatus is set to 1, the first IP address in the specified header field is used as the client source IP address to prevent XFF forgery. If multiple header fields are specified, they are tried in order to obtain the source IP address. If the source IP address cannot be obtained from the first header field, the second header field is tried, and so on. If the source IP address cannot be obtained from any of the specified header fields, the first IP address in X-Forwarded-For is used. When XffStatus is set to 1, it indicates that the source IP address is obtained from the first header field.

string

The specified header field.

x-forwarded-for

ResourceOrigin

string

The origin of the protected object. Valid values:

  • custom: the protected object created from Access Management.

  • access: the protected object created by the user.

custom

Description

string

The description.

This is Description

ResourceManagerResourceGroupId

string

The ID of the Alibaba Cloud resource group.

rg-acfmoiy****p2oq

AcwCookieStatus

integer

The status of the tracking cookie. Valid values:

  • 0: disabled.

  • 1: enabled.

0

AcwSecureStatus

integer

The status of the secure attribute of the tracking cookie. Valid values:

  • 0: disabled.

  • 1: enabled.

0

AcwV3SecureStatus

integer

The status of the secure attribute of the slider cookie. Valid values:

  • 0: disabled.

  • 1: enabled.

0

OwnerUserId

string

The UID of the owner of the protected object.

170457******9107

ResponseHeaders

array<object>

The response header parameters.

object

The response header parameter.

Key

string

The key of the custom response header.

Header-Key

Value

string

The value of the custom response header.

Header-Value

InstanceId

string

The ID of the WAF instance.

waf_v2_public_cn-wwo****

ResourceStatus

string

The status of the protected object. Valid values:

  • initializing: default protection is being initialized.

  • active: running normally.

  • init_failed: default protection initialization failed.

Examples

Success response

JSON format

{
  "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",
    "ResponseHeaders": [
      {
        "Key": "Header-Key\n",
        "Value": "Header-Value\n"
      }
    ],
    "InstanceId": "waf_v2_public_cn-wwo****",
    "ResourceStatus": ""
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.