You can configure security group rules in an Excel file and import the rules to a security group. You can also export security group rules to an Excel file.
You can import and export security group rules in the following scenarios:
in the upper left corner and choose Network > Virtual Private Cloud.The Virtual Private Cloud page is displayed.
The security group list is displayed.
The security group details page is displayed.
You can choose to export all rules or rules whose source or destination is IP addresses. Direction Priority Action Type Protocol & Port Source/Destination Export Description Inbound 1 Allow IPv4 All Source: Security group (Sg-A) This rule will be filtered out and excluded from export. Inbound 1 Allow IPv6 All Source: Security group (Sg-A) This rule will be filtered out and excluded from export. Inbound 1 Allow IPv6 All Source: Security group (Sg-B) This rule will be filtered out and excluded from export. Inbound 1 Allow IPv4 ICMP: All Source: IP address (0.0.0.0/0) This rule will not be filtered out and will be included in the export. Inbound 1 Allow IPv4 TCP: 22 Source: IP address group (ipGroup-A) This rule will be filtered out and excluded from export. Outbound 1 Allow IPv4 All Source: IP address (0.0.0.0/0) This rule will not be filtered out and will be included in the export. Outbound 1 Allow IPv6 All Source: IP address (::/0) This rule will not be filtered out and will be included in the export.
Table 2 describes the parameters in the template for importing rules.
Parameter | Description | Example Value |
|---|---|---|
Direction | The direction in which the security group rule takes effect. | Inbound |
Priority | The priority value ranges from 1 to 100. The default value is 1, which has the highest priority. The security group rule with a smaller value has a higher priority. | 1 |
Action | The value can be Allow or Deny. | Allow |
Type | Source IP address version. You can select: | IPv4 |
Protocol & Port | The network protocol used to match traffic in a security group rule. The protocol can be All, TCP, UDP, GRE, or ICMP. | TCP |
Destination port used to match traffic in a security group rule. The value can be from 1 to 65535. Inbound rules control incoming traffic over specific ports to instances in the security group. Outbound rules control outgoing traffic over specific ports from instances in the security group. | 22, 22-30 | |
Source | Source of the security group rule. The value can be IP address, Security group, or IP address group, to allow access from the IP addresses or the instances in the security group. | sg-test[96a8a93f-XXX-d7872990c314] |
Destination | Destination of the security group rule. The value can be IP address, Security group, or IP address group, to allow access to the IP addresses or the instances in the security group. | sg-test[96a8a93f-XXX-d7872990c314] |
Description | (Optional) Supplementary information about the security group rule. The security group rule description can contain a maximum of 255 characters and cannot contain angle brackets (< or >). | - |