All Products
Search
Document Center

Cloud Firewall:ModifyNatFirewallControlPolicy

Last Updated:Mar 01, 2024

Modifies the configurations of an access control policy that is created for a NAT firewall.

Operation description

You can use this operation to modify the configurations of an access control policy. The policy is used to allow, deny, or monitor traffic that reaches a NAT firewall.

Debugging

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

Authorization information

There is currently no authorization information disclosed in the API.

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.
log
DescriptionstringYes

The description of the access control policy. Fuzzy match is supported.

Note If you do not specify this parameter, the descriptions of all policies are queried.
test
DestPortstringNo

The destination port in the access control policy.

Note If DestPortType is set to port, you must specify this parameter.
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.3.4/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"]
x.x.x.x/32
DestinationTypestringYes

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

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

The ID of the NAT gateway.

ngw-xxxxxx
ProtostringYes

The protocol type supported by the access control policy. Valid values:

  • ANY
  • TCP
  • UDP
  • ICMP
Note The value ANY indicates all types of protocols.
TCP
SourcestringYes

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

  • If SourceType is set to net, the value of this parameter is a CIDR block. Example: 10.2.XX.XX/24.
  • If SourceType is set to group, the value of this parameter is an address book name. Example: db_group.
192.168.0.25/32
AclUuidstringYes

The UUID of the access control policy.

To modify the configurations of an access control policy, you must provide the UUID of the policy. You can call the DescribeNatFirewallControlPolicy operation to query the UUIDs of access control policies.

61ab1c02-926a-4d1b-9ef7-595eed8c4226
DirectionstringNo

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

  • Set the value to out.
out
SourceTypestringYes

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

  • net: CIDR block
  • group: address book
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_dest_port_group
ReleasestringNo

The status of the access control policy. Valid values:

  • true: enabled
  • false: disabled
true
ApplicationNameListarrayNo

The name of the application.

stringNo

The application types supported by the access control policy.

ANY
DomainResolveTypestringNo

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

  • 0: Fully qualified domain name (FQDN)-based resolution
  • 1: Domain Name System (DNS)-based dynamic resolution
  • 2: FQDN and DNS-based dynamic resolution
0
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 RepeatType is set to Permanent, None, or Daily, RepeatDays is left empty. Example: [].
  • If RepeatType is set to Weekly, RepeatDays must be specified. Example: [0, 6].
Note If RepeatType is set to Weekly, the fields in the value of RepeatDays cannot be repeated.
  • If RepeatType is set to Monthly, RepeatDays must be specified. Example: [1, 31].
Note If RepeatType is set to Monthly, the fields in the value of RepeatDays cannot be repeated.
longNo

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

Note If RepeatType is set to Weekly, valid values of this parameter are 0 to 6. Each week starts from Sunday. If RepeatType is set 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 RepeatType is set to Permanent or None, RepeatStartTime is left empty. If RepeatType is set to Daily, Weekly, or Monthly, this parameter must be specified.
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 RepeatType is set to Permanent or None, RepeatEndTime is left empty. If RepeatType is set to Daily, Weekly, or Monthly, RepeatEndTime must be specified.
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 RepeatType is set to Permanent, StartTime is left empty. If RepeatType is set to None, Daily, Weekly, or Monthly, StartTime must be specified.
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 RepeatType is set to Permanent, EndTime is left empty. If RepeatType is set to None, Daily, Weekly, or Monthly, EndTime must be specified.
1694764800

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

3868197C-E6E8-52CD-8358-05E3308430E2

Examples

Sample success responses

JSONformat

{
  "RequestId": "3868197C-E6E8-52CD-8358-05E3308430E2"
}

Error codes

HTTP status codeError codeError messageDescription
400ErrorParametersUidThe aliUid parameter is invalid.The aliUid parameter is invalid.
400ErrorDBSelectAn error occurred while querying database.An error occurred while querying database.
400ErrorParametersAppIdThe AppId parameter is incorrect.The AppId parameter is invalid.
400ErrorParametersSourceThe source is invalid.The source is invalid.
400ErrorParametersProtoThe protocol is invalid.The protocol is invalid.
400ErrorParametersDestinationThe Destination parameter is invalid.The Destination parameter is invalid.
400ErrorParametersDestPortThe dst_port is invalid.The dst_port is invalid.
400ErrorParametersActionThe action is invalid.The action is invalid.
400ErrorAddressCountExceedThe maximum number of addresses is exceeded.The maximum number of address is exceeded.
400ErrorAclNotExistThe ACL does not exist.The ACL does not exist.
400ErrorRecordLogAn error occurred while updating the operation log.An error occurred while updating the operation log.

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

Change history

Change timeSummary of changesOperation
2023-12-07The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Direction
2023-10-12The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: RepeatType
    Added Input Parameters: RepeatDays
    Added Input Parameters: RepeatStartTime
    Added Input Parameters: RepeatEndTime
    Added Input Parameters: StartTime
    Added Input Parameters: EndTime