All Products
Search
Document Center

Web Application Firewall:ModifyDefenseResourceXff

Last Updated:Jun 03, 2025

Modifies the cookie settings of a protected object and the method to identify the originating IP addresses of clients.

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 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 support 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 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. For more information, see Common condition keys.

  • 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:ModifyDefenseResourceXff

update

*DefenseResource

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

None

None

Request parameters

Parameter

Type

Required

Description

Example

XffStatus

integer

Yes

Specifies whether a Layer 7 proxy is deployed in front of WAF. Layer 7 proxies include Anti-DDoS Proxy and Alibaba Cloud CDN. Valid values:

  • 0 (default): No.

  • 1: Yes.

0

InstanceId

string

Yes

The ID of the WAF instance.

Note

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

waf_v2_public_cn-wwo3c****07

CustomHeaders

array

No

The custom header fields.

Note

The first IP address in the specified header field is used as the client source IP address to prevent X-Forwarded-For (XFF) spoofing. If multiple headers are specified, they are tried in sequence to obtain the source IP address. If the first header does not contain an IP address, the system tries the second header, and so on. If no IP address is found in any of the specified headers, the system uses the first IP address in the X-Forwarded-For header.

string

No

The custom header field.

x-forwarded-for

Resource

string

Yes

The name of the protected object.

alb-4pxu81fgagx3****mz-alb

AcwCookieStatus

integer

No

The status of the tracking cookie.

  • 0: Disabled.

  • 1 (default): Enabled.

0

AcwSecureStatus

integer

No

The status of the secure attribute of the tracking cookie.

  • 0 (default): Disabled.

  • 1: Enabled.

0

AcwV3SecureStatus

integer

No

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

  • 0 (default): Disabled.

  • 1: Enabled.

0

RegionId

string

No

The region of the WAF instance. Valid values:

  • cn-hangzhou: The Chinese mainland.

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

cn-hangzhou

ResponseHeaders

array

No

The response header parameters.

object

No

The response header parameters.

Key

string

No

Specifies the key for a custom response header.

Header-Key

Value

string

No

Specifies the value for a custom response header.

Header-Value

ResourceManagerResourceGroupId

string

No

The ID of the Alibaba Cloud resource group.

rg-acfm2kie2****wq

Response parameters

Parameter

Type

Description

Example

object

RequestId

string

The request ID.

6C094583-9B3F-5BD8-8748-DC638E****BF

Examples

Successful response

JSON format

{
  "RequestId": "6C094583-9B3F-5BD8-8748-DC638E****BF"
}

Error codes

HTTP status code

Error code

Error message

Description

400

Waf.Pullin.AbnormalStatus

The status of the access resource is abnormal. Resource:%s.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.