ALIYUN::DDoS::Policy is used to create a mitigation policy.
Syntax
{
"Type": "ALIYUN::DDoS::Policy",
"Properties": {
"PolicyName": String,
"Type": String,
"ActionType": String,
"BlackIpList": List,
"Content": Map,
"WhiteIpList": List
}
}Properties
Property | Type | Required | Editable | Description | Constraint |
PolicyName | String | Yes | Yes | The name of the policy. | None. |
Type | String | Yes | No | The type of the policy. | Valid values:
|
ActionType | String | No | No | The type of the action. | Valid values:
|
BlackIpList | List | No | No | The IP addresses in the blacklist. | The blacklist can contain up to 1,999 IP addresses. |
Content | Map | No | Yes | The content of the policy. | For more information, see Content properties. |
WhiteIpList | List | No | No | The IP addresses in the whitelist. | The whitelist can contain up to 1,999 IP addresses. |
Content syntax
"Content": {
"WhitenGfbrNets": Boolean,
"PortRuleList": List,
"RegionBlockCountryList": List,
"RegionBlockProvinceList": List,
"FingerPrintRuleList": List,
"SourceLimit": Map,
"EnableDefense": Boolean,
"EnableIntelligence": Boolean,
"SourceBlockList": List,
"EnableDropIcmp": Boolean,
"IntelligenceLevel": String,
"ReflectBlockUdpPortList": List,
"BlackIpListExpireAt": Integer,
"Layer4RuleList": List
}Content properties
Property | Type | Required | Editable | Description | Constraint |
BlackIpListExpireAt | Integer | No | Yes | The expiration time of the IP address blacklist. | None. |
EnableDefense | Boolean | No | Yes | Specifies whether to enable port-specific mitigation. | None. |
EnableIntelligence | Boolean | No | Yes | Specifies whether to enable intelligent protection. | None. |
EnableDropIcmp | Boolean | No | Yes | Specifies whether to enable ICMP blocking. | None. |
FingerPrintRuleList | List | No | Yes | The byte-match filter rules. | You can configure up to eight rules. For more information, see FingerPrintRuleList properties. |
IntelligenceLevel | String | No | Yes | The level of intelligent protection. | Valid values:
|
Layer4RuleList | List | No | Yes | The port-specific mitigation rules. | You can configure up to eight rules. For more information, see Layer4RuleList properties. |
PortRuleList | List | No | Yes | The port blocking rules. | You can configure up to eight rules. For more information, see PortRuleList properties. |
RegionBlockCountryList | List | No | Yes | The countries included in the location blacklist. | None. |
RegionBlockProvinceList | List | No | Yes | The provinces included in the location blacklist. | None. |
ReflectBlockUdpPortList | List | No | Yes | The ports whose traffic is filtered out by the filtering policies for UDP reflection attacks. | Example: {'Length': {'Min': 0, 'Max': 20}}. |
SourceLimit | Map | No | Yes | The settings for source rate limiting. | For more information, see SourceLimit properties. |
SourceBlockList | List | No | Yes | The source IP addresses that are added to the blacklist for source rate limiting. | For more information, see SourceBlockList properties. |
WhitenGfbrNets | Boolean | No | Yes | Specifies whether to add back-to-origin CIDR blocks of Anti-DDoS Proxy to the whitelist. | None. |
PortRuleList syntax
"PortRuleList": [
{
"SrcPortEnd": Integer,
"SeqNo": Integer,
"SrcPortStart": Integer,
"PortRuleId": String,
"DstPortStart": Integer,
"DstPortEnd": Integer,
"Protocol": String
}
]PortRuleList properties
Property | Type | Required | Editable | Description | Constraint |
DstPortStart | Integer | Yes | Yes | The start of the destination port range. | Valid values: 0 to 65535. |
DstPortEnd | Integer | Yes | Yes | The end of the destination port range. | Valid values: 0 to 65535. |
Protocol | String | Yes | Yes | The type of the protocol. | Valid values:
|
SrcPortEnd | Integer | Yes | Yes | The end of the source port range. | Valid values: 0 to 65535. |
SeqNo | Integer | Yes | Yes | The sequence number that indicates the order in which the port blocking rule takes effect. | Note A smaller number indicates a higher priority. |
SrcPortStart | Integer | Yes | Yes | The start of the source port range. | Valid values: 0 to 65535. |
PortRuleId | String | No | Yes | The ID of the port blocking rule. | None. |
FingerPrintRuleList syntax
"FingerPrintRuleList": [
{
"SrcPortEnd": Integer,
"SeqNo": Integer,
"SrcPortStart": Integer,
"FingerPrintRuleId": String,
"RateValue": Integer,
"PayloadBytes": String,
"DstPortStart": Integer,
"MatchAction": String,
"Offset": Integer,
"MaxPktLen": Integer,
"MinPktLen": Integer,
"DstPortEnd": Integer,
"Protocol": String
}
]FingerPrintRuleList properties
Property | Type | Required | Editable | Description | Constraint |
DstPortStart | Integer | Yes | Yes | The start of the destination port range. | Valid values: 0 to 65535. |
DstPortEnd | Integer | Yes | Yes | The end of the destination port range. | Valid values: 0 to 65535. |
MatchAction | String | Yes | Yes | The action triggered if the byte-match filter rule is matched. | Valid values:
|
MaxPktLen | Integer | Yes | Yes | The maximum packet length. | Valid values: 1 to 1500. |
MinPktLen | Integer | Yes | Yes | The minimum packet length. | Valid values: 1 to 1500. |
Protocol | String | Yes | Yes | The type of the protocol. | Valid values:
|
SrcPortEnd | Integer | Yes | Yes | The end of the source port range. | Valid values: 0 to 65535. |
SeqNo | Integer | Yes | Yes | The sequence number that indicates in which the byte-match filter rule takes effect. | The value of this property must be an integer. Note A smaller number indicates a higher priority. |
SrcPortStart | Integer | Yes | Yes | The start of the source port range. | Valid values: 0 to 65535. |
FingerPrintRuleId | String | No | Yes | The ID of the byte-match filter rule. | None. |
Offset | Integer | No | Yes | The offset. | Valid values: 0 to 1500. |
PayloadBytes | String | No | Yes | The payload. | None. |
RateValue | Integer | No | Yes | The rate limit. | Valid values: 1 to 100000. Note This property must be specified when MatchAction is set to ip_rate or session_rate. |
SourceLimit syntax
"SourceLimit": {
"Pps": Integer,
"SynBps": Integer,
"Bps": Integer,
"SynPps": Integer
}SourceLimit properties
Property | Type | Required | Editable | Description | Constraint |
Bps | Integer | No | Yes | The bandwidth limit on source IP addresses. | Unit: bytes per second. |
Pps | Integer | No | Yes | The packets per second (pps) limit on source IP addresses. | Unit: pps. |
SynBps | Integer | No | Yes | The bandwidth limit on source SYN packets. | Unit: bytes per second. |
SynPps | Integer | No | Yes | The pps limit on source SYN packets. | Unit: pps. |
SourceBlockList syntax
"SourceBlockList": [
{
"Type": Integer,
"ExceedLimitTimes": Integer,
"EverySeconds": Integer,
"BlockExpireSeconds": Integer
}
]SourceBlockList properties
Property | Type | Required | Editable | Description | Constraint |
BlockExpireSeconds | Integer | Yes | Yes | The validity period of the blacklist to which the source IP address is added. | Unit: seconds. |
ExceedLimitTimes | Integer | Yes | Yes | The number of times that the source IP address exceeds a limit within a statistical period. | None. |
EverySeconds | Integer | Yes | Yes | 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. |
Type | Integer | Yes | Yes | The type of the source rate limit. | Valid values:
|
Layer4RuleList syntax
"Layer4RuleList": [
{
"Action": String,
"ConditionList": List,
"Priority": Integer,
"Method": String,
"Limited": Integer,
"Name": String,
"Match": String
}
]Layer4RuleList properties
Property | Type | Required | Editable | Description | Constraint |
Action | String | Yes | Yes | The action. | Valid values:
|
ConditionList | List | Yes | Yes | The match conditions. | For more information, see ConditionList properties. |
Limited | Integer | Yes | Yes | The minimum number of bytes in a session to trigger matching. | Valid values: 0 to 2048. |
Method | String | Yes | Yes | The type of the rule. | Valid values:
|
Match | String | Yes | Yes | The condition based on which the action specified in the rule is performed. | Valid values:
|
Name | String | Yes | Yes | The name of the rule. | None. |
Priority | Integer | Yes | Yes | The priority of the rule. | Valid values: 1 to 100. Note A smaller value indicates a higher priority. |
ConditionList syntax
"ConditionList": [
{
"Position": Integer,
"Arg": String,
"Depth": Integer
}
]ConditionList properties
Property | Type | Required | Editable | Description | Constraint |
Arg | String | Yes | Yes | The term that is used for matching. | Note If you set Method to char, the value of Arg must be an ASCII string. If you set Method to hex, the value of Arg must be a hexadecimal string. The term can be up to 2,048 characters in length. |
Depth | Integer | Yes | Yes | The number of bytes from the start position for matching. | Valid values: 1 to 2048. |
Position | Integer | Yes | Yes | The start position for matching. | Valid values: 0 to 2047. |
Return values
Fn::GetAtt
Type: the type of the policy.
Content: the content of the policy.
PolicyName: the name of the policy.
PolicyId: the ID of the policy.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
PolicyName:
Description:
en: The name of the policy.
Required: true
Type: String
Default: test_policy_312
Resources:
ExtensionResource:
Properties:
Content:
EnableIntelligence: true
SourceBlockList:
- Type: 4
ExceedLimitTimes: 5
EverySeconds: 60
BlockExpireSeconds: 1200
- Type: 3
ExceedLimitTimes: 5
EverySeconds: 60
BlockExpireSeconds: 2400
- Type: 6
ExceedLimitTimes: 5
EverySeconds: 60
BlockExpireSeconds: 3360
- Type: 5
ExceedLimitTimes: 5
EverySeconds: 60
BlockExpireSeconds: 180
EnableDropIcmp: true
PortRuleList:
- SrcPortEnd: 65535
SrcPortStart: 0
SeqNo: 1
DstPortStart: 0
DstPortEnd: 65535
MatchAction: drop
Protocol: udp
- SrcPortEnd: 65535
SrcPortStart: 333
SeqNo: 2
DstPortStart: 666
DstPortEnd: 65535
MatchAction: drop
Protocol: tcp
IntelligenceLevel: weak
RegionBlockProvinceList:
- 11
ReflectBlockUdpPortList:
- 137
- 99
- 916
FingerPrintRuleList:
- SrcPortEnd: 65535
SrcPortStart: 56
SeqNo: 1
PayloadBytes: '16'
RateValue: 100
DstPortStart: 69
MatchAction: ip_rate
Offset: 56
MaxPktLen: 33
DstPortEnd: 65535
MinPktLen: 2
Protocol: tcp
SourceLimit:
Pps: 66
SynBps: 1024
Bps: 1024
SynPps: 66
BlackIpListExpireAt: 1734489860
PolicyName:
Ref: PolicyName
Type: ALIYUN::DDoS::Policy
Outputs:
Content:
Description: Configuration Content.
Value:
Fn::GetAtt:
- ExtensionResource
- Content
PolicyId:
Description: The ID of the policy.
Value:
Fn::GetAtt:
- ExtensionResource
- PolicyId
PolicyName:
Description: The name of the policy.
Value:
Fn::GetAtt:
- ExtensionResource
- PolicyName
Type:
Description: The type of the policy.
Value:
Fn::GetAtt:
- ExtensionResource
- Type
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"PolicyName": {
"Description": {
"en": "The name of the policy."
},
"Required": true,
"Type": "String",
"Default": "test_policy_312"
}
},
"Resources": {
"ExtensionResource": {
"Properties": {
"Content": {
"EnableIntelligence": true,
"SourceBlockList": [
{
"Type": 4,
"ExceedLimitTimes": 5,
"EverySeconds": 60,
"BlockExpireSeconds": 1200
},
{
"Type": 3,
"ExceedLimitTimes": 5,
"EverySeconds": 60,
"BlockExpireSeconds": 2400
},
{
"Type": 6,
"ExceedLimitTimes": 5,
"EverySeconds": 60,
"BlockExpireSeconds": 3360
},
{
"Type": 5,
"ExceedLimitTimes": 5,
"EverySeconds": 60,
"BlockExpireSeconds": 180
}
],
"EnableDropIcmp": true,
"PortRuleList": [
{
"SrcPortEnd": 65535,
"SrcPortStart": 0,
"SeqNo": 1,
"DstPortStart": 0,
"DstPortEnd": 65535,
"MatchAction": "drop",
"Protocol": "udp"
},
{
"SrcPortEnd": 65535,
"SrcPortStart": 333,
"SeqNo": 2,
"DstPortStart": 666,
"DstPortEnd": 65535,
"MatchAction": "drop",
"Protocol": "tcp"
}
],
"IntelligenceLevel": "weak",
"RegionBlockProvinceList": [
11
],
"ReflectBlockUdpPortList": [
137,
99,
916
],
"FingerPrintRuleList": [
{
"SrcPortEnd": 65535,
"SrcPortStart": 56,
"SeqNo": 1,
"PayloadBytes": "16",
"RateValue": 100,
"DstPortStart": 69,
"MatchAction": "ip_rate",
"Offset": 56,
"MaxPktLen": 33,
"DstPortEnd": 65535,
"MinPktLen": 2,
"Protocol": "tcp"
}
],
"SourceLimit": {
"Pps": 66,
"SynBps": 1024,
"Bps": 1024,
"SynPps": 66
},
"BlackIpListExpireAt": 1734489860
},
"PolicyName": {
"Ref": "PolicyName"
}
},
"Type": "ALIYUN::DDoS::Policy"
}
},
"Outputs": {
"Content": {
"Description": "Configuration Content.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Content"
]
}
},
"PolicyId": {
"Description": "The ID of the policy.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"PolicyId"
]
}
},
"PolicyName": {
"Description": "The name of the policy.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"PolicyName"
]
}
},
"Type": {
"Description": "The type of the policy.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Type"
]
}
}
}
}