Excessive Security Groups

Quick Info

Plugin TitleExcessive Security Groups
CategoryNetwork Security Groups
DescriptionDetermines if there are an excessive number of security groups in the account
More InfoKeeping the number of security groups to a minimum helps reduce the attack surface of an account. Rather than creating new groups with the same rules for each project, common rules should be grouped under the same security groups. For example, instead of adding port 22 from a known IP to every group, create a single “SSH” security group which can be used on multiple instances.
Recommended ActionLimit the number of security groups to prevent accidental authorizations.

Detailed Remediation Steps

  1. Log into the Microsoft Azure Management Console.
  2. Select the “Search resources, services, and docs” option at the top and search for Network security groups.
  3. Verify the number of Security Groups which are having the same security rules and used separately.
  4. Click on the “Name” of the selected “Network security group” to access the port configurations.
  5. In the “Overview” tab scroll down the page and check the “Inbound security rules.”
  6. Copy the Inbound and Outbound “security rules” which are in common in both the security groups.
  7. Repeat steps number 2 - 6 to verify other “Security Groups” in the account.
  8. Navigate to the “Network security group” and click on the “Add” button at the top to add new security groups having common security rules.
  9. On the “Create a network security group” page enter the details Resource Group, Name, Details and click on the “Review+Create” button to make the changes.
  10. Click on the newly created “Network Security Group” and select the “Inbound security rules” under Security. <img src="/resources/azure/networksecuritygroups/excessive-security-groups/step10.png)
  11. Click on the “Add” button at the top and paste the rules copied in Step 6.
  12. Once the new security group has all the same rules, navigate to the “Resources” using those Security Groups and change the groups accordingly.
  13. Navigate to “Network Security Group” and delete the old “Security Groups” to prevent accidental authorizations.
  14. Repeat steps number 8 - 13 to limit the number of security groups to prevent accidental authorizations.