From d81808c63751efa6d6e31dbdd7694edf8c7eacf7 Mon Sep 17 00:00:00 2001 From: Andre Pereira <219305055+cx-andre-pereira@users.noreply.github.com> Date: Mon, 11 Aug 2025 17:11:35 +0100 Subject: [PATCH] new_test --- .../test/negative3.yaml | 29 +++++++++++++++++++ .../test/positive5.yaml | 28 ++++++++++++++++++ .../test/positive_expected_result.json | 12 ++++++++ 3 files changed, 69 insertions(+) create mode 100644 assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/negative3.yaml create mode 100644 assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive5.yaml diff --git a/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/negative3.yaml b/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/negative3.yaml new file mode 100644 index 00000000000..25326ccd965 --- /dev/null +++ b/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/negative3.yaml @@ -0,0 +1,29 @@ +AWSTemplateFormatVersion: 2010-09-09 +Description: Creating TestDeployment +Resources: + Prod: + Type: AWS::ApiGateway::Stage + Properties: + StageName: Prod + Description: Prod Stage + RestApiId: !Ref MyRestApi + DeploymentId: !Ref TestDeployment + DocumentationVersion: !Ref MyDocumentationVersion + ClientCertificateId: !Ref ClientCertificate + Variables: + Stack: Prod + MethodSettings: + - ResourcePath: / + HttpMethod: GET + MetricsEnabled: true + DataTraceEnabled: false + - ResourcePath: /stack + HttpMethod: POST + MetricsEnabled: true + DataTraceEnabled: false + ThrottlingBurstLimit: '999' + - ResourcePath: /stack + HttpMethod: GET + MetricsEnabled: true + DataTraceEnabled: false + ThrottlingBurstLimit: '555' diff --git a/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive5.yaml b/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive5.yaml new file mode 100644 index 00000000000..a149e3aff46 --- /dev/null +++ b/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive5.yaml @@ -0,0 +1,28 @@ +AWSTemplateFormatVersion: 2010-09-09 +Description: Creating TestDeployment +Resources: + Prod: + Type: AWS::ApiGateway::Stage + Properties: + StageName: Prod + Description: Prod Stage + RestApiId: !Ref MyRestApi + DeploymentId: !Ref TestDeployment + DocumentationVersion: !Ref MyDocumentationVersion + ClientCertificateId: !Ref ClientCertificate + Variables: + Stack: Prod + MethodSettings: + - ResourcePath: / + HttpMethod: GET + MetricsEnabled: false + DataTraceEnabled: 'false' + - ResourcePath: /stack + HttpMethod: POST + DataTraceEnabled: 'false' + ThrottlingBurstLimit: '999' + - ResourcePath: /stack + HttpMethod: GET + MetricsEnabled: true + DataTraceEnabled: 'false' + ThrottlingBurstLimit: '555' diff --git a/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive_expected_result.json b/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive_expected_result.json index 8e2895e6052..d67127722ba 100644 --- a/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive_expected_result.json +++ b/assets/queries/cloudFormation/aws/cloudwatch_metrics_disabled/test/positive_expected_result.json @@ -34,5 +34,17 @@ "severity": "MEDIUM", "line": 5, "fileName": "positive4.json" + }, + { + "queryName": "CloudWatch Metrics Disabled", + "severity": "MEDIUM", + "line": 18, + "fileName": "positive5.yaml" + }, + { + "queryName": "CloudWatch Metrics Disabled", + "severity": "MEDIUM", + "line": 20, + "fileName": "positive5.yaml" } ]