From e4c890f6fda0f3d9fc9b8bd00ac46fc72ae7e438 Mon Sep 17 00:00:00 2001 From: ArturRibeiro-CX Date: Sat, 9 Nov 2024 12:55:24 +0000 Subject: [PATCH] fix linting elb without secure protocol --- .../aws/elb_without_secure_protocol/query.rego | 9 +++++---- .../aws/iam_access_analyzer_not_enabled/query.rego | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/queries/cloudFormation/aws/elb_without_secure_protocol/query.rego b/assets/queries/cloudFormation/aws/elb_without_secure_protocol/query.rego index 3dda6c77909..1aeda819077 100644 --- a/assets/queries/cloudFormation/aws/elb_without_secure_protocol/query.rego +++ b/assets/queries/cloudFormation/aws/elb_without_secure_protocol/query.rego @@ -5,18 +5,19 @@ import data.generic.common as common_lib import future.keywords.in CxPolicy[result] { - some p, name, protocol, idx, i - resource := input.document[i].Resources[name] + some name, idx + some document in input.document + resource := document.Resources[name] resource.Type == "AWS::ElasticLoadBalancing::LoadBalancer" listener := resource.Properties.Listeners[idx] protocols := {"InstanceProtocol", "Protocol"} - some protocol in protocols[p] + some protocol in protocols not is_secure(listener, protocol) result := { - "documentId": input.document[i].id, + "documentId": document.id, "resourceType": resource.Type, "resourceName": cf_lib.get_resource_name(resource, name), "searchKey": sprintf("Resources.%s.Properties.Listeners", [name]), diff --git a/assets/queries/terraform/aws/iam_access_analyzer_not_enabled/query.rego b/assets/queries/terraform/aws/iam_access_analyzer_not_enabled/query.rego index 47f06f8ad1a..18cd7f95c16 100644 --- a/assets/queries/terraform/aws/iam_access_analyzer_not_enabled/query.rego +++ b/assets/queries/terraform/aws/iam_access_analyzer_not_enabled/query.rego @@ -1,8 +1,8 @@ package Cx import data.generic.common as common_lib -import input as tf import future.keywords.in +import input as tf CxPolicy[result] { paths := [p |