Update a security group and rules
The feature is at the Preview stage.
After creating a cloud network, you can change its name and description, and add or remove rules.
Changing the name and description
Management console
СLI
- Open the Virtual Private Cloud section in the folder to update the security group in.
- Open the Security groups tab.
- Click in the row of the group you want to update.
- In the menu that opens, click Edit.
To update the security group, run the command:
$ yc vpc security-group update <group ID> --new-name test-sg-renamed
Add a new rule
Management console
СLI
- Open the Virtual Private Cloud section in the folder to update the security group in.
- Open the Security groups tab.
- Select the group to update.
- Under Rules, create traffic management rules:
- Select the Outgoing traffic or Incoming traffic tab.
- Click Add rule.
- In the Port field of the window that opens, specify a single port or a range of ports that traffic will come to or from.
- In the Protocol field, specify the desired protocol or leave Any to allow traffic transmission over any protocol.
- In the Purpose field, select the purpose of the rule:
- CIDR: The rule will apply to the range of IP addresses. In the CIDR blocks field, specify the CIDR and masks of subnets that traffic will come to or from. To add multiple CIDRs, click Add CIDR.
- Security group: The rule will apply to the VMs from the current group or the selected security group.
- Click Save.
To add a new rule to an existing group, specify its ID or name in the command and describe the new rule:
$ yc vpc security-group update-rules --name=test-sg-cli --add-rule "direction=ingress,port=443,protocol=tcp,v4-cidrs=[10.0.0.0/24,10.10.0.0/24]"
Delete a rule
Management console
СLI
- Open the Virtual Private Cloud section in the folder to update the security group in.
- Open the Security groups tab.
- Select the group to update.
- Under Rules, click in the row of the rule you want to delete.
- In the menu that opens, click Delete.
- In the window that opens, click Delete.
To delete a rule from a group, specify its ID in the command:
$ yc vpc security-group update-rules --name=test-sg-cli --delete-rule-id <rule ID>