ModifyNatFirewallControlPolicy

Updated at:

Modifies the configuration of an access control policy for a NAT firewall.

Operation description

This operation is typically used to modify the configuration of an access control policy that allows, denies, or monitors traffic passing through a NAT firewall.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

yundun-cloudfirewall:ModifyNatFirewallControlPolicy

update

*NatFirewallControlPolicy

acs:cloudfirewall::{#accountId}:natfirewallcontrolpolicy/{#AclUuid}

None None

Request parameters

Parameter

Type

Required

Description

Example

Lang

string

No

The language of the request and response. Valid values:

  • zh (default): Chinese.

  • en: English.

zh

AclAction

string

No

The action that Cloud Firewall performs on traffic in the access control policy. Valid values:

  • accept: Allows the traffic.

  • drop: Denies the traffic.

  • log: Monitors the traffic.

log

Description

string

No

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 description

DestPort

string

No

The destination port for traffic in the access control policy of the virtual private cloud (VPC) firewalls.

Note

Specify this parameter when DestPortType is set to port.

80

Destination

string

No

The destination address in the access control policy.

  • If DestinationType is set to net, Destination is the destination CIDR block. Example: 1.2.3.4/24.

  • If DestinationType is set to group, Destination is the name of the destination address book. Example: db_group.

  • If DestinationType is set to domain, Destination is the destination domain name. Example: *.aliyuncs.com.

  • If DestinationType is set to location, Destination is the destination region. For the region codes, see the following section. Example: ["BJ11", "ZB"].

x.x.x.x/32

DestinationType

string

No

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

  • net: destination CIDR block.

  • group: destination address book.

  • domain: destination domain name.

  • location: destination region.

net

NatGatewayId

string

Yes

The ID of the NAT gateway.

ngw-xxxxxx

Proto

string

No

The type of the security protocol for traffic in the access control policy. Supported protocol types:

  • ANY

  • TCP

  • UDP

  • ICMP

Note

ANY indicates that the policy applies to all types of applications. If the destination address is a threat intelligence address book or a cloud service address book of the domain name type, you can set this parameter to TCP. If you select TCP, you can select HTTP, HTTPS, SMTP, SMTPS, or SSL as the application.

TCP

Source

string

No

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

  • If SourceType is set to net, Source is the source CIDR block. Example: 10.2.XX.XX/24.

  • If SourceType is set to group, Source is the name of the source address book. Example: db_group.

10.2.XX.XX/24

AclUuid

string

Yes

The UUID of the access control policy. To delete an access control policy, you must provide the UUID of the policy. You can call the DescribeNatFirewallControlPolicy operation to obtain the UUID.

63ab1c02-926a-4d1b-9ef7-*****

Direction

string

No

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

  • out: outbound traffic.

out

SourceType

string

No

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

  • net: source CIDR block.

  • group: source address book.

net

DestPortType

string

No

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

  • port: port.

  • group: port address book.

port

DestPortGroup

string

No

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

my_dest_port_group

Release

string

No

The status of the access control policy. Valid values:

  • true: The policy is enabled.

  • false: The policy is disabled.

true

ApplicationNameList

array

No

The names of the applications.

string

No

The list of application types supported by the access control policy.

ANY

DomainResolveType

string

No

The domain name resolution method of the access control policy. Valid values:

  • 0: FQDN-based resolution.

  • 1: DNS-based dynamic resolution.

  • 2: FQDN and DNS-based dynamic resolution.

Note

If the domain name identification mode includes FQDN, only the TCP protocol is allowed. You can select HTTP, HTTPS, SMTP, SMTPS, SSL, IMAPS, or POPS as the application.

0

RepeatType

string

No

The recurrence type of the policy validity period for the access control policy. Valid values:

  • Permanent (default): Always.

  • None: Specified single time.

  • Daily: Every day.

  • Weekly: Every week.

  • Monthly: Every month.

Valid values:

  • Daily :

    Every day.

  • Monthly :

    Every month.

  • Permanent :

    Always.

  • Weekly :

    Every week.

  • None :

    Specified single time.

Permanent

RepeatDays

array

No

The set of recurrence days for the policy validity period of the access control policy.

  • If RepeatType is set to Permanent, None, or Daily, RepeatDays is an empty set. Example: [].

  • If RepeatType is set to Weekly, RepeatDays cannot be empty. Example: [0, 6].

Note

If RepeatType is set to Weekly, the values in RepeatDays must be unique.

  • If RepeatType is set to Monthly, RepeatDays cannot be empty. Example: [1, 31].

Note

If RepeatType is set to Monthly, the values in RepeatDays must be unique.

integer

No

The recurrence day for the policy validity period of the access control policy.

Note

If RepeatType is set to Weekly, valid values are 0 to 6. A week starts on Sunday. If RepeatType is set to Monthly, valid values are 1 to 31.

1

RepeatStartTime

string

No

The recurrence start time when the policy takes effect. Use the 24-hour time format HH:mm, such as 08:00. The time must be on the hour or half-hour, and must be at least 30 minutes earlier than the recurrence end time.

Note

If RepeatType is set to Permanent or None, RepeatStartTime is empty. If RepeatType is set to Daily, Weekly, or Monthly, RepeatStartTime must be specified.

08:00

RepeatEndTime

string

No

The recurrence end time when the policy takes effect. Use the 24-hour time format HH:mm, such as 23:30. The time must be on the hour or half-hour, and must be at least 30 minutes later than the recurrence start time.

Note

If RepeatType is set to Permanent or None, RepeatEndTime is empty. If RepeatType is set to Daily, Weekly, or Monthly, RepeatEndTime must be specified.

23:30

StartTime

integer

No

The start time of the policy validity period for the access control policy. Specify the time in the UNIX timestamp format (seconds). The time must be on the hour or half-hour, and must be at least 30 minutes earlier than the end time.

Note

If RepeatType is set to Permanent, StartTime is empty. If RepeatType is set to None, Daily, Weekly, or Monthly, StartTime must be specified.

1694761200

EndTime

integer

No

The end time of the policy validity period for the access control policy. Specify the time in the UNIX timestamp format (seconds). The time must be on the hour or half-hour, and must be at least 30 minutes later than the start time.

Note

If RepeatType is set to Permanent, EndTime is empty. If RepeatType is set to None, Daily, Weekly, or Monthly, EndTime must be specified.

1694764800

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

3768197C-E6E8-52CD-8358-*****

Examples

Success response

JSON format

{
  "RequestId": "3768197C-E6E8-52CD-8358-*****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 ErrorParametersUid The aliUid parameter is invalid. The aliUid parameter is invalid.
400 ErrorDBSelect An error occurred while querying database. An error occurred while querying database.
400 ErrorParametersSource The source is invalid. The source is invalid.
400 ErrorParametersProto The protocol is invalid. The protocol is invalid.
400 ErrorParametersDestination The Destination parameter is invalid. The Destination parameter 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 ErrorAddressCountExceed The maximum number of addresses is exceeded. The maximum number of address is exceeded.
400 ErrorAclNotExist The ACL does not exist. The ACL does not exist.
400 ErrorRecordLog An error occurred while updating the operation log. An error occurred while updating the operation log.
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 ErrorAclExtendedCountExceed ACL or extended ACL rules are not matched. ACL or extended ACL rules are not matched.
400 ErrorAclEffectiveTimeNonPermanent ACL 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.
400 ErrorParametersNatGatewayId Invalid parameters NatGatewayId. Invalid parameters NatGatewayId.
400 ErrorUUIDNew The UUID is invalid. The UUID is invalid.
400 ErrorParameterIpVersion The IP version is invalid. The IP version is invalid.
400 ErrorParametersDirection The direction is invalid. The direction is invalid.
400 ErrorDomainResolve An error occurred while resolving the domain. An error occurred while resolving the domain.
400 ErrorParameters Parameters error. Parameter error.
400 ErrorDBInsert An error occurred while performing an insert operation in the database. An error occurred while performing an insert operation in the database.
400 ErrorDBUpdate internal error: sql updat. An error occurred while updating the database.
400 ErrorParametersFtpNotSupport domain destination not support ftp. FTP application is not supported when the policy destination is a domain name
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 ErrorParametersAclUuid Specified parameter AclUuid is not valid. Specified parameter AclUuid 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 ErrorParametersDomainResolveType The DomainResolveType parameter is invalid.
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.
400 ErrorNatAclSecurityProfileUnsupported The specified NAT firewall does not support associating application or web filter templates. The specified NAT firewall does not support associating application or web filter templates.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.