All Products
Search
Document Center

Web Application Firewall:ModifyDomain

Last Updated:Apr 26, 2024

Modifies the configurations of a domain name that is added to Web Application Firewall (WAF) in CNAME record mode.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:ModifyDomainWrite
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the WAF instance.

Note You can call the DescribeInstance operation to obtain the ID of the WAF instance.
waf_cdnsdf3****
DomainstringYes

The domain name whose access configurations you want to modify.

www.aliyundoc.com
ListenobjectYes

The configurations of the listeners.

HttpsPortsarrayNo

An array of HTTPS listener ports. Specify the value of this parameter in the [port1,port2,...] format.

integerNo

The HTTPS listener port.

443
HttpPortsarrayNo

An array of HTTP listener ports. Specify the value of this parameter in the [port1,port2,...] format.

integerNo

The HTTP listener port.

80
Http2EnabledbooleanNo

Specifies whether to enable HTTP/2. This parameter is available only when you specify the HttpsPorts parameter. Valid values:

  • true: enables HTTP/2.
  • false: disables HTTP/2. This is the default value.
true
CertIdstringNo

The ID of the certificate that you want to add.

123
SM2EnabledbooleanNo

Indicates whether SM certificate-based verification is enabled. Valid values:

  • true
  • false
true
SM2CertIdstringNo

The ID of the SM certificate that you want to add. This parameter is available only if you set SM2Enabled to true.

123-cn-hangzhou
SM2AccessOnlybooleanNo

Specifies whether to allow access only from SM certificate-based clients. This parameter is available only if you set SM2Enabled to true.

  • true
  • false
true
TLSVersionstringNo

The version of the Transport Layer Security (TLS) protocol. This parameter is available only when you specify the HttpsPorts parameter. Valid values:

  • tlsv1
  • tlsv1.1
  • tlsv1.2
tlsv1
EnableTLSv3booleanNo

Specifies whether to support TLS 1.3. This parameter is available only when you specify the HttpsPorts parameter. Valid values:

  • true: supports TLS 1.3.
  • false: does not support TLS 1.3.
true
CipherSuiteintegerNo

The type of cipher suite that you want to add. This parameter is available only when you specify the HttpsPorts parameter. Valid values:

  • 1: all cipher suites.
  • 2: strong cipher suites. You can select this value only when you set the TLSVersion parameter to tlsv1.2.
  • 99: custom cipher suites.
2
CustomCiphersarrayNo

The custom cipher suites that you want to add. This parameter is available only when you set the CipherSuite parameter to 99.

stringNo

The custom cipher suite.

["xxx","ffas"]
FocusHttpsbooleanNo

Specifies whether to enable HTTP to HTTPS redirection for the domain name. This parameter is available only when you specify the HttpsPorts parameter and leave the HttpPorts parameter empty. Valid values:

  • true: enables HTTP to HTTPS redirection.
  • false: disables HTTP to HTTPS redirection.
true
XffHeaderModeintegerNo

The method that you want WAF to use to obtain the actual IP address of a client. Valid values:

  • 0: No Layer 7 proxies are deployed in front of WAF. This is the default value.
  • 1: WAF reads the first value of the X-Forwarded-For (XFF) header field as the actual IP address of the client.
  • 2: WAF reads the value of a custom header field as the actual IP address of the client.
2
XffHeadersarrayNo

The custom header fields that you want to use to obtain the actual IP address of a client. Specify the value of this parameter in the ["header1","header2",...] format.

Note If you set the XffHeaderMode parameter to 2, this parameter is required.
stringNo

The custom header field that you want to use to obtain the actual IP address of a client.

Client-ip
IPv6EnabledbooleanNo

Specifies whether to enable IPv6. Valid values:

  • true: enables IPv6.
  • false: disables IPv6. This is the default value.
true
ProtectionResourcestringNo

The type of the protection resource that you want to use. Valid values:

  • share: shared cluster. This is the default value.
  • gslb: shared cluster-based intelligent load balancing.
share
ExclusiveIpbooleanNo

Specifies whether to enable an exclusive IP address for the domain name. This parameter is available only when you set the IPv6Enabled parameter to false and the ProtectionResource parameter to share. Valid values:

  • true: enables an exclusive IP address for the domain name.
  • false: does not enable an exclusive IP address for the domain name. This is the default value.
true
RedirectobjectYes

The configurations of the forwarding rule.

BackendsarrayNo

The IP addresses or domain names of the origin server. You can use only one of the address types. If you use the domain name type, the domain name can be resolved only to an IPv4 address.

  • If you use the IP address type, specify the value in the ["ip1","ip2",...] format. You can enter up to 20 IP addresses.
  • If you use the domain name type, specify the value in the ["domain"] format. You can enter up to 20 domain names.
