fix(alibabacloud): normalize security group policy case (#12059)

Co-authored-by: Xianyao Chen <owenchenxy@gmail.com>
Co-authored-by: xianyao.chen <xychen@xianyaochens-MacBook-Pro.local>
Co-authored-by: Hugo P.Brito <hugopbrit@gmail.com>
This commit is contained in:
Prowler Bot
2026-07-20 15:23:35 +02:00
committed by GitHub
parent 6fe8646903
commit ab325c9099
5 changed files with 7 additions and 6 deletions
@@ -0,0 +1 @@
Alibaba Cloud SSH and RDP security group checks no longer produce false negatives when allowed rules use capitalized `Policy="Accept"` values
@@ -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)
@@ -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)
@@ -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",
}
],
)
@@ -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",
}
],
)