A security group is a set of rules that controls the network traffic going in and out of your virtual machines (VMs). It decides:
- What kind of incoming traffic is allowed to reach your VM.
- What kind of outgoing traffic is allowed from your VM.
Every project automatically has a default security group that allows all traffic on all ports and can’t be deleted.
You can create custom security groups with specific rules and apply them to your VMs. Any changes you make to the rules take effect right away.
Note: These rules only apply to IPv4 traffic, not IPv6.
This task can be done only from the Advanced Dashboard

To go on the advanced dashboard you have to go from CMP(main dashboard)
Go to the VM section
Step 1

Note:
By default, the new security group will deny all incoming traffic and allow only outgoing traffic to assigned virtual machines.
You can modify the security group Go to the VM section and select the VM to which you want to add the security group
Step 2

click on the edit button
Step 3

Again click on the edit button
Step 4

By clicking on the edit button you will be able to see all Security Groups Which you have created in the security group section. you can select the Security Groups As per your requirement
For More details Follow the link