All Products
Search
Document Center

Cloud Firewall:ModifyControlPolicy

Last Updated:Sep 02, 2024

Modifies the configurations of an access control policy.

Operation description

You can call this operation to modify the configurations of an access control policy. The policy allows Cloud Firewall to allow, deny, or monitor the traffic that passes through Cloud Firewall.

Limit

You can call this operation up to 10 times per second per account. If the number of the calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation.

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

Request parameters

ParameterTypeRequiredDescriptionExample
LangstringNo

The language of the content within the request and the response. Valid values:

  • zh: Chinese (default)
  • en: English
zh
AclActionstringYes

The action that Cloud Firewall performs on the traffic. Valid values:

  • accept: allows the traffic.
  • drop: denies the traffic.
  • log: monitors the traffic.
accept
ApplicationNamestringNo

The type of the application that the access control policy supports. Valid values:

  • ANY
  • HTTP
  • HTTPS
  • MySQL
  • SMTP
  • SMTPS
  • RDP
  • VNC
  • SSH
  • Redis
  • MQTT
  • MongoDB
  • Memcache
  • SSL
Note The value ANY indicates all types of applications.
Note You must specify one of the ApplicationNameList and ApplicationName parameters. If you configure both ApplicationNameList and ApplicationName, only the value of ApplicationNameList is used.
HTTP
DescriptionstringYes

The description of the access control policy.

test
DestPortstringNo

The destination port in the access control policy.

80
DestinationstringYes

The destination address in the access control policy.

  • If DestinationType is set to net, the value of Destination is a CIDR block. Example: 1.2.XX.XX/24.
  • If DestinationType is set to group, the value of Destination is an address book. Example: db_group.
  • If DestinationType is set to domain, the value of Destination is a domain name. Example: *.aliyuncs.com.
  • If DestinationType is set to location, the value of Destination is a location. For more information about the location codes, see the "AddControlPolicy" topic. Example: ["BJ11", "ZB"].
192.0.XX.XX/24
DestinationTypestringYes

The type of the destination address in the access control policy. Valid values:

  • net: CIDR block
  • group: address book
  • domain: domain name
  • location: location
net
DirectionstringYes

The direction of the traffic to which the access control policy applies. Valid values:

  • in: inbound traffic
  • out: outbound traffic
in
ProtostringYes

The protocol type that the access control policy supports. Valid values:

  • ANY
  • TCP
  • UDP
  • ICMP
Note The value ANY indicates all types of applications.
Note If the traffic direction is outbound and the destination address is a threat intelligence address book of the domain name type or a cloud service address book, you can set Proto to TCP or ANY. If you set Proto to TCP, you can set ApplicationName to HTTP, HTTPS, SMTP, SMTPS, and SSL. If you set Proto to ANY, you can set ApplicationName to ANY.
TCP
SourcestringYes

The source address in the access control policy.

  • If SourceType is set to net, the value of Source is a CIDR block. Example: 1.2.XX.XX/24.
  • If SourceType is set to group, the value of Source is an address book. Example: db_group.
  • If SourceType is set to location, the value of Source is a location. For more information about the location codes, see the "AddControlPolicy" topic. Example: ["BJ11", "ZB"]
192.0.XX.XX/24
AclUuidstringYes

The UUID of the access control policy.

Note To modify an access control policy, you must specify the UUID of the policy. You can call the DescribeControlPolicy interface to query the UUID.
00281255-d220-4db1-8f4f-c4df221ad84c
SourceTypestringYes

The type of the source address in the access control policy. Valid values:

  • net: CIDR block
  • group: address book
  • location: location
net
DestPortTypestringNo

The type of the destination port in the access control policy. Valid values:

  • port: port
  • group: port address book
port
DestPortGroupstringNo

The name of the destination port address book in the access control policy.

my_port_group
ReleasestringNo

The status of the access control policy. Valid values:

  • true: enabled
  • false: disabled
true
ApplicationNameListarrayNo

The application names.

Note You must specify one of the ApplicationNameList and ApplicationName parameters. If you configure both ApplicationNameList and ApplicationName, only the value of ApplicationNameList is used.
stringNo

The application name.

HTTP
RepeatTypestringNo

The recurrence type for the access control policy to take effect. Valid values:

  • Permanent (default): The policy always takes effect.
  • None: The policy takes effect for only once.
  • Daily: The policy takes effect on a daily basis.
  • Weekly: The policy takes effect on a weekly basis.
  • Monthly: The policy takes effect on a monthly basis.
Permanent
RepeatDaysarrayNo

