Importing and Exporting Security Group Rules
Scenarios
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:
- If you want to back up security group rules locally, you can export the rules to an Excel file.
- If you want to quickly create or restore security group rules, you can import your security group rule file to the security group.
- If you want to quickly apply the rules of one security group to another, you can export and import existing rules.
- If you want to modify multiple rules of a security group at a time, you can export the rules, modify the rules in the Excel file, and import the Excel file again.
Constraints
- The security group rules to be imported must be configured based on the template. Do not add parameters or change existing parameters. Otherwise, the import will fail.
- If Source of a security group rule to be imported is IP address group, ensure that the IP address group exists and its name and ID are correct. You must specify the IP address group in the format of IP address group name[IP address group ID]. An example is ipGroup-test[96a8a93f-XXX-d7872990c314].
- If Source of a security group rule to be imported is Security group, ensure that the security group exists and its name and ID are correct. You must specify the security group in the format of Security group name[Security group ID]. An example is sg-test[96a8a93f-XXX-d7872990c314].
- If a security group rule to be imported is the same as an existing one, the security group rule cannot be imported. You can delete the rule and try again.
Procedure
- Log in to the management console.
- Click
in the upper left corner and select the region and project. - Click
in the upper left corner and choose Network > Virtual Private Cloud. The Virtual Private Cloud page is displayed.
- In the navigation pane on the left, choose Access Control > Security Groups.
The security group list is displayed.
- On the security group list, click the name of the target security group.
- Perform the following operations to import or export security group rules.
- Click Export Rule to export rules of the current security group to an Excel file.
- Click Import Rule to import security group rules from an Excel file into the current security group. Table 1 describes the parameters in the template for importing rules.
Table 1 Parameters in the security group rule import template Parameter
Description
Example Value
Direction
The direction in which the security group rule takes effect.- Inbound: Inbound rules control incoming traffic to instances in the security group.
- Outbound: Outbound rules control outgoing traffic from instances in the security group.
Inbound
Type
Source IP address version. You can select:- IPv4
- IPv6
IPv4
Protocol & Port
The network protocol used to match traffic in a security group rule. The protocol can be TCP, UDP, ICMP, or GRE.
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 or Security group, to allow access from the IP addresses or the instances in the security group. If you select IP address for Source, you can enter multiple IP addresses in the IP address box. Each IP address represents a different security group rule.- IP address:
- Single IP address: 192.168.10.10/32
- All IP addresses: 0.0.0.0/0
- IP address range: 192.168.1.0/24
sg-test[96a8a93f-XXX-d7872990c314]
Destination
Destination of the security group rule. The value can be IP address or Security group, to allow access to the IP addresses or the instances in the security group. If you select IP address for Destination, you can enter multiple IP addresses in the IP address box. Each IP address represents a different security group rule.
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 >).
-
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot