Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 105 additions & 26 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23526,6 +23526,30 @@ components:
required:
- data
type: object
GetSuppressionVersionHistoryData:
description: Data for the suppression version history.
properties:
attributes:
$ref: '#/components/schemas/SuppressionVersionHistory'
id:
description: ID of the suppression.
type: string
type:
$ref: '#/components/schemas/GetSuppressionVersionHistoryDataType'
type: object
GetSuppressionVersionHistoryDataType:
description: Type of data.
enum:
- suppression_version_history
type: string
x-enum-varnames:
- SUPPRESSIONVERSIONHISTORY
GetSuppressionVersionHistoryResponse:
description: Response for getting the suppression version history.
properties:
data:
$ref: '#/components/schemas/GetSuppressionVersionHistoryData'
type: object
GetTeamMembershipsSort:
description: Specifies the order of returned team memberships
enum:
Expand Down Expand Up @@ -42745,38 +42769,13 @@ components:
description: The `RuleVersionHistory` `data`.
type: object
type: object
RuleVersionUpdate:
description: A change in a rule version.
properties:
change:
description: The new value of the field.
example: cloud_provider:aws
type: string
field:
description: The field that was changed.
example: Tags
type: string
type:
$ref: '#/components/schemas/RuleVersionUpdateType'
type: object
RuleVersionUpdateType:
description: The type of change.
enum:
- create
- update
- delete
type: string
x-enum-varnames:
- CREATE
- UPDATE
- DELETE
RuleVersions:
description: A rule version with a list of updates.
properties:
changes:
description: A list of changes.
items:
$ref: '#/components/schemas/RuleVersionUpdate'
$ref: '#/components/schemas/VersionHistoryUpdate'
type: array
rule:
$ref: '#/components/schemas/SecurityMonitoringRuleResponse'
Expand Down Expand Up @@ -51322,6 +51321,32 @@ components:
format: double
type: number
type: object
SuppressionVersionHistory:
description: Response object containing the version history of a suppression.
properties:
count:
description: The number of suppression versions.
format: int32
maximum: 2147483647
type: integer
data:
additionalProperties:
$ref: '#/components/schemas/SuppressionVersions'
description: A suppression version with a list of updates.
description: The version history of a suppression.
type: object
type: object
SuppressionVersions:
description: A suppression version with a list of updates.
properties:
changes:
description: A list of changes.
items:
$ref: '#/components/schemas/VersionHistoryUpdate'
type: array
suppression:
$ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes'
type: object
TableResultV2:
description: A reference table resource containing its full configuration and
state.
Expand Down Expand Up @@ -55372,6 +55397,31 @@ components:
example: 1
format: int64
type: integer
VersionHistoryUpdate:
description: A change in a rule version.
properties:
change:
description: The new value of the field.
example: cloud_provider:aws
type: string
field:
description: The field that was changed.
example: Tags
type: string
type:
$ref: '#/components/schemas/VersionHistoryUpdateType'
type: object
VersionHistoryUpdateType:
description: The type of change.
enum:
- create
- update
- delete
type: string
x-enum-varnames:
- CREATE
- UPDATE
- DELETE
VirusTotalAPIKey:
description: The definition of the `VirusTotalAPIKey` object.
properties:
Expand Down Expand Up @@ -79065,6 +79115,35 @@ paths:
summary: Update a suppression rule
tags:
- Security Monitoring
/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history:
get:
description: Get a suppression's version history.
operationId: GetSuppressionVersionHistory
parameters:
- $ref: '#/components/parameters/SecurityMonitoringSuppressionID'
- $ref: '#/components/parameters/PageSize'
- $ref: '#/components/parameters/PageNumber'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/GetSuppressionVersionHistoryResponse'
description: OK
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- security_monitoring_suppressions_read
summary: Get a suppression's version history
tags:
- Security Monitoring
/api/v2/security_monitoring/rules:
get:
description: List rules.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-11-26T13:33:06.081Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2025-11-26T13:33:06.482Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Get a suppression's version history returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

