Check ID:
Provider: AWS
Service:
Severity: HIGH
Categories:
Resource type:
ec2_securitygroup_allow_ingress_from_internet_to_tcp_port_22Provider: AWS
Service:
ec2Severity: HIGH
Categories:
internet-exposedResource type:
AwsEc2SecurityGroupWhat this check verifies
EC2 security groups are assessed for inbound SSH exposure by locating ingress rules that allowTCP 22 from the Internet (0.0.0.0/0 or ::/0).
Only groups in use are considered; sets already flagged for all-port exposure are not repeated.
Risk
Exposed SSH invites Internet-scale brute force and credential stuffing. A successful login grants remote shell, enabling data theft (confidentiality), code or config tampering (integrity), and cryptomining or service disruption (availability), plus lateral movement within the environment.Recommendation
Apply least privilege to SSH:- Disallow
0.0.0.0/0and::/0; allow only trusted IPs or VPN ranges - Prefer private access via bastion hosts or AWS Systems Manager Session Manager
- Enforce key-based auth, disable passwords, rotate keys
- Add network segmentation and monitoring for defense in depth
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
aws ec2 revoke-security-group-ingress —group-id <SECURITY_GROUP_ID> —protocol tcp —port 22 —cidr 0.0.0.0/0
References
- https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/aws/EC2/unrestricted-ssh-access.html
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = ec2_securitygroup_allow_ingress_from_internet_to_tcp_port_22. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks