More Info:

Security groups should not have all ports or protocols open to the public. Security groups should be created on a per-service basis and avoid allowing all ports or protocols.

Risk Level

Medium

Address

Security

Compliance Standards

NIST

Triage and Remediation

Remediation

To remediate the issue of ports being open for external traffic in AWS Security Groups, follow these steps using the AWS Management Console:

  1. Sign in to the AWS Management Console.
  2. Navigate to the EC2 dashboard.
  3. In the navigation pane, under the ‘Network & Security’ section, click on ‘Security Groups’.
  4. Select the security group that has the open ports for external traffic that you want to remediate.
  5. Click on the ‘Inbound rules’ tab.
  6. Identify the rule that allows external traffic (0.0.0.0/0) to access the specific port(s).
  7. Click on the ‘Edit inbound rules’ button.
  8. Select the rule that allows the unwanted external traffic and click on the ‘Delete’ button to remove it.
  9. Click on the ‘Save rules’ button to apply the changes.
  10. Verify that the rule allowing external traffic to the specific port(s) has been removed successfully.

By following these steps, you have successfully remediated the issue of ports being open for external traffic in the AWS Security Group.

Additional Reading: