Source
CloudSploit
ID
excessive-security-groups

Excessive Security Groups

Determines if there are an excessive number of security groups in the account

Keeping 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.

Follow the appropriate remediation steps below to resolve the issue.

  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. Step

  3. Verify the number of Security Groups which are having the same security rules and used separately. Step

  4. Click on the “Name” of the selected “Network security group” to access the port configurations. Step

  5. In the “Overview” tab scroll down the page and check the “Inbound security rules.” Step

  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.Step

  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.Step

  10. Click on the newly created “Network Security Group” and select the “Inbound security rules” under Security.

  11. Click on the “Add” button at the top and paste the rules copied in Step 6. Step

  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.Step

  14. Repeat steps number 8 - 13 to limit the number of security groups to prevent accidental authorizations.