Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vulnerabilities endpoints GA - Remove x-unstable #2033

Merged
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-03 18:38:30.053082",
"spec_repo_commit": "325cdedf"
"regenerated": "2025-02-03 19:47:19.600144",
"spec_repo_commit": "b52549d9"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-02-03 18:38:30.068302",
"spec_repo_commit": "325cdedf"
"regenerated": "2025-02-03 19:47:19.615575",
"spec_repo_commit": "b52549d9"
}
}
}
9 changes: 0 additions & 9 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43976,9 +43976,6 @@ paths:
summary: List vulnerable assets
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/cloud_workload/policy/download:
get:
description: 'The download endpoint generates a Cloud Workload Security policy
Expand Down Expand Up @@ -44071,9 +44068,6 @@ 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 Expand Up @@ -44632,9 +44626,6 @@ paths:
summary: List vulnerabilities
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/vulnerabilities/notification_rules:
get:
description: Returns the list of notification rules for security vulnerabilities.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2025-01-15T14:19:46.527Z"
"2025-01-31T12:04:00.490Z"
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2025-01-15T14:19:46.537Z",
"time": 1088
"startedDateTime": "2025-01-31T12:04:00.501Z",
"time": 1317
}
],
"pages": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2025-01-17T13:12:50.575Z"
"2025-01-31T12:04:14.913Z"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-12-19T16:15:23.508Z"
"2025-01-31T12:04:28.397Z"
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
"url": "https://api.datadoghq.com/api/v2/security/vulnerabilities?page%5Btoken%5D=unknown&page%5Bnumber%5D=1"
},
"response": {
"bodySize": 49,
"bodySize": 131,
"content": {
"mimeType": "application/vnd.api+json",
"size": 49,
"text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}"
"size": 131,
"text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"rpc error: code = Internal desc = no cached result set found for queryID: unknown\"}]}"
},
"cookies": [],
"headers": [
Expand All @@ -49,14 +49,14 @@
"value": "application/vnd.api+json"
}
],
"headersSize": 660,
"headersSize": 661,
"httpVersion": "HTTP/1.1",
"redirectURL": "",
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2024-12-19T16:15:23.893Z",
"time": 188
"startedDateTime": "2025-01-31T12:04:28.406Z",
"time": 489
}
],
"pages": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-12-19T16:15:24.088Z"
"2025-01-31T12:04:39.730Z"
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"value": "application/json"
}
],
"headersSize": 613,
"headersSize": 612,
"httpVersion": "HTTP/1.1",
"method": "GET",
"queryString": [
Expand Down Expand Up @@ -56,8 +56,8 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-12-19T16:15:24.092Z",
"time": 433
"startedDateTime": "2025-01-31T12:04:39.739Z",
"time": 1094
}
],
"pages": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-12-19T16:15:24.530Z"
"2025-01-31T12:04:52.159Z"
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
"url": "https://api.datadoghq.com/api/v2/security/assets?page%5Btoken%5D=unknown&page%5Bnumber%5D=1"
},
"response": {
"bodySize": 49,
"bodySize": 131,
"content": {
"mimeType": "application/vnd.api+json",
"size": 49,
"text": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\"}]}"
"size": 131,
"text": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"rpc error: code = Internal desc = no cached result set found for queryID: unknown\"}]}"
},
"cookies": [],
"headers": [
Expand All @@ -55,8 +55,8 @@
"status": 404,
"statusText": "Not Found"
},
"startedDateTime": "2024-12-19T16:15:24.533Z",
"time": 161
"startedDateTime": "2025-01-31T12:04:52.166Z",
"time": 470
}
],
"pages": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"2024-12-19T16:15:24.699Z"
"2025-01-31T12:05:04.773Z"
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
"status": 200,
"statusText": "OK"
},
"startedDateTime": "2024-12-19T16:15:24.702Z",
"time": 253
"startedDateTime": "2025-01-31T12:05:04.782Z",
"time": 613
}
],
"pages": [],
Expand Down
1 change: 0 additions & 1 deletion examples/v2/security-monitoring/GetSBOM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.getSBOM"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiGetSBOMRequest = {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/security-monitoring/ListVulnerabilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listVulnerabilities"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiListVulnerabilitiesRequest = {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/security-monitoring/ListVulnerableAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.listVulnerableAssets"] = true;
const apiInstance = new v2.SecurityMonitoringApi(configuration);

const params: v2.SecurityMonitoringApiListVulnerableAssetsRequest = {
Expand Down
27 changes: 9 additions & 18 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -447,26 +447,23 @@ 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 operation "GetSBOM" enabled
And new "GetSBOM" request
Given 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 operation "GetSBOM" enabled
And new "GetSBOM" request
Given 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 operation "GetSBOM" enabled
And new "GetSBOM" request
Given 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 Expand Up @@ -783,24 +780,21 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/asm-vm
Scenario: List vulnerabilities returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
Given operation "ListVulnerabilities" enabled
And new "ListVulnerabilities" request
Given new "ListVulnerabilities" request
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: List vulnerabilities returns "Not found: There is no request associated with the provided token." response
Given operation "ListVulnerabilities" enabled
And new "ListVulnerabilities" request
Given new "ListVulnerabilities" request
And request contains "page[token]" parameter with value "unknown"
And request contains "page[number]" parameter with value 1
When the request is sent
Then the response status is 404 Not found: There is no request associated with the provided token.

@team:DataDog/asm-vm
Scenario: List vulnerabilities returns "OK" response
Given operation "ListVulnerabilities" enabled
And new "ListVulnerabilities" request
Given new "ListVulnerabilities" request
And request contains "filter[cvss.base.severity]" parameter with value "High"
And request contains "filter[asset.type]" parameter with value "Service"
And request contains "filter[tool]" parameter with value "Infra"
Expand All @@ -809,24 +803,21 @@ Feature: Security Monitoring

@generated @skip @team:DataDog/asm-vm
Scenario: List vulnerable assets returns "Bad request: The server cannot process the request due to invalid syntax in the request." response
Given operation "ListVulnerableAssets" enabled
And new "ListVulnerableAssets" request
Given new "ListVulnerableAssets" request
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: List vulnerable assets returns "Not found: There is no request associated with the provided token." response
Given operation "ListVulnerableAssets" enabled
And new "ListVulnerableAssets" request
Given new "ListVulnerableAssets" request
And request contains "page[token]" parameter with value "unknown"
And request contains "page[number]" parameter with value 1
When the request is sent
Then the response status is 404 Not found: There is no request associated with the provided token.

@team:DataDog/asm-vm
Scenario: List vulnerable assets returns "OK" response
Given operation "ListVulnerableAssets" enabled
And new "ListVulnerableAssets" request
Given new "ListVulnerableAssets" request
And request contains "filter[type]" parameter with value "Host"
And request contains "filter[repository_url]" parameter with value "github.com/datadog/dd-go"
And request contains "filter[risks.in_production]" parameter with value true
Expand Down
3 changes: 0 additions & 3 deletions packages/datadog-api-client-common/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,8 @@ export function createConfiguration(
"v2.deleteHistoricalJob": false,
"v2.getFinding": false,
"v2.getHistoricalJob": false,
"v2.getSBOM": false,
"v2.listFindings": false,
"v2.listHistoricalJobs": false,
"v2.listVulnerabilities": false,
"v2.listVulnerableAssets": false,
"v2.muteFindings": false,
"v2.runHistoricalJob": false,
"v2.createScorecardOutcomesBatch": false,
Expand Down
15 changes: 0 additions & 15 deletions packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -962,11 +962,6 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
): Promise<RequestContext> {
const _config = _options || this.configuration;

logger.warn("Using unstable operation 'getSBOM'");
if (!_config.unstableOperations["v2.getSBOM"]) {
throw new Error("Unstable operation 'getSBOM' is disabled");
}

// verify required parameter 'assetType' is not null or undefined
if (assetType === null || assetType === undefined) {
throw new RequiredError("assetType", "getSBOM");
Expand Down Expand Up @@ -1696,11 +1691,6 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
): Promise<RequestContext> {
const _config = _options || this.configuration;

logger.warn("Using unstable operation 'listVulnerabilities'");
if (!_config.unstableOperations["v2.listVulnerabilities"]) {
throw new Error("Unstable operation 'listVulnerabilities' is disabled");
}

// Path Params
const localVarPath = "/api/v2/security/vulnerabilities";

Expand Down Expand Up @@ -2071,11 +2061,6 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory {
): Promise<RequestContext> {
const _config = _options || this.configuration;

logger.warn("Using unstable operation 'listVulnerableAssets'");
if (!_config.unstableOperations["v2.listVulnerableAssets"]) {
throw new Error("Unstable operation 'listVulnerableAssets' is disabled");
}

// Path Params
const localVarPath = "/api/v2/security/assets";

Expand Down