stringNo

The IP address or domain name of the origin server.

1.1.XX.XX
LoadbalancestringYes

The load balancing algorithm that you want to use to forward requests to the origin server. Valid values:

  • ip_hash
  • roundRobin
  • leastTime You can set the parameter to this value only if you set ProtectionResource to gslb.
iphash
FocusHttpBackendbooleanNo

Specifies whether to enable HTTPS to HTTP redirection for back-to-origin requests. This parameter is available only if you specify HttpsPorts. Valid values:

  • true
  • false
true
SniEnabledbooleanNo

Specifies whether to enable origin Server Name Indication (SNI). This parameter is available only if you specify HttpsPorts. Valid values:

  • true
  • false (default)
true
SniHoststringNo

The value of the SNI field. If you do not specify this parameter, the value of the Host field is automatically used. This parameter is optional. If you want WAF to use an SNI field value that is different from the Host field value in back-to-origin requests, you can specify a custom value for the SNI field.

Note This parameter is required only if you set SniEnalbed to xxx.
www.aliyundoc.com
RequestHeadersobject []No

The custom header field that you want to use to label requests that are processed by WAF.

When a request passes through WAF, the custom header field is automatically used to label the request. This way, the backend service can identify requests that are processed by WAF.

KeystringNo

The key of the custom header field.

aaa
ValuestringNo

The value of the custom header field.

bbb
ConnectTimeoutintegerNo

The timeout period for connections. Unit: seconds. Valid values: 1 to 3600.

120
ReadTimeoutintegerNo

The timeout period for read connections. Unit: seconds. Valid values: 1 to 3600.

200
WriteTimeoutintegerNo

The timeout period for write connections. Unit: seconds. Valid values: 1 to 3600.

200
CnameEnabledbooleanNo

Specifies whether to enable the public cloud disaster recovery feature. Valid values:

  • true
  • false (default)
true
RoutingRulesstringNo

The forwarding rules that you want to configure for the domain name that you want to add to WAF in hybrid cloud mode. This parameter is a string that consists of JSON arrays. Each element in a JSON array is a JSON struct that contains the following fields:

  • rs: the back-to-origin IP addresses or CNAMEs. The value must be of the ARRAY type.
  • location: the name of the protection node. The value must be of the STRING type.
  • locationId: the ID of the protection node. The value must be of the LONG type.
[ { "rs": [ "1.1.XX.XX" ], "locationId": 535, "location": "test1111" } ]
KeepalivebooleanNo

Specifies whether to enable the persistent connection feature. Valid values:

  • true (default)
  • false
true
RetrybooleanNo

Specifies whether WAF retries forwarding requests to the origin server when the requests fail to be forwarded to the origin server. Valid values:

  • true (default)
  • false
true
KeepaliveRequestsintegerNo

The number of reused persistent connections. Valid values: 60 to 1000.

Note This parameter specifies the number of reused persistent connections after you enable the persistent connection feature.
1000
KeepaliveTimeoutintegerNo

The timeout period for idle persistent connections. Valid values: 1 to 60. Default value: 15. Unit: seconds.

Note This parameter specifies the time for which a reused persistent connection can remain in the Idle state before the persistent connection is released.
15
XffProtobooleanNo

Specifies whether to use the X-Forward-For-Proto header to identify the protocol used by WAF to forward requests to the origin server. Valid values:

  • true (default)
  • false
true
RegionIdstringYes

The region where the WAF instance resides. Valid values:

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

The mode in which you want to add the domain name to WAF. Set the value to share.

  • share: adds the domain name to WAF in CNAME record mode. This is the default value.
share

Response parameters

ParameterTypeDescriptionExample
object

The result of the request.

RequestIdstring

The ID of the request.

D7861F61-5B61-46CE-A47C-6B19160D5EB0
DomainInfoobject

The information about the domain name.

Cnamestring

The CNAME that is assigned by WAF to the domain name.

xxxxxcvdaf.****.com
Domainstring

The domain name whose access configurations you modified.

www.aliyundoc.com
DomainIdstring

The ID of the domain name.

www.aliyundoc.com-waf

Examples

Sample success responses

JSONformat

{
  "RequestId": "D7861F61-5B61-46CE-A47C-6B19160D5EB0",
  "DomainInfo": {
    "Cname": "xxxxxcvdaf.****.com",
    "Domain": "www.aliyundoc.com",
    "DomainId": "www.aliyundoc.com-waf"
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-01-30The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-04-27The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.
2023-04-18The internal configuration of the API is changed, but the call is not affectedsee changesets
Change itemChange content
The internal configuration of the API is changed, but the call is not affected.