Check your EC2 security groups for outbound rules that allow unrestricted access (i.e. 0.0.0.0/0 or ::/0) to any TCP/UDP ports and restrict access to only those IP addresses that require it in order to implement the principle of least privilege and reduce the possibility of a breach.
Allowing unrestricted (0.0.0.0/0 or ::/0) outbound/egress access can increase opportunities for malicious activity such as such as Denial of Service (DoS) attacks or Distributed Denial of Service (DDoS) attacks.
To determine if your EC2 security groups allow unrestricted outbound access, perform the following:
To update your EC2 security groups outbound configuration in order to restrict access to specific destinations (IP addresses, IP ranges, etc), perform the following: