From fd537a61ac558830f0c0cdcab4a2bea936b6a185 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 2 Jan 2025 14:45:15 +0000 Subject: [PATCH] Regenerate client from commit b4e964b3 of spec repo --- .apigentools-info | 8 +++---- .generator/schemas/v2/openapi.yaml | 21 +++++++++++++++++++ ...ing_CreateSecurityMonitoringSuppression.rs | 1 + ...ecurityMonitoringSuppression_3192265332.rs | 3 ++- ...urity_monitoring_suppression_attributes.rs | 17 +++++++++++++++ ...onitoring_suppression_create_attributes.rs | 17 +++++++++++++++ ...onitoring_suppression_update_attributes.rs | 18 ++++++++++++++++ ...uppression-rule-returns-OK-response.frozen | 2 +- ...-suppression-rule-returns-OK-response.json | 18 +++++++--------- ...exclusion-query-returns-OK-response.frozen | 2 +- ...n-exclusion-query-returns-OK-response.json | 18 +++++++--------- .../features/v2/security_monitoring.feature | 14 ++++++------- 12 files changed, 103 insertions(+), 36 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index d34bc6a29..0b54e79cd 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-26 16:01:43.230022", - "spec_repo_commit": "f2e98b01" + "regenerated": "2025-01-02 14:39:39.408081", + "spec_repo_commit": "b4e964b3" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-12-26 16:01:43.244935", - "spec_repo_commit": "f2e98b01" + "regenerated": "2025-01-02 14:39:39.423099", + "spec_repo_commit": "b4e964b3" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3e1d95e9a..5c7885313 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -24825,6 +24825,12 @@ components: as the search bar for detection rules. example: type:log_detection source:cloudtrail type: string + start_date: + description: A Unix millisecond timestamp giving the start date for the + suppression rule. After this date, it starts suppressing signals. + example: 1703187336000 + format: int64 + type: integer suppression_query: description: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as @@ -24880,6 +24886,12 @@ components: as the search bar for detection rules. example: type:log_detection source:cloudtrail type: string + start_date: + description: A Unix millisecond timestamp giving the start date for the + suppression rule. After this date, it starts suppressing signals. + example: 1703187336000 + format: int64 + type: integer suppression_query: description: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. It uses the @@ -24966,6 +24978,15 @@ components: as the search bar for detection rules. example: type:log_detection source:cloudtrail type: string + start_date: + description: A Unix millisecond timestamp giving the start date for the + suppression rule. After this date, it starts suppressing signals. If unset, + the start date of the suppression rule is left untouched. If set to `null`, + the start date is removed. + example: 1703187336000 + format: int64 + nullable: true + type: integer suppression_query: description: The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as diff --git a/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs b/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs index b8ae793cb..5d0c4ddc6 100644 --- a/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs +++ b/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs @@ -19,6 +19,7 @@ async fn main() { "This rule suppresses low-severity signals in staging environments.".to_string(), ) .expiration_date(1638443471000) + .start_date(1637493071000) .suppression_query("env:staging status:low".to_string()), SecurityMonitoringSuppressionType::SUPPRESSIONS, ), diff --git a/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression_3192265332.rs b/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression_3192265332.rs index e912b4637..fbefd2480 100644 --- a/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression_3192265332.rs +++ b/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression_3192265332.rs @@ -19,7 +19,8 @@ async fn main() { .description( "This rule suppresses low-severity signals in staging environments.".to_string(), ) - .expiration_date(1638443471000), + .expiration_date(1638443471000) + .start_date(1637493071000), SecurityMonitoringSuppressionType::SUPPRESSIONS, ), ); diff --git a/src/datadogV2/model/model_security_monitoring_suppression_attributes.rs b/src/datadogV2/model/model_security_monitoring_suppression_attributes.rs index c10351989..fd6270dcf 100644 --- a/src/datadogV2/model/model_security_monitoring_suppression_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_suppression_attributes.rs @@ -38,6 +38,9 @@ pub struct SecurityMonitoringSuppressionAttributes { /// The rule query of the suppression rule, with the same syntax as the search bar for detection rules. #[serde(rename = "rule_query")] pub rule_query: Option, + /// A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals. + #[serde(rename = "start_date")] + pub start_date: Option, /// The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer. #[serde(rename = "suppression_query")] pub suppression_query: Option, @@ -69,6 +72,7 @@ impl SecurityMonitoringSuppressionAttributes { expiration_date: None, name: None, rule_query: None, + start_date: None, suppression_query: None, update_date: None, updater: None, @@ -123,6 +127,11 @@ impl SecurityMonitoringSuppressionAttributes { self } + pub fn start_date(mut self, value: i64) -> Self { + self.start_date = Some(value); + self + } + pub fn suppression_query(mut self, value: String) -> Self { self.suppression_query = Some(value); self @@ -184,6 +193,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes { let mut expiration_date: Option = None; let mut name: Option = None; let mut rule_query: Option = None; + let mut start_date: Option = None; let mut suppression_query: Option = None; let mut update_date: Option = None; let mut updater: Option = None; @@ -254,6 +264,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes { } rule_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "start_date" => { + if v.is_null() { + continue; + } + start_date = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "suppression_query" => { if v.is_null() { continue; @@ -298,6 +314,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes { expiration_date, name, rule_query, + start_date, suppression_query, update_date, updater, diff --git a/src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs b/src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs index 64c03c416..79dc46f23 100644 --- a/src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs @@ -29,6 +29,9 @@ pub struct SecurityMonitoringSuppressionCreateAttributes { /// The rule query of the suppression rule, with the same syntax as the search bar for detection rules. #[serde(rename = "rule_query")] pub rule_query: String, + /// A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals. + #[serde(rename = "start_date")] + pub start_date: Option, /// The suppression query of the suppression rule. If a signal matches this query, it is suppressed and is not triggered. It uses the same syntax as the queries to search signals in the Signals Explorer. #[serde(rename = "suppression_query")] pub suppression_query: Option, @@ -52,6 +55,7 @@ impl SecurityMonitoringSuppressionCreateAttributes { expiration_date: None, name, rule_query, + start_date: None, suppression_query: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -73,6 +77,11 @@ impl SecurityMonitoringSuppressionCreateAttributes { self } + pub fn start_date(mut self, value: i64) -> Self { + self.start_date = Some(value); + self + } + pub fn suppression_query(mut self, value: String) -> Self { self.suppression_query = Some(value); self @@ -110,6 +119,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes { let mut expiration_date: Option = None; let mut name: Option = None; let mut rule_query: Option = None; + let mut start_date: Option = None; let mut suppression_query: Option = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -149,6 +159,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes { "rule_query" => { rule_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "start_date" => { + if v.is_null() { + continue; + } + start_date = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "suppression_query" => { if v.is_null() { continue; @@ -174,6 +190,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes { expiration_date, name, rule_query, + start_date, suppression_query, additional_properties, _unparsed, diff --git a/src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs b/src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs index c908ecfaf..6d9bc1807 100644 --- a/src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs @@ -33,6 +33,13 @@ pub struct SecurityMonitoringSuppressionUpdateAttributes { /// The rule query of the suppression rule, with the same syntax as the search bar for detection rules. #[serde(rename = "rule_query")] pub rule_query: Option, + /// A Unix millisecond timestamp giving the start date for the suppression rule. After this date, it starts suppressing signals. If unset, the start date of the suppression rule is left untouched. If set to `null`, the start date is removed. + #[serde( + rename = "start_date", + default, + with = "::serde_with::rust::double_option" + )] + pub start_date: Option>, /// The suppression query of the suppression rule. If a signal matches this query, it is suppressed and not triggered. Same syntax as the queries to search signals in the signal explorer. #[serde(rename = "suppression_query")] pub suppression_query: Option, @@ -55,6 +62,7 @@ impl SecurityMonitoringSuppressionUpdateAttributes { expiration_date: None, name: None, rule_query: None, + start_date: None, suppression_query: None, version: None, additional_properties: std::collections::BTreeMap::new(), @@ -92,6 +100,11 @@ impl SecurityMonitoringSuppressionUpdateAttributes { self } + pub fn start_date(mut self, value: Option) -> Self { + self.start_date = Some(value); + self + } + pub fn suppression_query(mut self, value: String) -> Self { self.suppression_query = Some(value); self @@ -140,6 +153,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes { let mut expiration_date: Option> = None; let mut name: Option = None; let mut rule_query: Option = None; + let mut start_date: Option> = None; let mut suppression_query: Option = None; let mut version: Option = None; let mut additional_properties: std::collections::BTreeMap< @@ -186,6 +200,9 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes { } rule_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "start_date" => { + start_date = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "suppression_query" => { if v.is_null() { continue; @@ -214,6 +231,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes { expiration_date, name, rule_query, + start_date, suppression_query, version, additional_properties, diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.frozen index 5ff3562b5..28bfbcc2d 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.frozen +++ b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2024-05-20T17:07:03.155Z \ No newline at end of file +2024-11-27T15:22:34.711Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.json index 27e8ab42a..c5b8f17c7 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.json +++ b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-returns-OK-response.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1718039223000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1716224823\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"suppression_query\":\"env:staging status:low\"},\"type\":\"suppressions\"}}", + "string": "{\"data\":{\"attributes\":{\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1734535354000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1732720954\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733584954000,\"suppression_query\":\"env:staging status:low\"},\"type\":\"suppressions\"}}", "encoding": null }, "headers": { @@ -19,12 +19,12 @@ }, "response": { "body": { - "string": "{\"data\":{\"id\":\"8qj-mmz-zym\",\"attributes\":{\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1716224823\",\"enabled\":true,\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"suppression_query\":\"env:staging status:low\",\"data_exclusion_query\":\"\",\"expiration_date\":1718039223000,\"version\":1,\"creation_date\":1716224823374,\"update_date\":1716224823374,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"ejv-ksi-r4j\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1732720954868,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"data_exclusion_query\":\"\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"editable\":true,\"enabled\":true,\"expiration_date\":1734535354000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1732720954\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733584954000,\"suppression_query\":\"env:staging status:low\",\"update_date\":1732720954868,\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"version\":1}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Mon, 20 May 2024 17:07:03 GMT" + "recorded_at": "Wed, 27 Nov 2024 15:22:34 GMT" }, { "request": { @@ -43,24 +43,20 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/8qj-mmz-zym" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ejv-ksi-r4j" }, "response": { "body": { "string": "", "encoding": null }, - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "status": { "code": 204, "message": "No Content" } }, - "recorded_at": "Mon, 20 May 2024 17:07:03 GMT" + "recorded_at": "Wed, 27 Nov 2024 15:22:34 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.frozen index c745e4513..73982716b 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.frozen +++ b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.frozen @@ -1 +1 @@ -2024-05-20T17:07:12.131Z \ No newline at end of file +2024-11-27T15:24:35.169Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.json index 88666355d..0a7d91fd1 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.json +++ b/tests/scenarios/cassettes/v2/security_monitoring/Create-a-suppression-rule-with-an-exclusion-query-returns-OK-response.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"data_exclusion_query\":\"account_id:12345\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1718039232000,\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1716224832\",\"rule_query\":\"type:log_detection source:cloudtrail\"},\"type\":\"suppressions\"}}", + "string": "{\"data\":{\"attributes\":{\"data_exclusion_query\":\"account_id:12345\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1734535475000,\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1732721075\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733585075000},\"type\":\"suppressions\"}}", "encoding": null }, "headers": { @@ -19,12 +19,12 @@ }, "response": { "body": { - "string": "{\"data\":{\"id\":\"i9m-nqb-ets\",\"attributes\":{\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1716224832\",\"enabled\":true,\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"suppression_query\":\"\",\"data_exclusion_query\":\"account_id:12345\",\"expiration_date\":1718039232000,\"version\":1,\"creation_date\":1716224832354,\"update_date\":1716224832355,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"rv5-3sh-tvp\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1732721075298,\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"data_exclusion_query\":\"account_id:12345\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"editable\":true,\"enabled\":true,\"expiration_date\":1734535475000,\"name\":\"Test-Create_a_suppression_rule_with_an_exclusion_query_returns_OK_response-1732721075\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1733585075000,\"suppression_query\":\"\",\"update_date\":1732721075298,\"updater\":{\"handle\":\"frog@datadoghq.com\",\"name\":\"\"},\"version\":1}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Mon, 20 May 2024 17:07:12 GMT" + "recorded_at": "Wed, 27 Nov 2024 15:24:35 GMT" }, { "request": { @@ -43,24 +43,20 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/i9m-nqb-ets" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/rv5-3sh-tvp" }, "response": { "body": { "string": "", "encoding": null }, - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "status": { "code": 204, "message": "No Content" } }, - "recorded_at": "Mon, 20 May 2024 17:07:12 GMT" + "recorded_at": "Wed, 27 Nov 2024 15:24:35 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/features/v2/security_monitoring.feature b/tests/scenarios/features/v2/security_monitoring.feature index 1c3c32c5a..362378f63 100644 --- a/tests/scenarios/features/v2/security_monitoring.feature +++ b/tests/scenarios/features/v2/security_monitoring.feature @@ -264,21 +264,21 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "Bad Request" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "Conflict" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 409 Conflict @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule returns "OK" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "suppressions" @@ -288,7 +288,7 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a suppression rule with an exclusion query returns "OK" response Given new "CreateSecurityMonitoringSuppression" request - And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "start_date": {{ timestamp('now + 10d') }}000, "expiration_date": {{ timestamp('now + 21d') }}000, "name": "{{ unique }}", "rule_query": "type:log_detection source:cloudtrail", "data_exclusion_query": "account_id:12345"}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "suppressions" @@ -867,7 +867,7 @@ Feature: Security Monitoring Scenario: Update a suppression rule returns "Bad Request" response Given new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @@ -875,7 +875,7 @@ Feature: Security Monitoring Scenario: Update a suppression rule returns "Concurrent Modification" response Given new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 409 Concurrent Modification @@ -883,7 +883,7 @@ Feature: Security Monitoring Scenario: Update a suppression rule returns "Not Found" response Given new "UpdateSecurityMonitoringSuppression" request And request contains "suppression_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "suppression_query": "env:staging status:low"}, "type": "suppressions"}} + And body with value {"data": {"attributes": {"data_exclusion_query": "source:cloudtrail account_id:12345", "description": "This rule suppresses low-severity signals in staging environments.", "enabled": true, "expiration_date": 1703187336000, "name": "Custom suppression", "rule_query": "type:log_detection source:cloudtrail", "start_date": 1703187336000, "suppression_query": "env:staging status:low"}, "type": "suppressions"}} When the request is sent Then the response status is 404 Not Found