mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
fix(alibabacloud): normalize security group policy case (#12049)
Co-authored-by: xianyao.chen <xychen@xianyaochens-MacBook-Pro.local> Co-authored-by: Hugo P.Brito <hugopbrit@gmail.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Alibaba Cloud SSH and RDP security group checks no longer produce false negatives when allowed rules use capitalized `Policy="Accept"` values
|
||||
+1
-1
@@ -26,7 +26,7 @@ class ecs_securitygroup_restrict_rdp_internet(Check):
|
||||
|
||||
for ingress_rule in security_group.ingress_rules:
|
||||
# Check if rule allows traffic (policy == "accept")
|
||||
if ingress_rule.get("policy", "accept") != "accept":
|
||||
if str(ingress_rule.get("policy", "accept")).lower() != "accept":
|
||||
continue
|
||||
|
||||
# Check protocol (tcp for RDP)
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ class ecs_securitygroup_restrict_ssh_internet(Check):
|
||||
|
||||
for ingress_rule in security_group.ingress_rules:
|
||||
# Check if rule allows traffic (policy == "accept")
|
||||
if ingress_rule.get("policy", "accept") != "accept":
|
||||
if str(ingress_rule.get("policy", "accept")).lower() != "accept":
|
||||
continue
|
||||
|
||||
# Check protocol (tcp for SSH)
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ class TestEcsSecurityGroupRestrictRdpInternet:
|
||||
"ip_protocol": "tcp",
|
||||
"source_cidr_ip": "0.0.0.0/0",
|
||||
"port_range": "3389/3389",
|
||||
"policy": "accept",
|
||||
"policy": "Accept",
|
||||
}
|
||||
],
|
||||
)
|
||||
@@ -80,7 +80,7 @@ class TestEcsSecurityGroupRestrictRdpInternet:
|
||||
"ip_protocol": "tcp",
|
||||
"source_cidr_ip": "10.0.0.0/24",
|
||||
"port_range": "3389/3389",
|
||||
"policy": "accept",
|
||||
"policy": "Accept",
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
+2
-2
@@ -37,7 +37,7 @@ class TestEcsSecurityGroupRestrictSSHInternet:
|
||||
"ip_protocol": "tcp",
|
||||
"source_cidr_ip": "0.0.0.0/0",
|
||||
"port_range": "22/22",
|
||||
"policy": "accept",
|
||||
"policy": "Accept",
|
||||
}
|
||||
],
|
||||
)
|
||||
@@ -81,7 +81,7 @@ class TestEcsSecurityGroupRestrictSSHInternet:
|
||||
"ip_protocol": "tcp",
|
||||
"source_cidr_ip": "10.0.0.0/24",
|
||||
"port_range": "22/22",
|
||||
"policy": "accept",
|
||||
"policy": "Accept",
|
||||
}
|
||||
],
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user