All Products
Search
Document Center

Anti-DDoS:ModifyPolicyContent

Last Updated:Dec 13, 2024

Modifies the content of the mitigation policy.

Operation description

Make sure that all request parameters are configured when you call this operation. If any parameter is left empty, the configuration is deleted.

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-antiddosbag:ModifyPolicyContentupdate
*Policy
acs:yundun-antiddosbag:{#regionId}:{#accountId}:policy/{#PolicyId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
IdstringYes

The ID of the policy.

83967609-7ea5-4f6d-a6ea-380b09e****
NamestringNo

The name of the policy.

demo**
ContentobjectNo

The policy content.

BlackIpListExpireAtlongNo

The validity period of the IP address blacklist. The value is a UNIX timestamp.

1716878000
EnableIntelligencebooleanNo

Specifies whether to enable intelligent protection.

true
IntelligenceLevelstringNo

The level of intelligent protection. Valid values:

  • default: normal.
  • hard: strict.
  • weak: loose.
default
WhitenGfbrNetsbooleanNo

Specifies whether to add back-to-origin CIDR blocks of Anti-DDoS Proxy to the whitelist.

false
EnableDropIcmpbooleanNo

Specifies whether to enable ICMP blocking.

true
RegionBlockCountryListarrayNo

The countries in the location blacklist.

integerNo

The code of the country in the location blacklist.

11
RegionBlockProvinceListarrayNo

The provinces in the location blacklist.

integerNo

The code of the province in the location blacklist.

2
SourceLimitobjectNo

The settings for source rate limiting.

PpsintegerNo

The packets per second (pps) limit on source IP addresses.

64
BpsintegerNo

The bandwidth limit on source IP addresses. Unit: bytes per second.

2048
SynPpsintegerNo

The pps limit on source SYN packets.

64
SynBpsintegerNo

The bandwidth limit on source SYN packets. Unit: bytes per second.

2048
SourceBlockListarray<object>No

The source IP addresses that are added to the blacklist.

objectNo

The source IP address that is added to the blacklist.

TypeintegerYes

The type of the source rate limit. Valid values:

  • 3: the pps limit on source IP addresses.
  • 4: the bandwidth limit on source IP addresses.
  • 5: the pps limit on source SYN packets.
  • 6: the bandwidth limit on source SYN packets.
3
BlockExpireSecondsintegerYes

The validity period of the blacklist to which the source IP address is added. Unit: seconds.

120
EverySecondsintegerYes

The statistical period during which the system collects data on source IP addresses to determine whether to add the source IP addresses to the blacklist. Unit: seconds.

60
ExceedLimitTimesintegerYes

The number of times that the source IP address exceeds a limit in a statistical period.

5
ReflectBlockUdpPortListarrayNo

The ports whose traffic is filtered out by the filtering policies for UDP reflection attacks.

integerNo

The port whose traffic is filtered out by the filtering policies for UDP reflection attacks.

Note Only UDP ports are supported.
123
PortRuleListarray<object>No

The port blocking rules.

objectNo

The port blocking rule.

IdstringNo

The ID of the rule.

412a7312-58ff-4e32-a202-0ab0*******
ProtocolstringYes

The protocol type. Valid values:

  • tcp
  • udp
tcp
SrcPortStartintegerYes

The start of the source port range. Valid values: 0 to 65535.

0
SrcPortEndintegerYes

The end of the source port range. Valid values: 0 to 65535.

65535
DstPortStartintegerYes

The start of the destination port range. Valid values: 0 to 65535.

0
DstPortEndintegerYes

The end of the destination port range. Valid values: 0 to 65535.

65535
MatchActionstringYes

The action triggered if the rule is matched. Valid values:

  • drop: The traffic is discarded.
drop
SeqNointegerYes

The sequence number that indicates the order for the rule to take effect. The value is an integer.

Note A smaller number indicates a higher priority.
1
FingerPrintRuleListarray<object>No

The byte-match filter rules.

objectNo

The byte-match filter rule.

IdstringNo

The ID of the rule.

83967609-7ea5-4f6d-a6ea-380b09e****
ProtocolstringYes

The protocol type. Valid values:

  • tcp
  • udp
tcp
SrcPortStartintegerYes

The start of the source port range. Valid values: 0 to 65535.

0
SrcPortEndintegerYes

The end of the source port range. Valid values: 0 to 65535.

65535
DstPortStartintegerYes

The start of the destination port range. Valid values: 0 to 65535.

0
DstPortEndintegerYes

The end of the destination port range. Valid values: 0 to 65535.

65535
MinPktLenintegerYes

The minimum packet length. Valid values: 1 to 1500.

1
MaxPktLenintegerYes

The maximum packet length. Valid values: 1 to 1500.

1500
OffsetintegerNo

The offset. Valid values: 0 to 1500.

0
PayloadBytesstringNo

The payload. The value is a hexadecimal string.

abcd
MatchActionstringYes

The action triggered if the rule is matched. Valid values:

  • permit: allows the traffic that matches the conditions in the byte-match filter rule.
  • drop: discards the traffic that matches the conditions in the byte-match filter rule.
  • ip_rate: limits rates on the source IP address whose traffic matches the conditions in the byte-match filter rule. The rate limit is specified by RateValue.
  • session_rate: limits the number of sessions from the source IP address whose traffic matches the conditions in the byte-match filter rule. The rate limit is specified by RateValue.
drop
RateValueintegerNo

The rate limit. Valid values: 1 to 100000.

Note This parameter is required when MatchAction is set to ip_rate or session_rate.
100
SeqNointegerYes

The sequence number that indicates the order for the rule to take effect. The value is an integer.

Note A smaller number indicates a higher priority.
1
EnableL4DefensebooleanNo

Specifies whether to enable port-specific mitigation.

true
L4RuleListarray<object>No

The port-specific mitigation rules.

objectNo

The port-specific mitigation rule.

NamestringYes

The name of the rule.

test**
PriorityintegerYes

The priority of the rule. Valid values: 1 to 100.

Note A smaller value indicates a higher priority.
1
MethodstringYes

The type of the rule. Valid values:

  • char: string match.
  • hex: hexadecimal string match.
char
MatchstringYes

The condition based on which an action is performed. Valid values:

  • 0: If the rule is matched, the action specified in the rule is performed.
  • 1: If the rule is not matched, the action specified in the rule is performed.
0
ActionstringYes

The action that is specified in the rule. Valid value:

  • 2: The traffic is discarded.
2
LimitedintegerYes

The minimum number of bytes in a session to trigger matching. Valid values: 0 to 2048.

0
ConditionListarray<object>Yes

The match conditions.

conditionListobjectNo

The match condition.

ArgstringYes

The term that is used for matching.

Note If Method is set to char, the value of this parameter must be ASCII strings. If Method is set to hex, the value of this parameter must be hexadecimal strings. Maximum length: 2,048.
abcd
PositionintegerYes

The start position for matching. Valid values: 0 to 2047.

0
DepthintegerYes

The number of bytes from the start position for matching. Valid values: 1 to 2048.

1200

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

3777EF25-940B-51F4-BB1D-99B5********

Examples

Sample success responses

JSONformat

{
  "RequestId": "3777EF25-940B-51F4-BB1D-99B5********"
}

Error codes

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