# there is a valid "suppression" in the system
SUPPRESSION_DATA_ID = ENV["SUPPRESSION_DATA_ID"]
p api_instance.get_suppression_version_history(SUPPRESSION_DATA_ID)
5 changes: 5 additions & 0 deletions features/scenarios_model_mapping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,11 @@
"suppression_id" => "String",
"body" => "SecurityMonitoringSuppressionUpdateRequest",
},
"v2.GetSuppressionVersionHistory" => {
"suppression_id" => "String",
"page_size" => "Integer",
"page_number" => "Integer",
},
"v2.ListSecurityMonitoringRules" => {
"page_size" => "Integer",
"page_number" => "Integer",
Expand Down
15 changes: 15 additions & 0 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,21 @@ Feature: Security Monitoring
And the response "data.attributes.rule_query" has the same value as "suppression.data.attributes.rule_query"
And the response "data.attributes.suppression_query" is equal to "env:test"

@team:DataDog/k9-cloud-security-platform
Scenario: Get a suppression's version history returns "Not Found" response
Given new "GetSuppressionVersionHistory" request
And request contains "suppression_id" parameter with value "this-does-not-exist"
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-cloud-security-platform
Scenario: Get a suppression's version history returns "OK" response
Given new "GetSuppressionVersionHistory" request
And there is a valid "suppression" in the system
And request contains "suppression_id" parameter from "suppression.data.id"
When the request is sent
Then the response status is 200 OK

@team:DataDog/k9-cloud-security-platform
Scenario: Get all security filters returns "OK" response
Given new "ListSecurityFilters" request
Expand Down
6 changes: 6 additions & 0 deletions features/v2/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3830,6 +3830,12 @@
"type": "idempotent"
}
},
"GetSuppressionVersionHistory": {
"tag": "Security Monitoring",
"undo": {
"type": "safe"
}
},
"ListSecurityMonitoringRules": {
"tag": "Security Monitoring",
"undo": {
Expand Down
9 changes: 7 additions & 2 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2366,6 +2366,9 @@ def overrides
"v2.get_rule_version_history_data_type" => "GetRuleVersionHistoryDataType",
"v2.get_rule_version_history_response" => "GetRuleVersionHistoryResponse",
"v2.get_sbom_response" => "GetSBOMResponse",
"v2.get_suppression_version_history_data" => "GetSuppressionVersionHistoryData",
"v2.get_suppression_version_history_data_type" => "GetSuppressionVersionHistoryDataType",
"v2.get_suppression_version_history_response" => "GetSuppressionVersionHistoryResponse",
"v2.get_team_memberships_sort" => "GetTeamMembershipsSort",
"v2.get_workflow_response" => "GetWorkflowResponse",
"v2.github_webhook_trigger" => "GithubWebhookTrigger",
Expand Down Expand Up @@ -3621,8 +3624,6 @@ def overrides
"v2.rule_user" => "RuleUser",
"v2.rule_version_history" => "RuleVersionHistory",
"v2.rule_versions" => "RuleVersions",
"v2.rule_version_update" => "RuleVersionUpdate",
"v2.rule_version_update_type" => "RuleVersionUpdateType",
"v2.rum_aggregate_bucket_value" => "RUMAggregateBucketValue",
"v2.rum_aggregate_bucket_value_timeseries_point" => "RUMAggregateBucketValueTimeseriesPoint",
"v2.rum_aggregate_request" => "RUMAggregateRequest",
Expand Down Expand Up @@ -4179,6 +4180,8 @@ def overrides
"v2.step" => "Step",
"v2.step_display" => "StepDisplay",
"v2.step_display_bounds" => "StepDisplayBounds",
"v2.suppression_version_history" => "SuppressionVersionHistory",
"v2.suppression_versions" => "SuppressionVersions",
"v2.table_result_v2" => "TableResultV2",
"v2.table_result_v2_array" => "TableResultV2Array",
"v2.table_result_v2_data" => "TableResultV2Data",
Expand Down Expand Up @@ -4448,6 +4451,8 @@ def overrides
"v2.validation_error" => "ValidationError",
"v2.validation_error_meta" => "ValidationErrorMeta",
"v2.validation_response" => "ValidationResponse",
"v2.version_history_update" => "VersionHistoryUpdate",
"v2.version_history_update_type" => "VersionHistoryUpdateType",
"v2.virus_total_api_key" => "VirusTotalAPIKey",
"v2.virus_total_api_key_type" => "VirusTotalAPIKeyType",
"v2.virus_total_api_key_update" => "VirusTotalAPIKeyUpdate",
Expand Down
Loading
Loading