fix(aws): fix logic in VPC and ELBv2 checks (#8092)

Co-authored-by: crr <42739372+55002ghals@users.noreply.github.com>
Co-authored-by: Sergio Garcia <hello@mistercloudsec.com>
Co-authored-by: César Arroba <19954079+cesararroba@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-06-26 00:26:14 +08:00
1 parent eb3e4fab85
commit 5a50b5d38f
3 files changed
+5 -5

No files matched your search

@@ -12,7 +12,7 @@ class elbv2_desync_mitigation_mode(Check):
report.status_extended = f"ELBv2 ALB {lb.name} is configured with correct desync mitigation mode."
if (
lb.desync_mitigation_mode != "strictest"
or lb.desync_mitigation_mode != "defensive"
and lb.desync_mitigation_mode != "defensive"
):
if lb.drop_invalid_header_fields == "false":
report.status = "FAIL"
@@ -9,10 +9,10 @@ class vpc_endpoint_multi_az_enabled(Check):
if endpoint.vpc_id in vpc_client.vpcs and endpoint.type == "Interface":
report = Check_Report_AWS(metadata=self.metadata(), resource=endpoint)
report.status = "FAIL"
report.status_extended = f"VPC Endpoint {endpoint.id} in VPC {endpoint.vpc_id} has subnets in different AZs."
report.status_extended = f"VPC Endpoint {endpoint.id} in VPC {endpoint.vpc_id} does not have subnets in different AZs."
if len(endpoint.subnet_ids) > 1:
report.status = "PASS"
report.status_extended = f"VPC Endpoint {endpoint.id} in VPC {endpoint.vpc_id} does not have subnets in different AZs."
report.status_extended = f"VPC Endpoint {endpoint.id} in VPC {endpoint.vpc_id} has subnets in different AZs."
findings.append(report)
@@ -87,7 +87,7 @@ class Test_vpc_endpoint_for_multi_az:
assert result[0].status == "FAIL"
assert (
result[0].status_extended
== f"VPC Endpoint {vpc_endpoint['VpcEndpointId']} in VPC {vpc['VpcId']} has subnets in different AZs."
== f"VPC Endpoint {vpc_endpoint['VpcEndpointId']} in VPC {vpc['VpcId']} does not have subnets in different AZs."
)
assert (
result[0].resource_arn
@@ -158,7 +158,7 @@ class Test_vpc_endpoint_for_multi_az:
assert result[0].status == "PASS"
assert (
result[0].status_extended
== f"VPC Endpoint {vpc_endpoint['VpcEndpointId']} in VPC {vpc['VpcId']} does not have subnets in different AZs."
== f"VPC Endpoint {vpc_endpoint['VpcEndpointId']} in VPC {vpc['VpcId']} has subnets in different AZs."
)
assert (
result[0].resource_arn