This rule ensures only authorized ports have unrestricted incoming traffic.
Rule | Security groups should only allow unrestricted incoming traffic for authorized ports |
Framework | AWS Foundational Security Best Practices |
Severity | ✔ High |
Rule Description
The rule ensures that security groups in AWS are configured to only allow unrestricted incoming traffic for authorized ports. This practice enhances the security of your AWS infrastructure by limiting the exposure of your resources to potential vulnerabilities.
Rule Remediation
Troubleshooting Steps
1. Identify Security Groups Allowing Unrestricted Incoming Traffic
2. Review Authorized Ports
3. Update Security Group Rules
4. Remove Unnecessary Rules
5. Test Resource Accessibility
Example CLI Command
The following AWS CLI command can be used to modify a security group rule and allow incoming traffic for an authorized port:
aws ec2 authorize-security-group-ingress --group-id <security-group-id> --protocol <protocol> --port <port> --cidr <allowed-cidr-block>
Replace
<security-group-id>
with the ID of the security group you want to modify. Specify the <protocol>
, <port>
, and <allowed-cidr-block>
according to your requirements.Note: Make sure you have the necessary permissions to modify security group rules.
Conclusion
Following the AWS Foundational Security Best Practice of allowing unrestricted incoming traffic only for authorized ports helps in strengthening the security posture of your AWS infrastructure. By ensuring that security groups are properly configured, you can reduce the risk of unauthorized access and potential security breaches. Regularly reviewing and updating security group rules is essential to maintain a secure environment.