Skip to content

Commit c4a1e55

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update Vulnerabilities endpoints documentation (#2263)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent f13b1d8 commit c4a1e55

File tree

7 files changed

+56
-15
lines changed

7 files changed

+56
-15
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-02-27 14:00:46.919597",
8-
"spec_repo_commit": "240ec82d"
7+
"regenerated": "2025-02-27 21:31:42.586534",
8+
"spec_repo_commit": "0b2e3d20"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-27 14:00:46.936060",
13-
"spec_repo_commit": "240ec82d"
12+
"regenerated": "2025-02-27 21:31:42.601882",
13+
"spec_repo_commit": "0b2e3d20"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32353,6 +32353,9 @@ components:
3235332353
apm_service_catalog_read: View service catalog and service definitions.
3235432354
apm_service_catalog_write: Add, modify, and delete service catalog definitions
3235532355
when those definitions are maintained by Datadog.
32356+
appsec_vm_read: View infrastructure, application code, and library vulnerabilities.
32357+
This does not restrict API or inventory SQL access to the vulnerability
32358+
data source.
3235632359
cases_read: View Cases.
3235732360
cases_write: Create and update cases.
3235832361
ci_visibility_pipelines_write: Create CI Visibility pipeline spans using
@@ -45204,9 +45207,14 @@ paths:
4520445207
security:
4520545208
- apiKeyAuth: []
4520645209
appKeyAuth: []
45210+
- AuthZ:
45211+
- appsec_vm_read
4520745212
summary: List vulnerable assets
4520845213
tags:
4520945214
- Security Monitoring
45215+
x-unstable: '**Note**: This endpoint is a private preview.
45216+
45217+
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4521045218
/api/v2/security/cloud_workload/policy/download:
4521145219
get:
4521245220
description: 'The download endpoint generates a Cloud Workload Security policy
@@ -45296,12 +45304,14 @@ paths:
4529645304
security:
4529745305
- apiKeyAuth: []
4529845306
appKeyAuth: []
45307+
- AuthZ:
45308+
- appsec_vm_read
4529945309
summary: Get SBOM
4530045310
tags:
4530145311
- Security Monitoring
4530245312
x-unstable: '**Note**: This endpoint is a private preview.
4530345313

45304-
If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
45314+
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4530545315
/api/v2/security/signals/notification_rules:
4530645316
get:
4530745317
description: Returns the list of notification rules for security signals.
@@ -45857,9 +45867,14 @@ paths:
4585745867
security:
4585845868
- apiKeyAuth: []
4585945869
appKeyAuth: []
45870+
- AuthZ:
45871+
- appsec_vm_read
4586045872
summary: List vulnerabilities
4586145873
tags:
4586245874
- Security Monitoring
45875+
x-unstable: '**Note**: This endpoint is a private preview.
45876+
45877+
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
4586345878
/api/v2/security/vulnerabilities/notification_rules:
4586445879
get:
4586545880
description: Returns the list of notification rules for security vulnerabilities.

examples/v2/security-monitoring/ListVulnerabilities.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# List vulnerabilities returns "OK" response
22

33
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_vulnerabilities".to_sym] = true
6+
end
47
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
58
opts = {
69
filter_cvss_base_severity: VulnerabilitySeverity::HIGH,

examples/v2/security-monitoring/ListVulnerableAssets.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# List vulnerable assets returns "OK" response
22

33
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.list_vulnerable_assets".to_sym] = true
6+
end
47
api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new
58
opts = {
69
filter_type: AssetType::HOST,

features/v2/security_monitoring.feature

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ Feature: Security Monitoring
473473
When the request is sent
474474
Then the response status is 404 Not found: asset not found
475475

476-
@team:DataDog/asm-vm
476+
@skip @team:DataDog/asm-vm
477477
Scenario: Get SBOM returns "OK" response
478478
Given operation "GetSBOM" enabled
479479
And new "GetSBOM" request
@@ -830,21 +830,24 @@ Feature: Security Monitoring
830830

831831
@generated @skip @team:DataDog/asm-vm
832832
Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
833-
Given new "ListVulnerabilities" request
833+
Given operation "ListVulnerabilities" enabled
834+
And new "ListVulnerabilities" request
834835
When the request is sent
835836
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.
836837

837838
@team:DataDog/asm-vm
838839
Scenario: List vulnerabilities returns "Not found: There is no request associated with the provided token." response
839-
Given new "ListVulnerabilities" request
840+
Given operation "ListVulnerabilities" enabled
841+
And new "ListVulnerabilities" request
840842
And request contains "page[token]" parameter with value "unknown"
841843
And request contains "page[number]" parameter with value 1
842844
When the request is sent
843845
Then the response status is 404 Not found: There is no request associated with the provided token.
844846

845847
@team:DataDog/asm-vm
846848
Scenario: List vulnerabilities returns "OK" response
847-
Given new "ListVulnerabilities" request
849+
Given operation "ListVulnerabilities" enabled
850+
And new "ListVulnerabilities" request
848851
And request contains "filter[cvss.base.severity]" parameter with value "High"
849852
And request contains "filter[asset.type]" parameter with value "Service"
850853
And request contains "filter[tool]" parameter with value "Infra"
@@ -853,21 +856,24 @@ Feature: Security Monitoring
853856

854857
@generated @skip @team:DataDog/asm-vm
855858
Scenario: List vulnerable assets returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
856-
Given new "ListVulnerableAssets" request
859+
Given operation "ListVulnerableAssets" enabled
860+
And new "ListVulnerableAssets" request
857861
When the request is sent
858862
Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request.
859863

860864
@team:DataDog/asm-vm
861865
Scenario: List vulnerable assets returns "Not found: There is no request associated with the provided token." response
862-
Given new "ListVulnerableAssets" request
866+
Given operation "ListVulnerableAssets" enabled
867+
And new "ListVulnerableAssets" request
863868
And request contains "page[token]" parameter with value "unknown"
864869
And request contains "page[number]" parameter with value 1
865870
When the request is sent
866871
Then the response status is 404 Not found: There is no request associated with the provided token.
867872

868873
@team:DataDog/asm-vm
869874
Scenario: List vulnerable assets returns "OK" response
870-
Given new "ListVulnerableAssets" request
875+
Given operation "ListVulnerableAssets" enabled
876+
And new "ListVulnerableAssets" request
871877
And request contains "filter[type]" parameter with value "Host"
872878
And request contains "filter[repository_url]" parameter with value "github.com/datadog/dd-go"
873879
And request contains "filter[risks.in_production]" parameter with value true

lib/datadog_api_client/configuration.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ def initialize
247247
"v2.get_sbom": false,
248248
"v2.list_findings": false,
249249
"v2.list_historical_jobs": false,
250+
"v2.list_vulnerabilities": false,
251+
"v2.list_vulnerable_assets": false,
250252
"v2.mute_findings": false,
251253
"v2.run_historical_job": false,
252254
"v2.create_scorecard_outcomes_batch": false,

lib/datadog_api_client/v2/api/security_monitoring_api.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {})
15381538
return_type = opts[:debug_return_type] || 'GetSBOMResponse'
15391539

15401540
# auth_names
1541-
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
1541+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
15421542

15431543
new_options = opts.merge(
15441544
:operation => :get_sbom,
@@ -2729,6 +2729,12 @@ def list_vulnerabilities(opts = {})
27292729
# @option opts [String] :filter_asset_operating_system_version Filter by asset operating system version.
27302730
# @return [Array<(ListVulnerabilitiesResponse, Integer, Hash)>] ListVulnerabilitiesResponse data, response status code and response headers
27312731
def list_vulnerabilities_with_http_info(opts = {})
2732+
unstable_enabled = @api_client.config.unstable_operations["v2.list_vulnerabilities".to_sym]
2733+
if unstable_enabled
2734+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_vulnerabilities")
2735+
else
2736+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_vulnerabilities"))
2737+
end
27322738

27332739
if @api_client.config.debugging
27342740
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_vulnerabilities ...'
@@ -2847,7 +2853,7 @@ def list_vulnerabilities_with_http_info(opts = {})
28472853
return_type = opts[:debug_return_type] || 'ListVulnerabilitiesResponse'
28482854

28492855
# auth_names
2850-
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
2856+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
28512857

28522858
new_options = opts.merge(
28532859
:operation => :list_vulnerabilities,
@@ -2911,6 +2917,12 @@ def list_vulnerable_assets(opts = {})
29112917
# @option opts [String] :filter_operating_system_version Filter by operating system version.
29122918
# @return [Array<(ListVulnerableAssetsResponse, Integer, Hash)>] ListVulnerableAssetsResponse data, response status code and response headers
29132919
def list_vulnerable_assets_with_http_info(opts = {})
2920+
unstable_enabled = @api_client.config.unstable_operations["v2.list_vulnerable_assets".to_sym]
2921+
if unstable_enabled
2922+
@api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_vulnerable_assets")
2923+
else
2924+
raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_vulnerable_assets"))
2925+
end
29142926

29152927
if @api_client.config.debugging
29162928
@api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_vulnerable_assets ...'
@@ -2959,7 +2971,7 @@ def list_vulnerable_assets_with_http_info(opts = {})
29592971
return_type = opts[:debug_return_type] || 'ListVulnerableAssetsResponse'
29602972

29612973
# auth_names
2962-
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
2974+
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]
29632975

29642976
new_options = opts.merge(
29652977
:operation => :list_vulnerable_assets,

0 commit comments

Comments
 (0)