To remediate the misconfiguration of the default security group being publicly accessible in AWS, follow these steps using the AWS Management Console:
Sign in to the AWS Management Console: Go to https://aws.amazon.com/ and sign in to your AWS account.
Navigate to the EC2 Dashboard: Click on the “Services” dropdown menu at the top left corner of the console, select “EC2” under the Compute section.
Access the Security Groups: In the EC2 Dashboard, locate and click on the “Security Groups” option in the left-hand navigation pane.
Identify the Default Security Group: Look for the default security group in the list of security groups. The default security group has the name “default” and is associated with all new instances that are launched in the VPC.
Edit Inbound Rules: Click on the default security group to select it, and then navigate to the “Inbound Rules” tab at the bottom of the console.
Remove Publicly Accessible Rules: Identify any inbound rules that allow unrestricted access from the internet (0.0.0.0/0 or ::/0) and remove them. This includes rules allowing SSH (port 22), RDP (port 3389), HTTP (port 80), HTTPS (port 443), etc.
Add Necessary Rules: Add specific inbound rules that allow access only from trusted sources, such as your organization’s IP addresses or specific security groups within your VPC.
Save the Changes: After making the necessary changes to the inbound rules, click on the “Save rules” button to apply the changes to the default security group.
Verify Changes: Double-check the inbound rules to ensure that only necessary and restricted access is allowed to the default security group.
By following these steps, you can remediate the misconfiguration of the default security group being publicly accessible in AWS and enhance the security of your cloud environment.
Get the Group ID of the default security group from the output of the above command.
Update the inbound rules of the default security group to restrict access. You can remove the existing rules or update them to allow access only from specific IP ranges or security groups. For example, to remove all inbound rules from the default security group:
Copy
Ask AI
aws ec2 revoke-security-group-ingress --group-id <YOUR_DEFAULT_SECURITY_GROUP_ID> --protocol -1 --source-group all
Verify that the inbound rules have been updated successfully by describing the security group: