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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-12 18:33:48.053303",
"spec_repo_commit": "6a4cfb82"
"regenerated": "2025-02-14 15:03:43.770632",
"spec_repo_commit": "a739b49f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-12 18:33:48.069553",
"spec_repo_commit": "6a4cfb82"
"regenerated": "2025-02-14 15:03:43.786179",
"spec_repo_commit": "a739b49f"
}
}
}
3 changes: 3 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45225,6 +45225,9 @@ paths:
summary: Get SBOM
tags:
- Security Monitoring
x-unstable: '**Note**: This endpoint is a private preview.

If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
/api/v2/security/signals/notification_rules:
get:
description: Returns the list of notification rules for security signals.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2025-01-31T12:04:00.490Z
2025-02-10T11:40:12.098Z

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
@@ -1 +1 @@
2025-01-31T12:04:14.913Z
2025-02-10T11:38:04.662Z

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/v2/security-monitoring/GetSBOM.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Get SBOM returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.unstable_operations["v2.get_sbom".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
p api_instance.get_sbom(AssetType::REPOSITORY, "github.com/datadog/datadog-agent")
9 changes: 6 additions & 3 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -457,23 +457,26 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/asm-vm
Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
Given new "GetSBOM" request
Given operation "GetSBOM" enabled
And new "GetSBOM" request
And request contains "asset_type" parameter from "REPLACE.ME"
And request contains "filter[asset_name]" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.

@team:DataDog/asm-vm
Scenario: Get SBOM returns "Not found: asset not found" response
Given new "GetSBOM" request
Given operation "GetSBOM" enabled
And new "GetSBOM" request
And request contains "asset_type" parameter with value "Host"
And request contains "filter[asset_name]" parameter with value "unknown-host"
When the request is sent
Then the response status is 404 Not found: asset not found

@team:DataDog/asm-vm
Scenario: Get SBOM returns "OK" response
Given new "GetSBOM" request
Given operation "GetSBOM" enabled
And new "GetSBOM" request
And request contains "asset_type" parameter with value "Repository"
And request contains "filter[asset_name]" parameter with value "github.com/datadog/datadog-agent"
When the request is sent
Expand Down
1 change: 1 addition & 0 deletions lib/datadog_api_client/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ def initialize
"v2.get_finding": false,
"v2.get_historical_job": false,
"v2.get_rule_version_history": false,
"v2.get_sbom": false,
"v2.list_findings": false,
"v2.list_historical_jobs": false,
"v2.mute_findings": false,
Expand Down
6 changes: 6 additions & 0 deletions lib/datadog_api_client/v2/api/security_monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1492,6 +1492,12 @@ def get_sbom(asset_type, filter_asset_name, opts = {})
# @option opts [String] :filter_repo_digest The container image `repo_digest` for the SBOM request. When the requested asset type is 'Image', this filter is mandatory.
# @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers
def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym]
if unstable_enabled
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sbom")
else
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sbom"))
end

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