The days of a week or of a month on which the access control policy takes effect.

  • If you set RepeatType to Permanent, None, or Daily, the value of this parameter is an empty array. Example: []
  • If you set RepeatType to Weekly, you must specify this parameter. Example: [0, 6]
Note If you set RepeatType to Weekly, the fields in the value of this parameter cannot be repeated.
  • If you set RepeatType to Monthly, you must specify this parameter. Example: [1, 31]
Note If you set RepeatType to Monthly, the fields in the value of this parameter cannot be repeated.
longNo

The day of a week or of a month on which the access control policy takes effect.

Note If you set RepeatType to Weekly, valid values of this parameter are 0 to 6. Each week starts from Sunday. If you set RepeatType to Monthly, valid values of this parameter are 1 to 31.
1
RepeatStartTimestringNo

The point in time when the recurrence starts. Example: 08:00. The value must be on the hour or on the half hour, and at least 30 minutes earlier than the value of RepeatEndTime.

Note If you set RepeatType to Permanent or None, leave this parameter empty. If you set RepeatType to Daily, Weekly, or Monthly, you must specify this parameter.
08:00
RepeatEndTimestringNo

The point in time when the recurrence ends. Example: 23:30. The value must be on the hour or on the half hour, and at least 30 minutes later than the value of RepeatStartTime.

Note If you set RepeatType to Permanent or None, leave this parameter empty. If you set RepeatType to Daily, Weekly, or Monthly, you must specify this parameter.
23:30
StartTimelongNo

The time when the access control policy starts to take effect. The value is a UNIX timestamp. Unit: seconds. The value must be on the hour or on the half hour, and at least 30 minutes earlier than the value of EndTime.

Note If you set RepeatType to Permanent, leave this parameter empty. If you set RepeatType to None, Daily, Weekly, or Monthly, you must specify this parameter.
1694761200
EndTimelongNo

The time when the access control policy stops taking effect. The value is a UNIX timestamp. Unit: seconds. The value must be on the hour or on the half hour, and at least 30 minutes later than the value of StartTime.

Note If you set RepeatType to Permanent, leave this parameter empty. If you set RepeatType to None, Daily, Weekly, or Monthly, you must specify this parameter.
1694764800
DomainResolveTypestringNo

The domain name resolution method of the access control policy. By default, an access control policy is enabled after the policy is created. Valid values:

  • FQDN: fully qualified domain name (FQDN)-based resolution
  • DNS: DNS-based dynamic resolution
  • FQDN_AND_DNS: FQDN and DNS-based dynamic resolution
FQDN

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D

Examples

Sample success responses

JSONformat

{
  "RequestId": "CBF1E9B7-D6A0-4E9E-AD3E-2B47E6C2837D"
}

Error codes

HTTP status codeError codeError messageDescription
400ErrorParametersUidThe aliUid parameter is invalid.The aliUid parameter is invalid.
400ErrorParametersDirectionThe direction is invalid.The direction is invalid.
400ErrorDBSelectAn error occurred while querying database.An error occurred while querying database.
400ErrorRecordLogAn error occurred while updating the operation log.An error occurred while updating the operation log.
400ErrorParametersError ParametersThe parameter is invalid.
400ErrorParametersSourceThe source is invalid.The source is invalid.
400ErrorParametersDestinationThe Destination parameter is invalid.The Destination parameter is invalid.
400ErrorParametersFtpNotSupportdomain destination not support ftp.FTP application is not supported when the policy destination is a domain name
400ErrorAclDomainAnyCountExceedThe 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.
400ErrorParametersAppIdThe AppId parameter is incorrect.The AppId parameter is invalid.
400ErrorAclNotExistThe ACL does not exist.The ACL does not exist.
400ErrorAclEffectiveTimeNonPermanentACL rule is not allowed to update status when effective is not permanent.ACL rule is not allowed to update status when effective is not permanent.
400ErrorParametersParameters error.Parameter error.
400ErrorAclExtendedCountExceedACL or extended ACL rules are not matched.The quota for access control policies or extra access control policies is exhausted.
400ErrorDBUpdateinternal error: sql updat.An error occurred while updating the database.
400ErrorDBInsertAn error occurred while performing an insert operation in the database.An error occurred while performing an insert operation in the database.
400ErrorMarshalJSONAn error occurred while encoding JSON.An error occurred while encoding JSON.

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

Change history

Change timeSummary of changesOperation
2024-08-22The Error code has changedView Change Details
2024-07-30The Error code has changedView Change Details
2024-07-25The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-12The Error code has changed. The request parameters of the API has changedView Change Details