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" } ]