Check your Amazon EC2 security groups for outbound/egress rules that allow unrestricted access (i.e. 0.0.0.0/0 or ::/0) on any TCP/UDP ports and restrict access to only those IP addresses and/or IP ranges that require it in order to implement the Principle of Least Privilege (POLP) and reduce the attack surface.
This rule can help you with the following compliance standards:
- PCI
- HIPAA
- APRA
- MAS
- NIST4
For further details on compliance standards supported by Conformity, see here.
This rule can help you work with the AWS Well-Architected Framework.
This rule resolution is part of the Conformity Security & Compliance tool for AWS.
Allowing unrestricted outbound/egress access on TCP/UDP ports can increase opportunities for malicious activities such as Distributed Denial of Service (DDoS) attacks.
Audit
To determine if your Amazon EC2 security groups allow unrestricted egress access on TCP/UDP ports, perform the following operations:
Remediation / Resolution
To update the outbound rule configuration for your Amazon EC2 security groups in order to restrict access to trusted destinations only (i.e. authorized IP addresses and IP ranges, or other security groups), perform the following operations:
References
- AWS Documentation
- Amazon EC2 security groups for Linux instances
- Work with security groups
- Security group rules for different use cases
- Authorize inbound traffic for your Linux instances
- AWS Command Line Interface (CLI) Documentation
- ec2
- describe-security-groups
- revoke-security-group-egress
- authorize-security-group-egress
- CloudFormation Documentation
- Amazon Elastic Compute Cloud resource type reference
- Terraform Documentation
- AWS Provider