A specific rule stating that the VPC default security group must restrict inbound and outbound traffic to ensure security.
Rule | The VPC default security group should not allow inbound and outbound traffic |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ High |
Rule Description:
The VPC default security group should not allow inbound and outbound traffic. This rule ensures that the default security group, which is created automatically when setting up a VPC (Virtual Private Cloud) in AWS, is configured properly to maintain a secure network environment.
Remediation:
To remediate this issue, follow the step-by-step guide provided below:
Troubleshooting Steps:
If the VPC default security group is not properly configured and still allows inbound and outbound traffic after following the remediation steps above, perform the following troubleshooting steps:
Additional Information:
To automate the remediation process or perform it programmatically using the AWS CLI (Command Line Interface), you can utilize the following AWS CLI commands:
To remove the unwanted inbound rule:
aws ec2 revoke-security-group-ingress --group-id <your-security-group-id> --protocol -1 --port -1 --source-group <your-security-group-id>
To remove the unwanted outbound rule:
aws ec2 revoke-security-group-egress --group-id <your-security-group-id> --protocol -1 --port -1 --destination-group <your-security-group-id>
Replace "<your-security-group-id>" with the actual ID of the default security group.