From d5835c511de584d09eb711427d85c602c4a49143 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 9 Dec 2025 16:18:33 +0000 Subject: [PATCH] Regenerate client from commit 8997847 of spec repo --- .generator/schemas/v2/openapi.yaml | 6 ++++++ features/v2/security_monitoring.feature | 18 +++++++++--------- lib/datadog_api_client/configuration.rb | 2 ++ .../v2/api/security_monitoring_api.rb | 12 ++++++++++++ 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index dad178ca22d3..7760d58c049a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -79838,6 +79838,9 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write + x-unstable: '**Note**: This endpoint is in beta and is subject to change. + + Please check the documentation regularly for updates.' post: description: Create Jira issues for security findings. This operation creates a case in Datadog and a Jira issue linked to that case for bidirectional sync @@ -79878,6 +79881,9 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write + x-unstable: '**Note**: This endpoint is in beta and is subject to change. + + Please check the documentation regularly for updates.' /api/v2/security/sboms: get: description: 'Get a list of assets SBOMs for an organization. diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 5599d509afc2..7dc352a7a4e9 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -9,7 +9,7 @@ Feature: Security Monitoring And a valid "appKeyAuth" key in the system And an instance of "SecurityMonitoring" API - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -30,21 +30,21 @@ Feature: Security Monitoring And the response "data.attributes.status_group" is equal to "SG_OPEN" And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Bad Request" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 400 Bad Request - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Not Found" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 404 Not Found - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -258,7 +258,7 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Create Jira issue for security finding returns "Created" response Given new "CreateJiraIssues" request And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6a773295-8729-4034-aada-53b64cbe02e7"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}}, "id": "6a773295-8729-4034-aada-53b64cbe02e7"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]} @@ -274,7 +274,7 @@ Feature: Security Monitoring And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Create Jira issue for security findings returns "Created" response Given new "CreateJiraIssues" request And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}}, "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]} @@ -292,14 +292,14 @@ Feature: Security Monitoring And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Bad Request" response Given new "CreateJiraIssues" request And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}}}}], "included": [{"type": "cases", "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": []}}, "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}]} When the request is sent Then the response status is 400 Bad Request - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Created" response Given new "CreateJiraIssues" request And body with value {"data": [{"type": "jira_issues", "attributes":{}, "relationships": {"case": {"data": {"type": "cases", "id":"53e242c6-a7d6-46ad-9680-b8d14753f716"}}}}, {"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}}}}], "included":[{"type":"cases", "attributes":{"title":"A title", "description":"A description"}, "relationships":{"project":{"data":{"type":"projects", "id":"959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}]}}, "id": "53e242c6-a7d6-46ad-9680-b8d14753f716"}, {"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data":[{"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}}, "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}, {"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]} @@ -323,7 +323,7 @@ Feature: Security Monitoring And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" - @team:DataDog/k9-investigation + @skip @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Not Found" response Given new "CreateJiraIssues" request And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}}, "findings": {"data": [{"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}}, "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}, {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}, {"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]} diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index a85e9260f8b6..d69758b75761 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,8 +208,10 @@ def initialize "v2.get_open_api": false, "v2.list_apis": false, "v2.update_open_api": false, + "v2.attach_jira_issue": false, "v2.cancel_threat_hunting_job": false, "v2.convert_job_result_to_signal": false, + "v2.create_jira_issues": false, "v2.delete_threat_hunting_job": false, "v2.get_finding": false, "v2.get_rule_version_history": false, diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 233f52de4f78..b0c6a3267a37 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -111,6 +111,12 @@ def attach_jira_issue(body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers def attach_jira_issue_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.attach_jira_issue".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.attach_jira_issue") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.attach_jira_issue")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_jira_issue ...' @@ -600,6 +606,12 @@ def create_jira_issues(body, opts = {}) # @param opts [Hash] the optional parameters # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers def create_jira_issues_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_jira_issues".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_jira_issues") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_jira_issues")) + end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_jira_issues ...'