Skip to content

Commit a1f3db4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Update Vulnerabilities endpoints documentation (#2732)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 3f18980 commit a1f3db4

File tree

7 files changed

+79
-18
lines changed

7 files changed

+79
-18
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.641282",
8-
"spec_repo_commit": "240ec82d"
7+
"regenerated": "2025-02-27 21:31:36.139846",
8+
"spec_repo_commit": "0b2e3d20"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-02-27 14:00:46.657419",
13-
"spec_repo_commit": "240ec82d"
12+
"regenerated": "2025-02-27 21:31:36.154973",
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.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
public class Example {
1313
public static void main(String[] args) {
1414
ApiClient defaultClient = ApiClient.getDefaultApiClient();
15+
defaultClient.setUnstableOperationEnabled("v2.listVulnerabilities", true);
1516
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
1617

1718
try {

examples/v2/security-monitoring/ListVulnerableAssets.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
public class Example {
1111
public static void main(String[] args) {
1212
ApiClient defaultClient = ApiClient.getDefaultApiClient();
13+
defaultClient.setUnstableOperationEnabled("v2.listVulnerableAssets", true);
1314
SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient);
1415

1516
try {

src/main/java/com/datadog/api/client/ApiClient.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ public class ApiClient {
425425
put("v2.getSBOM", false);
426426
put("v2.listFindings", false);
427427
put("v2.listHistoricalJobs", false);
428+
put("v2.listVulnerabilities", false);
429+
put("v2.listVulnerableAssets", false);
428430
put("v2.muteFindings", false);
429431
put("v2.runHistoricalJob", false);
430432
put("v2.createScorecardOutcomesBatch", false);

src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3501,7 +3501,7 @@ public ApiResponse<GetSBOMResponse> getSBOMWithHttpInfo(
35013501
localVarHeaderParams,
35023502
new HashMap<String, String>(),
35033503
new String[] {"application/json"},
3504-
new String[] {"apiKeyAuth", "appKeyAuth"});
3504+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
35053505
return apiClient.invokeAPI(
35063506
"GET",
35073507
builder,
@@ -3577,7 +3577,7 @@ public CompletableFuture<ApiResponse<GetSBOMResponse>> getSBOMWithHttpInfoAsync(
35773577
localVarHeaderParams,
35783578
new HashMap<String, String>(),
35793579
new String[] {"application/json"},
3580-
new String[] {"apiKeyAuth", "appKeyAuth"});
3580+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
35813581
} catch (ApiException ex) {
35823582
CompletableFuture<ApiResponse<GetSBOMResponse>> result = new CompletableFuture<>();
35833583
result.completeExceptionally(ex);
@@ -6821,6 +6821,13 @@ public CompletableFuture<ListVulnerabilitiesResponse> listVulnerabilitiesAsync(
68216821
*/
68226822
public ApiResponse<ListVulnerabilitiesResponse> listVulnerabilitiesWithHttpInfo(
68236823
ListVulnerabilitiesOptionalParameters parameters) throws ApiException {
6824+
// Check if unstable operation is enabled
6825+
String operationId = "listVulnerabilities";
6826+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
6827+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
6828+
} else {
6829+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
6830+
}
68246831
Object localVarPostBody = null;
68256832
String pageToken = parameters.pageToken;
68266833
Long pageNumber = parameters.pageNumber;
@@ -6969,7 +6976,7 @@ public ApiResponse<ListVulnerabilitiesResponse> listVulnerabilitiesWithHttpInfo(
69696976
localVarHeaderParams,
69706977
new HashMap<String, String>(),
69716978
new String[] {"application/json"},
6972-
new String[] {"apiKeyAuth", "appKeyAuth"});
6979+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
69736980
return apiClient.invokeAPI(
69746981
"GET",
69756982
builder,
@@ -6991,6 +6998,17 @@ public ApiResponse<ListVulnerabilitiesResponse> listVulnerabilitiesWithHttpInfo(
69916998
*/
69926999
public CompletableFuture<ApiResponse<ListVulnerabilitiesResponse>>
69937000
listVulnerabilitiesWithHttpInfoAsync(ListVulnerabilitiesOptionalParameters parameters) {
7001+
// Check if unstable operation is enabled
7002+
String operationId = "listVulnerabilities";
7003+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
7004+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
7005+
} else {
7006+
CompletableFuture<ApiResponse<ListVulnerabilitiesResponse>> result =
7007+
new CompletableFuture<>();
7008+
result.completeExceptionally(
7009+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
7010+
return result;
7011+
}
69947012
Object localVarPostBody = null;
69957013
String pageToken = parameters.pageToken;
69967014
Long pageNumber = parameters.pageNumber;
@@ -7141,7 +7159,7 @@ public ApiResponse<ListVulnerabilitiesResponse> listVulnerabilitiesWithHttpInfo(
71417159
localVarHeaderParams,
71427160
new HashMap<String, String>(),
71437161
new String[] {"application/json"},
7144-
new String[] {"apiKeyAuth", "appKeyAuth"});
7162+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
71457163
} catch (ApiException ex) {
71467164
CompletableFuture<ApiResponse<ListVulnerabilitiesResponse>> result =
71477165
new CompletableFuture<>();
@@ -7461,6 +7479,13 @@ public CompletableFuture<ListVulnerableAssetsResponse> listVulnerableAssetsAsync
74617479
*/
74627480
public ApiResponse<ListVulnerableAssetsResponse> listVulnerableAssetsWithHttpInfo(
74637481
ListVulnerableAssetsOptionalParameters parameters) throws ApiException {
7482+
// Check if unstable operation is enabled
7483+
String operationId = "listVulnerableAssets";
7484+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
7485+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
7486+
} else {
7487+
throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
7488+
}
74647489
Object localVarPostBody = null;
74657490
String pageToken = parameters.pageToken;
74667491
Long pageNumber = parameters.pageNumber;
@@ -7524,7 +7549,7 @@ public ApiResponse<ListVulnerableAssetsResponse> listVulnerableAssetsWithHttpInf
75247549
localVarHeaderParams,
75257550
new HashMap<String, String>(),
75267551
new String[] {"application/json"},
7527-
new String[] {"apiKeyAuth", "appKeyAuth"});
7552+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
75287553
return apiClient.invokeAPI(
75297554
"GET",
75307555
builder,
@@ -7546,6 +7571,17 @@ public ApiResponse<ListVulnerableAssetsResponse> listVulnerableAssetsWithHttpInf
75467571
*/
75477572
public CompletableFuture<ApiResponse<ListVulnerableAssetsResponse>>
75487573
listVulnerableAssetsWithHttpInfoAsync(ListVulnerableAssetsOptionalParameters parameters) {
7574+
// Check if unstable operation is enabled
7575+
String operationId = "listVulnerableAssets";
7576+
if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
7577+
apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
7578+
} else {
7579+
CompletableFuture<ApiResponse<ListVulnerableAssetsResponse>> result =
7580+
new CompletableFuture<>();
7581+
result.completeExceptionally(
7582+
new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
7583+
return result;
7584+
}
75497585
Object localVarPostBody = null;
75507586
String pageToken = parameters.pageToken;
75517587
Long pageNumber = parameters.pageNumber;
@@ -7611,7 +7647,7 @@ public ApiResponse<ListVulnerableAssetsResponse> listVulnerableAssetsWithHttpInf
76117647
localVarHeaderParams,
76127648
new HashMap<String, String>(),
76137649
new String[] {"application/json"},
7614-
new String[] {"apiKeyAuth", "appKeyAuth"});
7650+
new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"});
76157651
} catch (ApiException ex) {
76167652
CompletableFuture<ApiResponse<ListVulnerableAssetsResponse>> result =
76177653
new CompletableFuture<>();

src/test/resources/com/datadog/api/client/v2/api/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

0 commit comments

Comments
 (0)