diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 922424a28dc..f9a4ea8590d 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.java b/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java index 685722c4cea..c4ec17e5c0b 100644 --- a/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringSuppression.java @@ -8,6 +8,7 @@ import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionCreateRequest; import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionResponse; import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionType; +import java.util.Arrays; public class Example { public static void main(String[] args) { @@ -28,7 +29,9 @@ public static void main(String[] args) { .expirationDate(1638443471000L) .name("Example-Security-Monitoring") .ruleQuery("type:log_detection source:cloudtrail") - .suppressionQuery("env:staging status:low")) + .suppressionQuery("env:staging status:low") + .tags( + Arrays.asList("technique:T1110-brute-force", "source:cloudtrail"))) .type(SecurityMonitoringSuppressionType.SUPPRESSIONS)); try { diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java index c788420a226..056e259348e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionAttributes.java @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -29,6 +31,7 @@ SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_RULE_QUERY, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_START_DATE, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_SUPPRESSION_QUERY, + SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_TAGS, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_UPDATE_DATE, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_UPDATER, SecurityMonitoringSuppressionAttributes.JSON_PROPERTY_VERSION @@ -70,6 +73,9 @@ public class SecurityMonitoringSuppressionAttributes { public static final String JSON_PROPERTY_SUPPRESSION_QUERY = "suppression_query"; private String suppressionQuery; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public static final String JSON_PROPERTY_UPDATE_DATE = "update_date"; private Long updateDate; @@ -317,6 +323,35 @@ public void setSuppressionQuery(String suppressionQuery) { this.suppressionQuery = suppressionQuery; } + public SecurityMonitoringSuppressionAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public SecurityMonitoringSuppressionAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * List of tags associated with the suppression rule. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + public SecurityMonitoringSuppressionAttributes updateDate(Long updateDate) { this.updateDate = updateDate; return this; @@ -453,6 +488,7 @@ public boolean equals(Object o) { && Objects.equals(this.startDate, securityMonitoringSuppressionAttributes.startDate) && Objects.equals( this.suppressionQuery, securityMonitoringSuppressionAttributes.suppressionQuery) + && Objects.equals(this.tags, securityMonitoringSuppressionAttributes.tags) && Objects.equals(this.updateDate, securityMonitoringSuppressionAttributes.updateDate) && Objects.equals(this.updater, securityMonitoringSuppressionAttributes.updater) && Objects.equals(this.version, securityMonitoringSuppressionAttributes.version) @@ -475,6 +511,7 @@ public int hashCode() { ruleQuery, startDate, suppressionQuery, + tags, updateDate, updater, version, @@ -496,6 +533,7 @@ public String toString() { sb.append(" ruleQuery: ").append(toIndentedString(ruleQuery)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" suppressionQuery: ").append(toIndentedString(suppressionQuery)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" updateDate: ").append(toIndentedString(updateDate)).append("\n"); sb.append(" updater: ").append(toIndentedString(updater)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java index aa6fd9c26ea..5d1ec473933 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionCreateAttributes.java @@ -13,7 +13,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; @@ -26,7 +28,8 @@ SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_NAME, SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_RULE_QUERY, SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_START_DATE, - SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_SUPPRESSION_QUERY + SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_SUPPRESSION_QUERY, + SecurityMonitoringSuppressionCreateAttributes.JSON_PROPERTY_TAGS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -56,6 +59,9 @@ public class SecurityMonitoringSuppressionCreateAttributes { public static final String JSON_PROPERTY_SUPPRESSION_QUERY = "suppression_query"; private String suppressionQuery; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public SecurityMonitoringSuppressionCreateAttributes() {} @JsonCreator @@ -241,6 +247,35 @@ public void setSuppressionQuery(String suppressionQuery) { this.suppressionQuery = suppressionQuery; } + public SecurityMonitoringSuppressionCreateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public SecurityMonitoringSuppressionCreateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * List of tags associated with the suppression rule. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -312,6 +347,7 @@ public boolean equals(Object o) { && Objects.equals(this.startDate, securityMonitoringSuppressionCreateAttributes.startDate) && Objects.equals( this.suppressionQuery, securityMonitoringSuppressionCreateAttributes.suppressionQuery) + && Objects.equals(this.tags, securityMonitoringSuppressionCreateAttributes.tags) && Objects.equals( this.additionalProperties, securityMonitoringSuppressionCreateAttributes.additionalProperties); @@ -328,6 +364,7 @@ public int hashCode() { ruleQuery, startDate, suppressionQuery, + tags, additionalProperties); } @@ -343,6 +380,7 @@ public String toString() { sb.append(" ruleQuery: ").append(toIndentedString(ruleQuery)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" suppressionQuery: ").append(toIndentedString(suppressionQuery)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java index 6378a0a89f3..b9c092d8902 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringSuppressionUpdateAttributes.java @@ -12,7 +12,9 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import org.openapitools.jackson.nullable.JsonNullable; @@ -27,6 +29,7 @@ SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_RULE_QUERY, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_START_DATE, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_SUPPRESSION_QUERY, + SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_TAGS, SecurityMonitoringSuppressionUpdateAttributes.JSON_PROPERTY_VERSION }) @jakarta.annotation.Generated( @@ -57,6 +60,9 @@ public class SecurityMonitoringSuppressionUpdateAttributes { public static final String JSON_PROPERTY_SUPPRESSION_QUERY = "suppression_query"; private String suppressionQuery; + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + public static final String JSON_PROPERTY_VERSION = "version"; private Integer version; @@ -257,6 +263,35 @@ public void setSuppressionQuery(String suppressionQuery) { this.suppressionQuery = suppressionQuery; } + public SecurityMonitoringSuppressionUpdateAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public SecurityMonitoringSuppressionUpdateAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * List of tags associated with the suppression rule. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + public SecurityMonitoringSuppressionUpdateAttributes version(Integer version) { this.version = version; return this; @@ -350,6 +385,7 @@ public boolean equals(Object o) { && Objects.equals(this.startDate, securityMonitoringSuppressionUpdateAttributes.startDate) && Objects.equals( this.suppressionQuery, securityMonitoringSuppressionUpdateAttributes.suppressionQuery) + && Objects.equals(this.tags, securityMonitoringSuppressionUpdateAttributes.tags) && Objects.equals(this.version, securityMonitoringSuppressionUpdateAttributes.version) && Objects.equals( this.additionalProperties, @@ -367,6 +403,7 @@ public int hashCode() { ruleQuery, startDate, suppressionQuery, + tags, version, additionalProperties); } @@ -383,6 +420,7 @@ public String toString() { sb.append(" ruleQuery: ").append(toIndentedString(ruleQuery)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" suppressionQuery: ").append(toIndentedString(suppressionQuery)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze index 28bfbcc2df0..0a54330ca5a 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json index 5220cfa5d6a..fff7a59f993 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_suppression_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}}" + "json": "{\"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\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"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}}}", + "body": "{\"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}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "935a1a23-dd04-eabb-dc7d-2dd3caa616f9" + "id": "18b138fa-5532-048a-aeca-2cc970b03b98" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/ejv-ksi-r4j", + "path": "/api/v2/security_monitoring/configuration/suppressions/oxk-jlo-pc8", "keepAlive": false, "secure": true }, @@ -48,6 +48,6 @@ "timeToLive": { "unlimited": true }, - "id": "b62286dc-79a3-ad34-84cf-c79401028e80" + "id": "273543e6-7c61-0a4b-b960-dfa949ae3868" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.freeze index 603587527a8..3f3e3c99f21 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.json index 3e04c9bf110..d243fbd8f58 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_suppression_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}}" + "json": "{\"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\"}}" }, "headers": {}, "method": "POST", @@ -12,10 +12,10 @@ "secure": true }, "httpResponse": { - "body": "{\"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", + "body": "{\"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}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -27,22 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "e6655e94-cb79-3ce1-4e5d-1729209d0834" + "id": "f181dced-eb3e-bfdd-020a-40965b7229b2" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/csf-zrg-af0", + "path": "/api/v2/security_monitoring/configuration/suppressions/uea-lab-big", "keepAlive": false, "secure": true }, "httpResponse": { - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "statusCode": 204, "reasonPhrase": "No Content" }, @@ -52,18 +48,18 @@ "timeToLive": { "unlimited": true }, - "id": "ae7f3023-a499-f541-5094-584fbf12c187" + "id": "2b54ce26-df1a-55f2-8376-9da4db5d8f64" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/csf-zrg-af0", + "path": "/api/v2/security_monitoring/configuration/suppressions/uea-lab-big", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[\"not_found(Suppression with ID csf-zrg-af0 not found)\"]}\n", + "body": "{\"errors\":[\"not_found(Suppression with ID uea-lab-big not found)\"]}", "headers": { "Content-Type": [ "application/json" @@ -78,6 +74,6 @@ "timeToLive": { "unlimited": true }, - "id": "ae7f3023-a499-f541-5094-584fbf12c188" + "id": "2b54ce26-df1a-55f2-8376-9da4db5d8f65" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.freeze index f47bd5ef378..a93a4d20e75 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.json index 55c2b109b55..69727929aad 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_suppression_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}}" + "json": "{\"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\"}}" }, "headers": {}, "method": "POST", @@ -12,10 +12,10 @@ "secure": true }, "httpResponse": { - "body": "{\"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", + "body": "{\"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}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -27,21 +27,21 @@ "timeToLive": { "unlimited": true }, - "id": "28945bff-c71e-12fa-a466-d32c8d968f4f" + "id": "de8b198e-3f08-189d-bac5-8243a23a6c6e" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/security_monitoring/configuration/suppressions/ol3-0o2-rrp", + "path": "/api/v2/security_monitoring/configuration/suppressions/ylq-igi-icg", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"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", + "body": "{\"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}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -53,22 +53,18 @@ "timeToLive": { "unlimited": true }, - "id": "91fa7f69-bb6b-48bb-85f0-1b00a1303869" + "id": "e4ea82bb-5963-1f7b-73f1-b145f01a869a" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/ol3-0o2-rrp", + "path": "/api/v2/security_monitoring/configuration/suppressions/ylq-igi-icg", "keepAlive": false, "secure": true }, "httpResponse": { - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "statusCode": 204, "reasonPhrase": "No Content" }, @@ -78,6 +74,6 @@ "timeToLive": { "unlimited": true }, - "id": "d74f3ada-6384-c5d6-3983-a320dda332ea" + "id": "eb9719a8-99ec-7157-d461-3899c802b2f0" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.freeze index a2d489e4419..8839a50677d 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.freeze @@ -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/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.json index 274b1f1b3af..645a5152204 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_suppression_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"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\"}}" + "json": "{\"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\"}}" }, "headers": {}, "method": "POST", @@ -12,10 +12,10 @@ "secure": true }, "httpResponse": { - "body": "{\"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", + "body": "{\"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}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "5262b6a1-2de0-ea76-df58-f1a3880f66a0" + "id": "bb8c27c9-c16b-7adf-78e2-98be963db101" }, { "httpRequest": { @@ -37,15 +37,15 @@ }, "headers": {}, "method": "PATCH", - "path": "/api/v2/security_monitoring/configuration/suppressions/pej-nbn-ai7", + "path": "/api/v2/security_monitoring/configuration/suppressions/uqt-hh6-qbq", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"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", + "body": "{\"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}}}", "headers": { "Content-Type": [ - "application/json" + "application/vnd.api+json" ] }, "statusCode": 200, @@ -57,22 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "ba1aaf9c-7d61-da15-1fa5-0d8744b39467" + "id": "448c55e0-3dab-a9db-29da-dd5cdf04a54d" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/configuration/suppressions/pej-nbn-ai7", + "path": "/api/v2/security_monitoring/configuration/suppressions/uqt-hh6-qbq", "keepAlive": false, "secure": true }, "httpResponse": { - "headers": { - "Content-Type": [ - "text/html; charset=utf-8" - ] - }, + "headers": {}, "statusCode": 204, "reasonPhrase": "No Content" }, @@ -82,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "9b97de2e-1171-319c-e6df-8a3f8a830097" + "id": "d894e2e4-7856-f636-96c8-8e4a1ef9a9be" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 12852be0f21..4ee7b3a6f95 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 2937151efb2..531c84c19c1 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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