From 4d902e02bb3b41fd517fd0a581f233f554b416d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Mart=C3=ADn?= Date: Fri, 6 Sep 2024 13:42:28 +0200 Subject: [PATCH] fix(security-groups): remove RFC1918 from ec2_securitygroup_allow_wide_open_public_ipv4 (#4951) --- ...c2_securitygroup_allow_wide_open_public_ipv4.metadata.json | 4 ++-- .../ec2_securitygroup_allow_wide_open_public_ipv4.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.metadata.json b/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.metadata.json index 773cfdb249..4b9c18ea1d 100644 --- a/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.metadata.json +++ b/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.metadata.json @@ -1,7 +1,7 @@ { "Provider": "aws", "CheckID": "ec2_securitygroup_allow_wide_open_public_ipv4", - "CheckTitle": "Ensure no security groups allow ingress and egress from wide-open non-RFC1918 address.", + "CheckTitle": "Ensure no security groups allow ingress and egress from wide-open IP address with a mask between 0 and 24.", "CheckType": [ "Infrastructure Security" ], @@ -10,7 +10,7 @@ "ResourceIdTemplate": "arn:partition:service:region:account-id:resource-id", "Severity": "high", "ResourceType": "AwsEc2SecurityGroup", - "Description": "Ensure no security groups allow ingress and egress from wide-open non-RFC1918 address.", + "Description": "Ensure no security groups allow ingress and egress from ide-open IP address with a mask between 0 and 24.", "Risk": "If Security groups are not properly configured the attack surface is increased.", "RelatedUrl": "", "Remediation": { diff --git a/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.py b/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.py index 8d5e67e82d..c0f01dd3a2 100644 --- a/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.py +++ b/prowler/providers/aws/services/ec2/ec2_securitygroup_allow_wide_open_public_ipv4/ec2_securitygroup_allow_wide_open_public_ipv4.py @@ -28,7 +28,7 @@ class ec2_securitygroup_allow_wide_open_public_ipv4(Check): for ingress_rule in security_group.ingress_rules: for ipv4 in ingress_rule["IpRanges"]: ip = ipaddress.ip_network(ipv4["CidrIp"]) - # Check if IP is public according to RFC1918 and if 0 < prefixlen < 24 + # Check if IP is public if 0 < prefixlen < 24 if ( ip.is_global and ip.prefixlen < cidr_treshold @@ -42,7 +42,7 @@ class ec2_securitygroup_allow_wide_open_public_ipv4(Check): for egress_rule in security_group.egress_rules: for ipv4 in egress_rule["IpRanges"]: ip = ipaddress.ip_network(ipv4["CidrIp"]) - # Check if IP is public according to RFC1918 and if 0 < prefixlen < 24 + # Check if IP is public if 0 < prefixlen < 24 if ( ip.is_global and ip.prefixlen < cidr_treshold