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
4 changes: 0 additions & 4 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -235632,8 +235632,6 @@ paths:
operator: OR
permissions:
- security_monitoring_rules_write
x-unstable: |-
**Note**: This endpoint is in beta and may be subject to changes.
/api/v2/security_monitoring/rules/{rule_id}/test:
post:
description: |-
Expand Down Expand Up @@ -235760,8 +235758,6 @@ paths:
operator: OR
permissions:
- security_monitoring_rules_read
x-unstable: |-
**Note**: This endpoint is in beta and may be subject to changes.
/api/v2/security_monitoring/sample_log_generation/subscriptions:
get:
description: |-
Expand Down
1 change: 0 additions & 1 deletion examples/v2/security-monitoring/GetRuleVersionHistory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.get_rule_version_history".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
p api_instance.get_rule_version_history("rule_id")
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.get_rule_version_history".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.restore_security_monitoring_rule".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new

Expand Down
24 changes: 8 additions & 16 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2192,24 +2192,21 @@ Feature: Security Monitoring

@generated @skip @team:ddoghq/cloud-siem
Scenario: Get a rule's version history returns "Bad Request" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And request contains "rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:ddoghq/cloud-siem
Scenario: Get a rule's version history returns "Not Found" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And request contains "rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found

@generated @skip @team:ddoghq/cloud-siem
Scenario: Get a rule's version history returns "OK" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And request contains "rule_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 200 OK
Expand Down Expand Up @@ -2718,8 +2715,7 @@ Feature: Security Monitoring

@skip-go @skip-java @skip-ruby @team:ddoghq/cloud-siem
Scenario: Get rule version history returns "OK" response
Given operation "GetRuleVersionHistory" enabled
And new "GetRuleVersionHistory" request
Given new "GetRuleVersionHistory" request
And there is a valid "security_rule" in the system
And request contains "rule_id" parameter from "security_rule.id"
When the request is sent
Expand Down Expand Up @@ -3585,17 +3581,15 @@ Feature: Security Monitoring

@generated @skip @team:ddoghq/cloud-siem
Scenario: Restore a rule to a historical version returns "Bad Request" response
Given operation "RestoreSecurityMonitoringRule" enabled
And new "RestoreSecurityMonitoringRule" request
Given new "RestoreSecurityMonitoringRule" request
And request contains "rule_id" parameter from "REPLACE.ME"
And request contains "version" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request

@team:ddoghq/cloud-siem
Scenario: Restore a rule to a historical version returns "Conflict" response
Given operation "RestoreSecurityMonitoringRule" enabled
And there is a valid "security_rule" in the system
Given there is a valid "security_rule" in the system
And there is a valid "security_rule_updated" in the system
And new "RestoreSecurityMonitoringRule" request
And request contains "rule_id" parameter from "security_rule.id"
Expand All @@ -3605,8 +3599,7 @@ Feature: Security Monitoring

@team:ddoghq/cloud-siem
Scenario: Restore a rule to a historical version returns "Not Found" response
Given operation "RestoreSecurityMonitoringRule" enabled
And there is a valid "security_rule" in the system
Given there is a valid "security_rule" in the system
And new "RestoreSecurityMonitoringRule" request
And request contains "rule_id" parameter from "security_rule.id"
And request contains "version" parameter with value 9999
Expand All @@ -3615,8 +3608,7 @@ Feature: Security Monitoring

@skip-validation @team:ddoghq/cloud-siem
Scenario: Restore a rule to a historical version returns "OK" response
Given operation "RestoreSecurityMonitoringRule" enabled
And there is a valid "security_rule" in the system
Given there is a valid "security_rule" in the system
And there is a valid "security_rule_updated" in the system
And new "RestoreSecurityMonitoringRule" request
And request contains "rule_id" parameter from "security_rule.id"
Expand Down
2 changes: 0 additions & 2 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ def initialize
"v2.get_historical_job": false,
"v2.get_indicator_of_compromise": false,
"v2.get_matching_signals": false,
"v2.get_rule_version_history": false,
"v2.get_secrets_rules": false,
"v2.get_security_findings_automation_default_inbox_rule": false,
"v2.get_security_findings_automation_due_date_rule": false,
Expand Down Expand Up @@ -393,7 +392,6 @@ def initialize
"v2.reorder_security_findings_automation_mute_rules": false,
"v2.reorder_security_findings_automation_severity_modifier_rules": false,
"v2.reorder_security_findings_automation_ticket_creation_rules": false,
"v2.restore_security_monitoring_rule": false,
"v2.run_historical_job": false,
"v2.search_security_monitoring_histsignals": false,
"v2.start_security_monitoring_batch_migration": false,
Expand Down
12 changes: 0 additions & 12 deletions lib/datadog_api_client/v2/api/security_monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6161,12 +6161,6 @@ def get_rule_version_history(rule_id, opts = {})
# @option opts [Integer] :page_number Specific page number to return.
# @return [Array<(GetRuleVersionHistoryResponse, Integer, Hash)>] GetRuleVersionHistoryResponse data, response status code and response headers
def get_rule_version_history_with_http_info(rule_id, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_rule_version_history".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_rule_version_history")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_rule_version_history"))
end

if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_rule_version_history ...'
Expand Down Expand Up @@ -11934,12 +11928,6 @@ def restore_security_monitoring_rule(rule_id, version, opts = {})
# @param opts [Hash] the optional parameters
# @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers
def restore_security_monitoring_rule_with_http_info(rule_id, version, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.restore_security_monitoring_rule".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.restore_security_monitoring_rule")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.restore_security_monitoring_rule"))
end

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