Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -146803,9 +146803,6 @@ paths:
permissions:
- security_monitoring_findings_write
- appsec_vm_write
x-unstable: |-
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
/api/v2/security/findings/search:
post:
description: |-
Expand Down
3 changes: 0 additions & 3 deletions examples/v2/security-monitoring/MuteSecurityFindings.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Mute or unmute security findings returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.mute_security_findings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::MuteFindingsRequest.new({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Unmute security findings returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.mute_security_findings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::MuteFindingsRequest.new({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Mute security findings returns "Accepted" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.mute_security_findings".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

body = DatadogAPIClient::V2::MuteFindingsRequest.new({
Expand Down
30 changes: 10 additions & 20 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2300,56 +2300,49 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/k9-investigation
Scenario: Mute or unmute security findings returns "Accepted" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1778721573794, "is_muted": true, "reason": "PENDING_FIX"}}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 202 Accepted

@generated @skip @team:DataDog/k9-investigation
Scenario: Mute or unmute security findings returns "Bad Request" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1778721573794, "is_muted": true, "reason": "PENDING_FIX"}}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/k9-investigation
Scenario: Mute or unmute security findings returns "Not Found" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1778721573794, "is_muted": true, "reason": "PENDING_FIX"}}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:DataDog/k9-investigation
Scenario: Mute or unmute security findings returns "Unprocessable Entity" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1778721573794, "is_muted": true, "reason": "PENDING_FIX"}}, "id": "00000000-0000-0000-0000-000000000001", "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 422 Unprocessable Entity

@team:DataDog/k9-investigation
Scenario: Mute security findings returns "Accepted" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1778721573794, "is_muted": true, "reason": "RISK_ACCEPTED"}}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwMC0wYmd-MDE4NjcyMDJkMzE4MDE5ODY5MGE4ZmQ2MmFlMjg0Y2M=", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 202 Accepted

@team:DataDog/k9-investigation
Scenario: Mute security findings returns "Not Found" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1778721573794, "is_muted": true, "reason": "RISK_ACCEPTED"}}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-investigation
Scenario: Mute security findings returns "Unprocessable Entity" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "To be resolved later.", "expire_at": 1, "is_muted": true, "reason": "RISK_ACCEPTED"}}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 422 Unprocessable Entity
Expand Down Expand Up @@ -2573,24 +2566,21 @@ Feature: Security Monitoring

@team:DataDog/k9-investigation
Scenario: Unmute security findings returns "Accepted" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "Resolved.", "is_muted": false, "reason": "NO_PENDING_FIX"}}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwMC0wYmd-MDE4NjcyMDJkMzE4MDE5ODY5MGE4ZmQ2MmFlMjg0Y2M=", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 202 Accepted

@team:DataDog/k9-investigation
Scenario: Unmute security findings returns "Not Found" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "Resolved.", "is_muted": false, "reason": "NO_PENDING_FIX"}}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 404 Not Found

@team:DataDog/k9-investigation
Scenario: Unmute security findings returns "Unprocessable Entity" response
Given operation "MuteSecurityFindings" enabled
And new "MuteSecurityFindings" request
Given new "MuteSecurityFindings" request
And body with value {"data": {"attributes": {"mute": {"description": "Resolved.", "is_muted": false, "reason": "RISK_ACCEPTED"}}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}}, "type": "mute"}}
When the request is sent
Then the response status is 422 Unprocessable Entity
Expand Down
1 change: 0 additions & 1 deletion lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ def initialize
"v2.list_vulnerabilities": false,
"v2.list_vulnerable_assets": false,
"v2.mute_findings": false,
"v2.mute_security_findings": false,
"v2.run_historical_job": false,
"v2.search_security_monitoring_histsignals": false,
"v2.update_security_monitoring_dataset": false,
Expand Down
6 changes: 0 additions & 6 deletions lib/datadog_api_client/v2/api/security_monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8009,12 +8009,6 @@ def mute_security_findings(body, opts = {})
# @param opts [Hash] the optional parameters
# @return [Array<(MuteFindingsResponse, Integer, Hash)>] MuteFindingsResponse data, response status code and response headers
def mute_security_findings_with_http_info(body, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.mute_security_findings".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.mute_security_findings")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.mute_security_findings"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.mute_security_findings ...'
Expand Down
Loading