From 4c0663bfc6cb7eb11025facb63a6a22381bdd7c3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 12 Nov 2025 18:32:49 +0000 Subject: [PATCH] Regenerate client from commit 46390f1 of spec repo --- .generator/schemas/v2/openapi.yaml | 24 +++++++++++++++++ ...ing_CreateSecurityMonitoringSuppression.rs | 6 ++++- ...urity_monitoring_suppression_attributes.rs | 17 ++++++++++++ ...onitoring_suppression_create_attributes.rs | 17 ++++++++++++ ...onitoring_suppression_update_attributes.rs | 17 ++++++++++++ ...uppression-rule-returns-OK-response.frozen | 2 +- ...-suppression-rule-returns-OK-response.json | 10 +++---- ...uppression-rule-returns-OK-response.frozen | 2 +- ...-suppression-rule-returns-OK-response.json | 24 +++++++---------- ...uppression-rule-returns-OK-response.frozen | 2 +- ...-suppression-rule-returns-OK-response.json | 26 ++++++++----------- ...uppression-rule-returns-OK-response.frozen | 2 +- ...-suppression-rule-returns-OK-response.json | 26 ++++++++----------- tests/scenarios/features/v2/given.json | 2 +- .../features/v2/security_monitoring.feature | 12 ++++----- 15 files changed, 128 insertions(+), 61 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 922424a28..f9a4ea859 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -46991,6 +46991,14 @@ components: the queries to search signals in the signal explorer. example: env:staging status:low type: string + tags: + description: List of tags associated with the suppression rule. + example: + - technique:T1110-brute-force + - source:cloudtrail + items: + type: string + type: array update_date: description: A Unix millisecond timestamp given the update date of the suppression rule. @@ -47052,6 +47060,14 @@ components: same syntax as the queries to search signals in the Signals Explorer. example: env:staging status:low type: string + tags: + description: List of tags associated with the suppression rule. + example: + - technique:T1110-brute-force + - source:cloudtrail + items: + type: string + type: array required: - name - enabled @@ -47147,6 +47163,14 @@ components: the queries to search signals in the signal explorer. example: env:staging status:low type: string + tags: + description: List of tags associated with the suppression rule. + example: + - technique:T1110-brute-force + - source:cloudtrail + items: + type: string + type: array version: description: The current version of the suppression. This is optional, but it can help prevent concurrent modifications. diff --git a/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs b/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs index 5d0c4ddc6..1024825bc 100644 --- a/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs +++ b/examples/v2_security-monitoring_CreateSecurityMonitoringSuppression.rs @@ -20,7 +20,11 @@ async fn main() { ) .expiration_date(1638443471000) .start_date(1637493071000) - .suppression_query("env:staging status:low".to_string()), + .suppression_query("env:staging status:low".to_string()) + .tags(vec![ + "technique:T1110-brute-force".to_string(), + "source:cloudtrail".to_string(), + ]), 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 fd6270dcf..941ed881e 100644 --- a/src/datadogV2/model/model_security_monitoring_suppression_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_suppression_attributes.rs @@ -44,6 +44,9 @@ pub struct SecurityMonitoringSuppressionAttributes { /// 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, + /// List of tags associated with the suppression rule. + #[serde(rename = "tags")] + pub tags: Option>, /// A Unix millisecond timestamp given the update date of the suppression rule. #[serde(rename = "update_date")] pub update_date: Option, @@ -74,6 +77,7 @@ impl SecurityMonitoringSuppressionAttributes { rule_query: None, start_date: None, suppression_query: None, + tags: None, update_date: None, updater: None, version: None, @@ -137,6 +141,11 @@ impl SecurityMonitoringSuppressionAttributes { self } + pub fn tags(mut self, value: Vec) -> Self { + self.tags = Some(value); + self + } + pub fn update_date(mut self, value: i64) -> Self { self.update_date = Some(value); self @@ -195,6 +204,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes { let mut rule_query: Option = None; let mut start_date: Option = None; let mut suppression_query: Option = None; + let mut tags: Option> = None; let mut update_date: Option = None; let mut updater: Option = None; let mut version: Option = None; @@ -277,6 +287,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes { suppression_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "tags" => { + if v.is_null() { + continue; + } + tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "update_date" => { if v.is_null() { continue; @@ -316,6 +332,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionAttributes { rule_query, start_date, suppression_query, + tags, update_date, updater, version, 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 79dc46f23..458e3ba96 100644 --- a/src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_suppression_create_attributes.rs @@ -35,6 +35,9 @@ pub struct SecurityMonitoringSuppressionCreateAttributes { /// 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, + /// List of tags associated with the suppression rule. + #[serde(rename = "tags")] + pub tags: Option>, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -57,6 +60,7 @@ impl SecurityMonitoringSuppressionCreateAttributes { rule_query, start_date: None, suppression_query: None, + tags: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -87,6 +91,11 @@ impl SecurityMonitoringSuppressionCreateAttributes { self } + pub fn tags(mut self, value: Vec) -> Self { + self.tags = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -121,6 +130,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes { let mut rule_query: Option = None; let mut start_date: Option = None; let mut suppression_query: Option = None; + let mut tags: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -172,6 +182,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes { suppression_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "tags" => { + if v.is_null() { + continue; + } + tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { additional_properties.insert(k, value); @@ -192,6 +208,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionCreateAttributes { rule_query, start_date, suppression_query, + tags, 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 6d9bc1807..d9f682933 100644 --- a/src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs +++ b/src/datadogV2/model/model_security_monitoring_suppression_update_attributes.rs @@ -43,6 +43,9 @@ pub struct SecurityMonitoringSuppressionUpdateAttributes { /// 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, + /// List of tags associated with the suppression rule. + #[serde(rename = "tags")] + pub tags: Option>, /// The current version of the suppression. This is optional, but it can help prevent concurrent modifications. #[serde(rename = "version")] pub version: Option, @@ -64,6 +67,7 @@ impl SecurityMonitoringSuppressionUpdateAttributes { rule_query: None, start_date: None, suppression_query: None, + tags: None, version: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -110,6 +114,11 @@ impl SecurityMonitoringSuppressionUpdateAttributes { self } + pub fn tags(mut self, value: Vec) -> Self { + self.tags = Some(value); + self + } + pub fn version(mut self, value: i32) -> Self { self.version = Some(value); self @@ -155,6 +164,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes { let mut rule_query: Option = None; let mut start_date: Option> = None; let mut suppression_query: Option = None; + let mut tags: Option> = None; let mut version: Option = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -210,6 +220,12 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes { suppression_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "tags" => { + if v.is_null() { + continue; + } + tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "version" => { if v.is_null() { continue; @@ -233,6 +249,7 @@ impl<'de> Deserialize<'de> for SecurityMonitoringSuppressionUpdateAttributes { rule_query, start_date, suppression_query, + tags, version, additional_properties, _unparsed, 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 28bfbcc2d..0a54330ca 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-11-27T15:22:34.711Z \ No newline at end of file +2025-11-07T12:27:25.514Z \ 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 c5b8f17c7..7002abfde 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\":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\"}}", + "string": "{\"data\":{\"attributes\":{\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"enabled\":true,\"expiration_date\":1764332845000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1762518445\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1763382445000,\"suppression_query\":\"env:staging status:low\",\"tags\":[\"technique:T1110-brute-force\",\"source:cloudtrail\"]},\"type\":\"suppressions\"}}", "encoding": null }, "headers": { @@ -19,7 +19,7 @@ }, "response": { "body": { - "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}}}", + "string": "{\"data\":{\"id\":\"oxk-jlo-pc8\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1762518446390,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"data_exclusion_query\":\"\",\"description\":\"This rule suppresses low-severity signals in staging environments.\",\"editable\":true,\"enabled\":true,\"expiration_date\":1764332845000,\"name\":\"Test-Create_a_suppression_rule_returns_OK_response-1762518445\",\"rule_query\":\"type:log_detection source:cloudtrail\",\"start_date\":1763382445000,\"suppression_query\":\"env:staging status:low\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1762518446390,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}", "encoding": null }, "headers": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Wed, 27 Nov 2024 15:22:34 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:25 GMT" }, { "request": { @@ -43,7 +43,7 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ejv-ksi-r4j" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/oxk-jlo-pc8" }, "response": { "body": { @@ -56,7 +56,7 @@ "message": "No Content" } }, - "recorded_at": "Wed, 27 Nov 2024 15:22:34 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:25 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen index 603587527..3f3e3c99f 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen +++ b/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2024-05-10T16:34:39.853Z \ No newline at end of file +2025-11-07T12:27:26.759Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.json index 35e7ca0d0..1999e443e 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.json +++ b/tests/scenarios/cassettes/v2/security_monitoring/Delete-a-suppression-rule-returns-OK-response.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"description\":\"Test-Delete_a_suppression_rule_returns_OK_response-1715358879\",\"enabled\":true,\"name\":\"Test-Delete_a_suppression_rule_returns_OK_response-1715358879\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\"},\"type\":\"suppressions\"}}", + "string": "{\"data\":{\"attributes\":{\"description\":\"Test-Delete_a_suppression_rule_returns_OK_response-1762518446\",\"enabled\":true,\"name\":\"Test-Delete_a_suppression_rule_returns_OK_response-1762518446\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"technique:T1110-brute-force\",\"source:cloudtrail\"]},\"type\":\"suppressions\"}}", "encoding": null }, "headers": { @@ -19,12 +19,12 @@ }, "response": { "body": { - "string": "{\"data\":{\"id\":\"csf-zrg-af0\",\"attributes\":{\"name\":\"Test-Delete_a_suppression_rule_returns_OK_response-1715358879\",\"enabled\":true,\"description\":\"Test-Delete_a_suppression_rule_returns_OK_response-1715358879\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"data_exclusion_query\":\"\",\"version\":1,\"creation_date\":1715358880145,\"update_date\":1715358880145,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"uea-lab-big\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1762518447002,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"data_exclusion_query\":\"\",\"description\":\"Test-Delete_a_suppression_rule_returns_OK_response-1762518446\",\"editable\":true,\"enabled\":true,\"name\":\"Test-Delete_a_suppression_rule_returns_OK_response-1762518446\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1762518447002,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Fri, 10 May 2024 16:34:39 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:26 GMT" }, { "request": { @@ -43,24 +43,20 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/csf-zrg-af0" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uea-lab-big" }, "response": { "body": { "string": "", "encoding": null }, - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "status": { "code": 204, "message": "No Content" } }, - "recorded_at": "Fri, 10 May 2024 16:34:39 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:26 GMT" }, { "request": { @@ -71,11 +67,11 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/csf-zrg-af0" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uea-lab-big" }, "response": { "body": { - "string": "{\"errors\":[\"not_found(Suppression with ID csf-zrg-af0 not found)\"]}\n", + "string": "{\"errors\":[\"not_found(Suppression with ID uea-lab-big not found)\"]}", "encoding": null }, "headers": { @@ -88,7 +84,7 @@ "message": "Not Found" } }, - "recorded_at": "Fri, 10 May 2024 16:34:39 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:26 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen index f47bd5ef3..a93a4d20e 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen +++ b/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2024-05-10T16:34:46.398Z \ No newline at end of file +2025-11-07T12:27:27.654Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.json index 3b76fe5ca..da9029a76 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.json +++ b/tests/scenarios/cassettes/v2/security_monitoring/Get-a-suppression-rule-returns-OK-response.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"description\":\"Test-Get_a_suppression_rule_returns_OK_response-1715358886\",\"enabled\":true,\"name\":\"Test-Get_a_suppression_rule_returns_OK_response-1715358886\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\"},\"type\":\"suppressions\"}}", + "string": "{\"data\":{\"attributes\":{\"description\":\"Test-Get_a_suppression_rule_returns_OK_response-1762518447\",\"enabled\":true,\"name\":\"Test-Get_a_suppression_rule_returns_OK_response-1762518447\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"technique:T1110-brute-force\",\"source:cloudtrail\"]},\"type\":\"suppressions\"}}", "encoding": null }, "headers": { @@ -19,12 +19,12 @@ }, "response": { "body": { - "string": "{\"data\":{\"id\":\"ol3-0o2-rrp\",\"attributes\":{\"name\":\"Test-Get_a_suppression_rule_returns_OK_response-1715358886\",\"enabled\":true,\"description\":\"Test-Get_a_suppression_rule_returns_OK_response-1715358886\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"data_exclusion_query\":\"\",\"version\":1,\"creation_date\":1715358886671,\"update_date\":1715358886671,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"ylq-igi-icg\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1762518447901,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"data_exclusion_query\":\"\",\"description\":\"Test-Get_a_suppression_rule_returns_OK_response-1762518447\",\"editable\":true,\"enabled\":true,\"name\":\"Test-Get_a_suppression_rule_returns_OK_response-1762518447\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1762518447901,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Fri, 10 May 2024 16:34:46 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:27 GMT" }, { "request": { @@ -43,16 +43,16 @@ ] }, "method": "get", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ol3-0o2-rrp" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ylq-igi-icg" }, "response": { "body": { - "string": "{\"data\":{\"id\":\"ol3-0o2-rrp\",\"attributes\":{\"name\":\"Test-Get_a_suppression_rule_returns_OK_response-1715358886\",\"enabled\":true,\"description\":\"Test-Get_a_suppression_rule_returns_OK_response-1715358886\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"data_exclusion_query\":\"\",\"version\":1,\"creation_date\":1715358886671,\"update_date\":1715358886671,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"ylq-igi-icg\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1762518447901,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"data_exclusion_query\":\"\",\"description\":\"Test-Get_a_suppression_rule_returns_OK_response-1762518447\",\"editable\":true,\"enabled\":true,\"name\":\"Test-Get_a_suppression_rule_returns_OK_response-1762518447\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1762518447901,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -60,7 +60,7 @@ "message": "OK" } }, - "recorded_at": "Fri, 10 May 2024 16:34:46 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:27 GMT" }, { "request": { @@ -71,24 +71,20 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ol3-0o2-rrp" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ylq-igi-icg" }, "response": { "body": { "string": "", "encoding": null }, - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "status": { "code": 204, "message": "No Content" } }, - "recorded_at": "Fri, 10 May 2024 16:34:46 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:27 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen index a2d489e44..8839a5067 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen +++ b/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.frozen @@ -1 +1 @@ -2024-05-10T16:34:51.901Z \ No newline at end of file +2025-11-07T12:27:28.613Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.json index 30b6958b0..80dc5bfb1 100644 --- a/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.json +++ b/tests/scenarios/cassettes/v2/security_monitoring/Update-a-suppression-rule-returns-OK-response.json @@ -3,7 +3,7 @@ { "request": { "body": { - "string": "{\"data\":{\"attributes\":{\"description\":\"Test-Update_a_suppression_rule_returns_OK_response-1715358891\",\"enabled\":true,\"name\":\"Test-Update_a_suppression_rule_returns_OK_response-1715358891\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\"},\"type\":\"suppressions\"}}", + "string": "{\"data\":{\"attributes\":{\"description\":\"Test-Update_a_suppression_rule_returns_OK_response-1762518448\",\"enabled\":true,\"name\":\"Test-Update_a_suppression_rule_returns_OK_response-1762518448\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"technique:T1110-brute-force\",\"source:cloudtrail\"]},\"type\":\"suppressions\"}}", "encoding": null }, "headers": { @@ -19,12 +19,12 @@ }, "response": { "body": { - "string": "{\"data\":{\"id\":\"pej-nbn-ai7\",\"attributes\":{\"name\":\"Test-Update_a_suppression_rule_returns_OK_response-1715358891\",\"enabled\":true,\"description\":\"Test-Update_a_suppression_rule_returns_OK_response-1715358891\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"data_exclusion_query\":\"\",\"version\":1,\"creation_date\":1715358892289,\"update_date\":1715358892289,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"uqt-hh6-qbq\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1762518448839,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"data_exclusion_query\":\"\",\"description\":\"Test-Update_a_suppression_rule_returns_OK_response-1762518448\",\"editable\":true,\"enabled\":true,\"name\":\"Test-Update_a_suppression_rule_returns_OK_response-1762518448\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:test\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1762518448839,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":1}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -32,7 +32,7 @@ "message": "OK" } }, - "recorded_at": "Fri, 10 May 2024 16:34:51 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:28 GMT" }, { "request": { @@ -49,16 +49,16 @@ ] }, "method": "patch", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/pej-nbn-ai7" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uqt-hh6-qbq" }, "response": { "body": { - "string": "{\"data\":{\"id\":\"pej-nbn-ai7\",\"attributes\":{\"name\":\"Test-Update_a_suppression_rule_returns_OK_response-1715358891\",\"enabled\":true,\"description\":\"Test-Update_a_suppression_rule_returns_OK_response-1715358891\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:staging status:low\",\"data_exclusion_query\":\"\",\"version\":2,\"creation_date\":1715358892289,\"update_date\":1715358892759,\"creator\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"},\"updater\":{\"name\":null,\"handle\":\"frog@datadoghq.com\"}},\"type\":\"suppressions\"}}\n", + "string": "{\"data\":{\"id\":\"uqt-hh6-qbq\",\"type\":\"suppressions\",\"attributes\":{\"creation_date\":1762518448839,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"data_exclusion_query\":\"\",\"description\":\"Test-Update_a_suppression_rule_returns_OK_response-1762518448\",\"editable\":true,\"enabled\":true,\"name\":\"Test-Update_a_suppression_rule_returns_OK_response-1762518448\",\"rule_query\":\"source:cloudtrail\",\"suppression_query\":\"env:staging status:low\",\"tags\":[\"source:cloudtrail\",\"technique:T1110-brute-force\"],\"update_date\":1762518449150,\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"version\":2}}}", "encoding": null }, "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "status": { @@ -66,7 +66,7 @@ "message": "OK" } }, - "recorded_at": "Fri, 10 May 2024 16:34:51 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:28 GMT" }, { "request": { @@ -77,24 +77,20 @@ ] }, "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/pej-nbn-ai7" + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/uqt-hh6-qbq" }, "response": { "body": { "string": "", "encoding": null }, - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "status": { "code": 204, "message": "No Content" } }, - "recorded_at": "Fri, 10 May 2024 16:34:51 GMT" + "recorded_at": "Fri, 07 Nov 2025 12:27:28 GMT" } ], "recorded_with": "VCR 6.0.0" diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 12852be0f..4ee7b3a6f 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -967,7 +967,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"{{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\"\n }\n }\n}" + "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"{{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" } ], "step": "there is a valid \"suppression\" in the system", diff --git a/tests/scenarios/features/v2/security_monitoring.feature b/tests/scenarios/features/v2/security_monitoring.feature index 2937151ef..531c84c19 100644 --- a/tests/scenarios/features/v2/security_monitoring.feature +++ b/tests/scenarios/features/v2/security_monitoring.feature @@ -376,21 +376,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", "start_date": 1703187336000, "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", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "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", "start_date": 1703187336000, "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", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "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, "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"}} + 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", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}} When the request is sent Then the response status is 200 OK And the response "data.type" is equal to "suppressions" @@ -1474,7 +1474,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", "start_date": 1703187336000, "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", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}} When the request is sent Then the response status is 400 Bad Request @@ -1482,7 +1482,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", "start_date": 1703187336000, "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", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}} When the request is sent Then the response status is 409 Concurrent Modification @@ -1490,7 +1490,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", "start_date": 1703187336000, "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", "tags": ["technique:T1110-brute-force", "source:cloudtrail"]}, "type": "suppressions"}} When the request is sent Then the response status is 404 Not Found