Check provider logo

Security group has no ingress or egress rules with public IPv4 CIDR ranges from /1 to /23

ec2_securitygroup_allow_wide_open_public_ipv4

Severityhigh
Serviceec2
by Prowler

EC2 security groups with rules that permit non-RFC1918 IPv4 ranges wider than /24 are identified across both ingress and egress.

The focus is on public CIDRs (/1-/23) that broadly expose sources or destinations, not on private networks.

Risk

Over-broad public CIDRs expand exposure and enable:

  • Confidentiality loss via unauthorized access and exfiltration
  • Integrity compromise by exploiting exposed services
  • Availability impact from scanning and abuse

Open egress further allows C2 beacons and bulk data exfiltration to untrusted IPs.

Run this check with Prowler CLI

prowler aws --checks ec2_securitygroup_allow_wide_open_public_ipv4

Recommendation

Apply least privilege on security groups:

  • Allow only known IPs (prefer /32 or tight CIDRs)
  • Use private connectivity (VPN, Direct Connect, private endpoints)
  • Restrict and log egress; deny by default
  • Segment with security group references and network ACLs for defense-in-depth

Remediation

Native IaC
Terraform
Other
  1. In the AWS Console, go to VPC > Security Groups
  2. Select the security group with the finding
  3. Click Edit inbound rules (and Edit outbound rules if needed)
  4. For any rule with a public IPv4 CIDR mask /1-/23, delete it or change the CIDR to a private RFC1918 range or to /24 or more specific (e.g., 203.0.113.0/24)
  5. Save rules

Source Code

Resource Type

AwsEc2SecurityGroup

References