AddControlPolicy
Creates an access control policy.
Operation description
You can use this operation to create a policy that allows, denies, or monitors traffic passing through Cloud Firewall.
QPS limits
The QPS limit for a single user is 10 calls per second. If the limit is exceeded, API calls are throttled, which may affect your services. Call this operation at a reasonable frequency.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
yundun-cloudfirewall:AddControlPolicy |
create |
*ControlPolicy
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. |
ddadxefexxxx |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. |
|
SourceIp
deprecated
|
string |
No |
The source IP address of the request. |
192.0.XX.XX |
| Lang |
string |
No |
The language of the request and response. Valid values:
|
zh |
| AclAction |
string |
Yes |
The action that Cloud Firewall performs on traffic based on the access control policy. Valid values:
|
accept |
ApplicationName
deprecated
|
string |
No |
The application type supported by the access control policy. Valid values:
Note
The supported application types depend on the protocol type specified by the Proto parameter. If Proto is set to TCP, ApplicationName can be set to any of the preceding application types. If Proto is set to UDP, ICMP, or ANY, ApplicationName can only be set to ANY. You must specify either ApplicationNameList or ApplicationName. You cannot leave both parameters empty. |
ANY |
| Description |
string |
Yes |
The description of the access control policy. |
Release flow |
| DestPort |
string |
No |
The destination port for traffic in the access control policy. Valid values:
Note
If the protocol type is ICMP, access control on destination ports is not supported.
Note
If you set the destination port type to group (destination port address book), you do not need to specify a destination port number. All ports managed by the access control policy are included in the destination port address book.
|
80 |
| Destination |
string |
Yes |
The destination address in the access control policy. Valid values:
Note
If Destination specifies a destination location, for more information, see Location codes. |
192.0.XX.XX/24 |
| DestinationType |
string |
Yes |
The destination address type in the access control policy. Valid values:
|
net |
| Direction |
string |
Yes |
The traffic direction of the access control policy. Valid values:
|
in |
| Proto |
string |
Yes |
The protocol type of traffic in the access control policy. Valid values:
Note
If the traffic direction is outbound and the destination address is a domain name in a threat intelligence address book or a cloud service address book, you can only set Proto to TCP. In this case, you can set the application type to HTTP, HTTPS, SMTP, SMTPS, or SSL. |
ANY |
| Source |
string |
Yes |
The source address in the access control policy. Valid values:
Note
For more information about source regions, see Region codes. |
192.0.XX.XX/24 |
| SourceType |
string |
Yes |
The type of the source address in the access control policy. Valid values:
|
net |
| NewOrder |
string |
Yes |
The priority of the access control policy. The priority value starts from 1 and increases sequentially. A smaller value indicates a higher priority. |
1 |
| DestPortType |
string |
No |
The type of the destination port in the access control policy. Valid values:
|
port |
| DestPortGroup |
string |
No |
The name of the destination port address book in the access control policy. Note
If DestPortType is set to group, you must specify the name of the destination port address book. |
my_port_group |
| Release |
string |
No |
Specifies whether to enable the access control policy. By default, the policy is enabled after it is created. Valid values:
|
true |
| IpVersion |
string |
No |
The IP address version. Valid values:
|
6 |
| ApplicationNameList |
array |
No |
The list of application types supported by the access control policy. |
|
|
string |
No |
The application types supported by the access control policy. Valid values:
Note
The valid values for the supported application types depend on the protocol type (Proto). If Proto is set to TCP, ApplicationNameList supports all the preceding application types, specified in the |
["ANY"] |
|
| RepeatType |
string |
No |
The repeat type of the Policy Validity Period for the access control policy. Valid values:
Valid values:
|
Permanent |
| RepeatDays |
array |
No |
The set of repeat days for the Policy Validity Period of the access control policy.
Note
When RepeatType is set to Weekly, the values in RepeatDays must be unique.
Note
When RepeatType is set to Monthly, the values in RepeatDays must be unique. |
|
|
integer |
No |
The repeat day for the Policy Validity Period of the access control policy. Note
When RepeatType is set to |
1 |
|
| RepeatStartTime |
string |
No |
The repeat start time for the Policy Validity Period of the access control policy. Example: 08:00. The time must be on the hour or half hour, and must be at least 30 minutes earlier than the repeat end time. Note
When RepeatType is set to |
08:00 |
| RepeatEndTime |
string |
No |
The repeat end time for the Policy Validity Period of the access control policy. Example: 23:30. The time must be on the hour or half hour, and must be at least 30 minutes later than the repeat start time. Note
When RepeatType is set to |
23:30 |
| StartTime |
integer |
No |
The start time of the Policy Validity Period for the access control policy. The time is expressed in the UNIX timestamp in seconds format. The time must be on the hour or half hour, and must be at least 30 minutes earlier than the end time. Note
When RepeatType is set to |
1694761200 |
| EndTime |
integer |
No |
The end time of the Policy Validity Period for the access control policy. The time is expressed in the UNIX timestamp in seconds format. The time must be on the hour or half hour, and must be at least 30 minutes later than the start time. Note
When RepeatType is set to |
1694764800 |
| DomainResolveType |
string |
No |
The domain name resolution mode of the access control policy. Valid values:
Valid values:
|
FQDN |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| AclUuid |
string |
The unique ID of the access control policy for the Internet border firewall. |
00281255-d220-4db1-8f4f-c4df221ad84c |
| RequestId |
string |
The ID of the request. |
CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D |
Examples
Success response
JSON format
{
"AclUuid": "00281255-d220-4db1-8f4f-c4df221ad84c",
"RequestId": "CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ErrorAddressCountExceed | The maximum number of addresses is exceeded. | The maximum number of address is exceeded. |
| 400 | ErrorParametersSource | The source is invalid. | The source is invalid. |
| 400 | ErrorDomainResolve | An error occurred while resolving the domain. | An error occurred while resolving the domain. |
| 400 | ErrorParametersDirection | The direction is invalid. | The direction is invalid. |
| 400 | ErrorDBSelect | An error occurred while querying database. | An error occurred while querying database. |
| 400 | ErrorParameterIpVersion | The IP version is invalid. | The IP version is invalid. |
| 400 | ErrorParametersDestination | The Destination parameter is invalid. | The Destination parameter is invalid. |
| 400 | ErrorParametersProto | The protocol is invalid. | The protocol is invalid. |
| 400 | ErrorParametersDestPort | The dst_port is invalid. | The dst_port is invalid. |
| 400 | ErrorParametersAction | The action is invalid. | The action is invalid. |
| 400 | ErrorParametersUid | The aliUid parameter is invalid. | The aliUid parameter is invalid. |
| 400 | ErrorAclDomainAnyCountExceed | The number of resolved domain names cannot exceed 200. ACL configuration can be continued for HTTP, HTTPS, SMTP, SMTPS, and SSL applications. | The domain name is resolved to more than 200 IP addresses. We recommend that you set Application in your access control policy to HTTPS, HTTPS, SMTP, SMTPS, or SSL. |
| 400 | ErrorParametersGroupPort | The group port is invalid. | The group port is invalid. |
| 400 | ErrorParametersFtpNotSupport | domain destination not support ftp. | FTP application is not supported when the policy destination is a domain name |
| 400 | ErrorAclExtendedCountExceed | ACL or extended ACL rules are not matched. | ACL or extended ACL rules are not matched. |
| 400 | ErrorParametersDestinationCount | Exceeding the number of countries in a single ACL. | Exceeds the number of selected areas for one ACL. It is recommended to split it into multiple ACLs. |
| 400 | ErrorSrcMand | Source is mandatory for this action. | This operation requires the specified source. |
| 400 | ErrorEmptyDomainResolveType | Empty DomainResolveType only support HTTP/HTTPS/SSL/SMTP/SMTPS apps. | Empty domain name resolution mode is not supported. |
| 400 | ErrorAddressGroupNotExist | The address group does not exist. | The address group does not exist. |
| 400 | ErrorParametersApplicationNameList | Specified parameter ApplicationNameList is not valid. | Specified parameter ApplicationNameList is not valid. |
| 400 | ErrorParametersApplicationName | Specified parameter ApplicationName is not valid. | Specified parameter ApplicationName is not valid. |
| 400 | ErrorApplicationTemplateNotFound | Application template not found. | Application template does not exist |
| 400 | ErrorWebFilterTemplateNotFound | Web filter template not found. | Web filtering template does not exist |
| 400 | ErrorParameters | Parameters error. | Parameter error. |
| 400 | InvalidClientToken | ClientToken format invalid. Only ASCII letters, digits, hyphens and underscores are allowed, max 64 characters. | |
| 400 | IdempotentParameterMismatch | The request uses the same client token as a previous, but non-identical request. Do not reuse a client token with different requests, unless the requests are identical. | This request uses the same client token as the previous request, but not the same. Do not reuse client tokens in different requests unless the request is the same. |
| 400 | ErrorStartTimeOrEndTime | The start time or end time is invalid. The time must be the hour or half hour, and the start time must be 30 minutes earlier than the end time. | The start time or end time is invalid. The time must be an hour or half an hour, and the start time must be 30 minutes earlier than the end time. |
| 409 | IdempotentToken.Processing | A previous request with the same ClientToken is still being processed. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.