Network ACL does not allow ingress from 0.0.0.0/0 to any port
VPC network ACLs with inbound entries that permit traffic from 0.0.0.0/0 to any port (any protocol) are identified at the subnet boundary.
Risk
Allowing Internet-wide ingress at the subnet layer enables broad port scanning and unsolicited connections. Attackers can probe and exploit exposed services, risking data disclosure and tampering (confidentiality, integrity) and causing outages via floods or brute-force (availability). Any security group lapse then lacks a compensating control.
Run this check with Prowler
Run in Prowler Cloudprowler aws --checks ec2_networkacl_allow_ingress_any_portRecommendation
Adopt a deny-by-default NACL posture: block 0.0.0.0/0 and allow only required ports from trusted CIDRs. Apply least privilege using security groups for fine-grained access, with NACLs as coarse stateless filters. Review and prune rules regularly, and employ defense in depth with monitoring and alerting.
Remediation
CLI
aws ec2 replace-network-acl-entry --network-acl-id <example_resource_id> --ingress --rule-number <RULE_NUMBER> --protocol -1 --rule-action deny --cidr-block 0.0.0.0/0Terraform
# Deny all inbound from the Internet on the NACL
resource "aws_network_acl_rule" "<example_resource_name>" {
network_acl_id = "<example_resource_id>"
rule_number = 100
egress = false
protocol = "-1"
rule_action = "deny" # CRITICAL: Denies ingress
cidr_block = "0.0.0.0/0" # CRITICAL: From the Internet (any IP)
}NativeIaC
# CloudFormation: deny all inbound from the Internet on the NACL
Resources:
NetworkAclDenyAllIngress:
Type: AWS::EC2::NetworkAclEntry
Properties:
NetworkAclId: "<example_resource_id>"
RuleNumber: 100
Protocol: -1
Egress: false
RuleAction: deny # CRITICAL: Denies ingress
CidrBlock: 0.0.0.0/0 # CRITICAL: From the Internet (any IP)Other
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.ec2.ec2_client import ec2_client
from prowler.providers.aws.services.ec2.lib.network_acls import check_network_acl
class ec2_networkacl_allow_ingress_any_port(Check):
def execute(self):
findings = []
tcp_protocol = "-1"
check_port = 0
for arn, network_acl in ec2_client.network_acls.items():
if (
ec2_client.provider.scan_unused_services
or network_acl.region in ec2_client.regions_with_sgs
):
report = Check_Report_AWS(
metadata=self.metadata(), resource=network_acl
)
# If some entry allows it, that ACL is not securely configured
if check_network_acl(network_acl.entries, tcp_protocol, check_port):
report.status = "FAIL"
report.status_extended = f"Network ACL {network_acl.name if network_acl.name else network_acl.id} has every port open to the Internet."
findings.append(report)
else:
report.status = "PASS"
report.status_extended = f"Network ACL {network_acl.name if network_acl.name else network_acl.id} does not have every port open to the Internet."
findings.append(report)
return findings