Skip to content

Commit 3d88403

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add has_optional_group_by in security monitoring tests (#2869)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent a53195e commit 3d88403

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cassettes/v2/Security-Monitoring_1187227211/Convert-a-rule-from-JSON-to-Terraform-returns-OK-response_2678697680/recording.har

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"content": {
4343
"mimeType": "application/json",
4444
"size": 667,
45-
"text": "{\"terraformContent\":\"resource \\\"datadog_security_monitoring_rule\\\" \\\"_b87eac89722bbff0\\\" {\\n\\tname = \\\"_b87eac89722bbff0\\\"\\n\\tenabled = true\\n\\tquery {\\n\\t\\tquery = \\\"@test:true\\\"\\n\\t\\tgroup_by_fields = []\\n\\t\\tdistinct_fields = []\\n\\t\\taggregation = \\\"count\\\"\\n\\t\\tname = \\\"\\\"\\n\\t\\tdata_source = \\\"logs\\\"\\n\\t}\\n\\toptions {\\n\\t\\tkeep_alive = 3600\\n\\t\\tmax_signal_duration = 86400\\n\\t\\tdetection_method = \\\"threshold\\\"\\n\\t\\tevaluation_window = 900\\n\\t}\\n\\tcase {\\n\\t\\tname = \\\"\\\"\\n\\t\\tstatus = \\\"info\\\"\\n\\t\\tnotifications = []\\n\\t\\tcondition = \\\"a \\u003e 0\\\"\\n\\t}\\n\\tmessage = \\\"Test rule\\\"\\n\\ttags = []\\n\\thas_extended_title = false\\n\\ttype = \\\"log_detection\\\"\\n}\\n\"}"
45+
"text": "{\"terraformContent\":\"resource \\\"datadog_security_monitoring_rule\\\" \\\"_b87eac89722bbff0\\\" {\\n\\tname = \\\"_b87eac89722bbff0\\\"\\n\\tenabled = true\\n\\tquery {\\n\\t\\tquery = \\\"@test:true\\\"\\n\\t\\tgroup_by_fields = []\\n\\t\\thas_optional_group_by_fields = false\\n\\t\\tdistinct_fields = []\\n\\t\\taggregation = \\\"count\\\"\\n\\t\\tname = \\\"\\\"\\n\\t\\tdata_source = \\\"logs\\\"\\n\\t}\\n\\toptions {\\n\\t\\tkeep_alive = 3600\\n\\t\\tmax_signal_duration = 86400\\n\\t\\tdetection_method = \\\"threshold\\\"\\n\\t\\tevaluation_window = 900\\n\\t}\\n\\tcase {\\n\\t\\tname = \\\"\\\"\\n\\t\\tstatus = \\\"info\\\"\\n\\t\\tnotifications = []\\n\\t\\tcondition = \\\"a \\u003e 0\\\"\\n\\t}\\n\\tmessage = \\\"Test rule\\\"\\n\\ttags = []\\n\\thas_extended_title = false\\n\\ttype = \\\"log_detection\\\"\\n}\\n\"}"
4646
},
4747
"cookies": [],
4848
"headers": [

cassettes/v2/Security-Monitoring_1187227211/Convert-an-existing-rule-from-JSON-to-Terraform-returns-OK-response_1060662187/recording.har

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"content": {
8686
"mimeType": "application/json",
8787
"size": 667,
88-
"text": "{\"terraformContent\":\"resource \\\"datadog_security_monitoring_rule\\\" \\\"_1166a375f2500467\\\" {\\n\\tname = \\\"_1166a375f2500467\\\"\\n\\tenabled = true\\n\\tquery {\\n\\t\\tquery = \\\"@test:true\\\"\\n\\t\\tgroup_by_fields = []\\n\\t\\tdistinct_fields = []\\n\\t\\taggregation = \\\"count\\\"\\n\\t\\tname = \\\"\\\"\\n\\t\\tdata_source = \\\"logs\\\"\\n\\t}\\n\\toptions {\\n\\t\\tkeep_alive = 3600\\n\\t\\tmax_signal_duration = 86400\\n\\t\\tdetection_method = \\\"threshold\\\"\\n\\t\\tevaluation_window = 900\\n\\t}\\n\\tcase {\\n\\t\\tname = \\\"\\\"\\n\\t\\tstatus = \\\"info\\\"\\n\\t\\tnotifications = []\\n\\t\\tcondition = \\\"a \\u003e 0\\\"\\n\\t}\\n\\tmessage = \\\"Test rule\\\"\\n\\ttags = []\\n\\thas_extended_title = false\\n\\ttype = \\\"log_detection\\\"\\n}\\n\"}"
88+
"text": "{\"terraformContent\":\"resource \\\"datadog_security_monitoring_rule\\\" \\\"_1166a375f2500467\\\" {\\n\\tname = \\\"_1166a375f2500467\\\"\\n\\tenabled = true\\n\\tquery {\\n\\t\\tquery = \\\"@test:true\\\"\\n\\t\\tgroup_by_fields = []\\n\\t\\thas_optional_group_by_fields = false\\n\\t\\tdistinct_fields = []\\n\\t\\taggregation = \\\"count\\\"\\n\\t\\tname = \\\"\\\"\\n\\t\\tdata_source = \\\"logs\\\"\\n\\t}\\n\\toptions {\\n\\t\\tkeep_alive = 3600\\n\\t\\tmax_signal_duration = 86400\\n\\t\\tdetection_method = \\\"threshold\\\"\\n\\t\\tevaluation_window = 900\\n\\t}\\n\\tcase {\\n\\t\\tname = \\\"\\\"\\n\\t\\tstatus = \\\"info\\\"\\n\\t\\tnotifications = []\\n\\t\\tcondition = \\\"a \\u003e 0\\\"\\n\\t}\\n\\tmessage = \\\"Test rule\\\"\\n\\ttags = []\\n\\thas_extended_title = false\\n\\ttype = \\\"log_detection\\\"\\n}\\n\"}"
8989
},
9090
"cookies": [],
9191
"headers": [

features/v2/security_monitoring.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Feature: Security Monitoring
135135
And body with value {"name":"_{{ unique_hash }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"}
136136
When the request is sent
137137
Then the response status is 200 OK
138-
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
138+
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
139139

140140
@skip @team:DataDog/k9-cloud-security-platform
141141
Scenario: Convert an existing rule from JSON to Terraform returns "Bad Request" response
@@ -158,7 +158,7 @@ Feature: Security Monitoring
158158
And request contains "rule_id" parameter from "security_rule_hash.id"
159159
When the request is sent
160160
Then the response status is 200 OK
161-
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
161+
And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n"
162162

163163
@skip-validation @team:DataDog/k9-cloud-security-platform
164164
Scenario: Create a cloud_configuration rule returns "OK" response

0 commit comments

Comments
 (0)