All Products
Search
Document Center

Web Application Firewall:DescribeDefenseResources

Last Updated:Jun 25, 2026

Queries protected objects by paging.

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:DescribeDefenseResources

list

*DefenseResource

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

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

Instance ID of the WAF instance.

Note

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

waf_cdnsdf3****

PageNumber

integer

No

The page number to return when paging is used. Default value: 1, which indicates the first page.

1

PageSize

integer

No

The number of entries per page when paging is used. Default value: 10, which indicates that 10 entries are returned on each page.

10

Query

string

No

The query conditions. The value is a JSON string.

Note

The query results vary based on the query conditions. For more information, see Query parameter description.

{\"product\":\"waf\"}

Tag

array<object>

No

The list of resource tags. A maximum of 20 tags can be specified.

object

No

The resource tag, which consists of a tag key and a tag value.

Value

string

No

The tag value.

TagValue1

Key

string

No

The tag key.

Tagkey1

ResourceManagerResourceGroupId

string

No

The ID of the Alibaba Cloud resource group.

rg-acfm***q

RegionId

string

No

The region where the WAF instance is deployed. Valid values:

  • cn-hangzhou: the Chinese mainland.

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

cn-hangzhou

Query parameter description

Parameter description
NameTypeRequiredExampleDescription
productStringNowafThe asset type. Valid values:
- waf: connected to WAF through CNAME or other methods.
- alb: connected through Application Load Balancer (ALB).
- clb: connected through Classic Load Balancer (CLB).
- ecs: connected through ECS.
- mse: connected through Microservices Engine (MSE).
- fc: connected through Function Compute (FC).
resourceLikeStringNoexample.aliyundoc.cThe name of the protected object. You can set this parameter to perform a fuzzy query on protected objects that are connected to WAF.
resourceStringNoexample.aliyundoc.com-wafThe name of the protected object. You can set this parameter to perform an exact query on protected objects that are connected to WAF.
resourceInStringNoexample1.aliyundoc.com,example2.aliyundoc.comThe names of multiple protected objects. You can set this parameter to query multiple protected objects that are connected to WAF. Separate multiple protected objects with commas (,).
instanceIdStringNoalb-nifa24****The instance ID of the protected object. You can set this parameter to perform an exact query on the instance ID of a protected object that is connected to WAF.
domainStringNoexample.aliyundoc.comThe domain name of the protected object. You can set this parameter to perform an exact query on the domain name of a protected object that is connected to WAF.
resourceGroupStringNogroup1The protection group to query.
inGroupBooleanNotrueSpecifies whether the protected object has been added to the protection group.
ownerUserIdStringNo135********23The ID of the Alibaba Cloud account to which the protected object belongs. You can set this parameter to perform an exact query on WAF protected objects that belong to a specific account in a multi-account scenario.
orderByStringNoresourceThe sorting method for protected objects. Valid values:
- resource: sorted by protected object name.
- gmtModified: sorted by modification time.
descBooleanNotrueThe sorting order. Valid values:
- false: ascending order.
- true: descending order.
Example
{
    "product ": "waf",
    "resource": "example.aliyundoc.com-waf",
    "domain": "example.aliyundoc.com",
    "resourceLike ": "example.aliyundoc.c",
    "InstaneId": "waf_cn****",
    "resourceIn": "example1.aliyundoc.com,example2.aliyundoc.com",
    "ownerUserId": "135**********41"
}
```.

Response elements

Element

Type

Description

Example

object

The response struct.

TotalCount

integer

The total number of entries returned.

73

RequestId

string

The request ID.

618F2626-DB27-5187-8C6C-4E61A491****

Resources

array<object>

The list of protected objects.

array<object>

The protected object information.

Pattern

string

The protection mode of the protected object.

domain

Description

string

The description.

test

XffStatus

integer

Indicates whether XFF proxy is enabled for the protected object.

1

GmtModified

integer

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

1665633032000

Resource

string

The name of the protected object.

alb-rencs***

AcwV3SecureStatus

integer

The status of the secure attribute for the slider cookie.

  • 0: Disabled.

  • 1: Enabled.

0

Product

string

The name of the cloud service.

alb

AcwCookieStatus

integer

The status of the tracking cookie.

  • 0: Disabled.

  • 1: Enabled.

1

AcwSecureStatus

integer

The status of the secure attribute for the tracking cookie.

  • 0: Disabled.

  • 1: Enabled.

0

ResourceManagerResourceGroupId

string

The ID of the Alibaba Cloud resource group.

rg-acfm***q

GmtCreate

integer

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

1652149203187

OwnerUserId

string

The Alibaba Cloud account to which the protected object asset belongs in a multi-account management feature scenario.

135*********46

ResourceOrigin

string

The origin of the protected object.

custom

ResourceGroup

string

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

test

Detail

object

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

{"domain":"eou.eleme.cn","uri":"/"}

CustomHeaders

array

The custom XFF headers used to obtain the originating IP address of the client. If XFF is set to 1 and this field is empty, the first IP address in the XFF header is used as the originating IP address of the client.

string

The custom header field information.

afbfbajf

ResponseHeaders

array<object>

The response header parameters.

object

The response header parameters.

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 instance ID of the WAF instance.

waf_v2_public_cn-k*****

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

{
  "TotalCount": 73,
  "RequestId": "618F2626-DB27-5187-8C6C-4E61A491****",
  "Resources": [
    {
      "Pattern": "domain",
      "Description": "test",
      "XffStatus": 1,
      "GmtModified": 1665633032000,
      "Resource": "alb-rencs***",
      "AcwV3SecureStatus": 0,
      "Product": "alb",
      "AcwCookieStatus": 1,
      "AcwSecureStatus": 0,
      "ResourceManagerResourceGroupId": "rg-acfm***q",
      "GmtCreate": 1652149203187,
      "OwnerUserId": "135*********46",
      "ResourceOrigin": "custom",
      "ResourceGroup": "test",
      "Detail": {
        "domain": "eou.eleme.cn",
        "uri": "/"
      },
      "CustomHeaders": [
        "afbfbajf"
      ],
      "ResponseHeaders": [
        {
          "Key": "Header-Key",
          "Value": "Header-Value"
        }
      ],
      "InstanceId": "waf_v2_public_cn-k*****",
      "ResourceStatus": ""
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.