More Info:

Unknown EC2 instances should not be publicly accessible. It is good practice to maintain a list of known, publicly accessible instances and flag all other instances that meet this criteria.

Risk Level

Medium

Address

Security

Compliance Standards

HIPAA, NIST, SOC2

Triage and Remediation

Remediation

To remediate the misconfiguration of EC2 instances being publicly accessible in AWS Security Groups, follow these steps using the AWS Management Console:

  1. Login to AWS Console: Go to the AWS Management Console (https://aws.amazon.com/console/) and log in to your account.

  2. Navigate to EC2 Dashboard: Go to the EC2 Dashboard by clicking on the “Services” dropdown menu at the top left corner, selecting “EC2” under the Compute section.

  3. Identify the EC2 Instance: Identify the EC2 instance(s) that are publicly accessible. You can do this by checking the “Instance State” and “Instance Type” columns in the EC2 Dashboard.

  4. Identify Security Group: Click on the EC2 instance that you want to remediate and scroll down to the “Description” tab. Under the Security group section, you will see the security group associated with the EC2 instance.

  5. Edit Security Group Rules: Click on the security group associated with the EC2 instance. This will take you to the “Inbound” tab of the security group.

  6. Remove Public Access: Identify the rule that allows public access (e.g., SSH port 22 or HTTP port 80) and click on the “Edit” button.

  7. Modify Rule: In the Edit inbound rules window, select the rule that allows public access and click on the “Delete” button to remove it.

  8. Save Changes: Click on the “Save rules” button to apply the changes to the security group.

  9. Verify Changes: Go back to the EC2 Dashboard, select the EC2 instance, and verify that it is no longer publicly accessible by checking the public IP address field.

  10. Repeat for Other Instances: Repeat the above steps for any other EC2 instances that are publicly accessible.

By following these steps, you have successfully remediated the misconfiguration of EC2 instances being publicly accessible in AWS Security Groups.

Additional Reading: