EC2 security groups should not allow ingress from 0.0.0.0/0 to remote server administration ports
Flags security groups that allow ingress from 0.0.0.0/0 to the remote administration ports 22 (SSH) or 3389 (RDP), letting anyone on the internet try to log in. A port range or All traffic rule reaching either port counts, as does a managed prefix list holding 0.0.0.0/0 or a shared one this account can no longer see; a rule from ::/0 is read by EC2.54 instead.
- service
- EC2
- severity
- High
- scope
- evaluated in every region
How to fix it
- Can break clients: SSH and RDP from the internet stop working once the rule narrows or goes, so set up another way in first, such as Session Manager or a VPN.
In the console
EC2 → Security Groups → the security group → Actions → Edit inbound rules
- Source
- The address ranges that need SSH or RDP, not Anywhere-IPv4 or Anywhere-IPv6; or delete the rule
With the AWS CLI
aws ec2 revoke-security-group-ingress --group-id <group-id> --security-group-rule-ids <rule-id>
See which of your accounts this check is failing on.
Book a live scan