Skip to content

Commit 29971ba

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Vulnerability Management - Update ListVulnerabilities endpoint query params and response schema (#1082)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 045f3e1 commit 29971ba

13 files changed

+158
-35
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29976,6 +29976,13 @@ components:
2997629976
Library:
2997729977
description: Vulnerability library.
2997829978
properties:
29979+
additional_names:
29980+
description: Related library or package names (such as child packages or
29981+
affected binary paths).
29982+
items:
29983+
example: linux-tools-common
29984+
type: string
29985+
type: array
2997929986
name:
2998029987
description: Vulnerability library name.
2998129988
example: linux-aws-5.15
@@ -57353,6 +57360,12 @@ components:
5735357360
type: array
5735457361
risks:
5735557362
$ref: '#/components/schemas/VulnerabilityRisks'
57363+
running_kernel:
57364+
description: "True if the vulnerability affects a package in the host\u2019s
57365+
running kernel, false if it affects a non-running kernel, and omit if
57366+
it is not kernel-related."
57367+
example: true
57368+
type: boolean
5735657369
status:
5735757370
$ref: '#/components/schemas/VulnerabilityStatus'
5735857371
title:
@@ -57413,10 +57426,15 @@ components:
5741357426
- RubyGems
5741457427
- Go
5741557428
- Packagist
57416-
- Ddeb
57429+
- Deb
5741757430
- Rpm
5741857431
- Apk
5741957432
- Windows
57433+
- Generic
57434+
- MacOs
57435+
- Oci
57436+
- BottleRocket
57437+
- None
5742057438
type: string
5742157439
x-enum-varnames:
5742257440
- PYPI
@@ -57426,10 +57444,15 @@ components:
5742657444
- RUBY_GEMS
5742757445
- GO
5742857446
- PACKAGIST
57429-
- D_DEB
57447+
- DEB
5743057448
- RPM
5743157449
- APK
5743257450
- WINDOWS
57451+
- GENERIC
57452+
- MAC_OS
57453+
- OCI
57454+
- BOTTLE_ROCKET
57455+
- NONE
5743357456
VulnerabilityRelationships:
5743457457
description: Related entities object.
5743557458
properties:
@@ -57530,12 +57553,14 @@ components:
5753057553
- IAST
5753157554
- SCA
5753257555
- Infra
57556+
- SAST
5753357557
example: SCA
5753457558
type: string
5753557559
x-enum-varnames:
5753657560
- IAST
5753757561
- SCA
5753857562
- INFRA
57563+
- SAST
5753957564
VulnerabilityType:
5754057565
description: The vulnerability type.
5754157566
enum:
@@ -80296,6 +80321,10 @@ paths:
8029680321
summary: List assets SBOMs
8029780322
tags:
8029880323
- Security Monitoring
80324+
x-permission:
80325+
operator: OR
80326+
permissions:
80327+
- appsec_vm_read
8029980328
x-unstable: '**Note**: This endpoint is a private preview.
8030080329

8030180330
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
@@ -80367,6 +80396,10 @@ paths:
8036780396
summary: Get SBOM
8036880397
tags:
8036980398
- Security Monitoring
80399+
x-permission:
80400+
operator: OR
80401+
permissions:
80402+
- appsec_vm_read
8037080403
x-unstable: '**Note**: This endpoint is a private preview.
8037180404

8037280405
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
@@ -80481,6 +80514,10 @@ paths:
8048180514
summary: List scanned assets metadata
8048280515
tags:
8048380516
- Security Monitoring
80517+
x-permission:
80518+
operator: OR
80519+
permissions:
80520+
- appsec_vm_read
8048480521
x-unstable: '**Note**: This endpoint is a private preview.
8048580522

8048680523
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
@@ -80909,6 +80946,14 @@ paths:
8090980946
required: false
8091080947
schema:
8091180948
type: string
80949+
- description: Filter for whether the vulnerability affects a running kernel
80950+
(for vulnerabilities related to a `Host` asset).
80951+
example: true
80952+
in: query
80953+
name: filter[running_kernel]
80954+
required: false
80955+
schema:
80956+
type: boolean
8091280957
- description: Filter by asset name. This field supports the usage of wildcards
8091380958
(*).
8091480959
example: datadog-agent
@@ -81052,6 +81097,10 @@ paths:
8105281097
summary: List vulnerabilities
8105381098
tags:
8105481099
- Security Monitoring
81100+
x-permission:
81101+
operator: OR
81102+
permissions:
81103+
- appsec_vm_read
8105581104
x-unstable: '**Note**: This endpoint is a private preview.
8105681105

8105781106
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
@@ -81410,6 +81459,10 @@ paths:
8141081459
summary: List vulnerable assets
8141181460
tags:
8141281461
- Security Monitoring
81462+
x-permission:
81463+
operator: OR
81464+
permissions:
81465+
- appsec_vm_read
8141381466
x-unstable: '**Note**: This endpoint is a private preview.
8141481467

8141581468
If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).'
@@ -84547,8 +84600,8 @@ paths:
8454784600
x-unstable: '**Note**: This endpoint may be subject to changes.'
8454884601
/api/v2/static-analysis/secrets/rules:
8454984602
get:
84550-
description: Returns list of Secrets rules with ID, Pattern, Description, Priority,
84551-
and SDS ID
84603+
description: Returns a list of Secrets rules with ID, Pattern, Description,
84604+
Priority, and SDS ID.
8455284605
operationId: GetSecretsRules
8455384606
responses:
8455484607
'200':
@@ -84564,7 +84617,7 @@ paths:
8456484617
appKeyAuth: []
8456584618
- AuthZ:
8456684619
- code_analysis_read
84567-
summary: Returns list of Secrets rules
84620+
summary: Returns a list of Secrets rules
8456884621
tags:
8456984622
- Security Monitoring
8457084623
x-unstable: '**Note**: This endpoint may be subject to changes.'

examples/v2_security-monitoring_GetSecretsRules.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Returns list of Secrets rules returns "OK" response
1+
// Returns a list of Secrets rules returns "OK" response
22
use datadog_api_client::datadog;
33
use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
44

src/datadogV2/api/api_security_monitoring.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ pub struct ListVulnerabilitiesOptionalParams {
628628
pub filter_repo_digests: Option<String>,
629629
/// Filter by origin.
630630
pub filter_origin: Option<String>,
631+
/// Filter for whether the vulnerability affects a running kernel (for vulnerabilities related to a `Host` asset).
632+
pub filter_running_kernel: Option<bool>,
631633
/// Filter by asset name. This field supports the usage of wildcards (*).
632634
pub filter_asset_name: Option<String>,
633635
/// Filter by asset type.
@@ -808,6 +810,11 @@ impl ListVulnerabilitiesOptionalParams {
808810
self.filter_origin = Some(value);
809811
self
810812
}
813+
/// Filter for whether the vulnerability affects a running kernel (for vulnerabilities related to a `Host` asset).
814+
pub fn filter_running_kernel(mut self, value: bool) -> Self {
815+
self.filter_running_kernel = Some(value);
816+
self
817+
}
811818
/// Filter by asset name. This field supports the usage of wildcards (*).
812819
pub fn filter_asset_name(mut self, value: String) -> Self {
813820
self.filter_asset_name = Some(value);
@@ -5729,7 +5736,7 @@ impl SecurityMonitoringAPI {
57295736
}
57305737
}
57315738

5732-
/// Returns list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID
5739+
/// Returns a list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID.
57335740
pub async fn get_secrets_rules(
57345741
&self,
57355742
) -> Result<crate::datadogV2::model::SecretRuleArray, datadog::Error<GetSecretsRulesError>>
@@ -5748,7 +5755,7 @@ impl SecurityMonitoringAPI {
57485755
}
57495756
}
57505757

5751-
/// Returns list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID
5758+
/// Returns a list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID.
57525759
pub async fn get_secrets_rules_with_http_info(
57535760
&self,
57545761
) -> Result<
@@ -9383,6 +9390,7 @@ impl SecurityMonitoringAPI {
93839390
let filter_fix_available = params.filter_fix_available;
93849391
let filter_repo_digests = params.filter_repo_digests;
93859392
let filter_origin = params.filter_origin;
9393+
let filter_running_kernel = params.filter_running_kernel;
93869394
let filter_asset_name = params.filter_asset_name;
93879395
let filter_asset_type = params.filter_asset_type;
93889396
let filter_asset_version_first = params.filter_asset_version_first;
@@ -9543,6 +9551,10 @@ impl SecurityMonitoringAPI {
95439551
local_req_builder =
95449552
local_req_builder.query(&[("filter[origin]", &local_query_param.to_string())]);
95459553
};
9554+
if let Some(ref local_query_param) = filter_running_kernel {
9555+
local_req_builder = local_req_builder
9556+
.query(&[("filter[running_kernel]", &local_query_param.to_string())]);
9557+
};
95469558
if let Some(ref local_query_param) = filter_asset_name {
95479559
local_req_builder =
95489560
local_req_builder.query(&[("filter[asset.name]", &local_query_param.to_string())]);

src/datadogV2/model/model_library.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use std::fmt::{self, Formatter};
1111
#[skip_serializing_none]
1212
#[derive(Clone, Debug, PartialEq, Serialize)]
1313
pub struct Library {
14+
/// Related library or package names (such as child packages or affected binary paths).
15+
#[serde(rename = "additional_names")]
16+
pub additional_names: Option<Vec<String>>,
1417
/// Vulnerability library name.
1518
#[serde(rename = "name")]
1619
pub name: String,
@@ -27,13 +30,19 @@ pub struct Library {
2730
impl Library {
2831
pub fn new(name: String) -> Library {
2932
Library {
33+
additional_names: None,
3034
name,
3135
version: None,
3236
additional_properties: std::collections::BTreeMap::new(),
3337
_unparsed: false,
3438
}
3539
}
3640

41+
pub fn additional_names(mut self, value: Vec<String>) -> Self {
42+
self.additional_names = Some(value);
43+
self
44+
}
45+
3746
pub fn version(mut self, value: String) -> Self {
3847
self.version = Some(value);
3948
self
@@ -65,6 +74,7 @@ impl<'de> Deserialize<'de> for Library {
6574
where
6675
M: MapAccess<'a>,
6776
{
77+
let mut additional_names: Option<Vec<String>> = None;
6878
let mut name: Option<String> = None;
6979
let mut version: Option<String> = None;
7080
let mut additional_properties: std::collections::BTreeMap<
@@ -75,6 +85,13 @@ impl<'de> Deserialize<'de> for Library {
7585

7686
while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
7787
match k.as_str() {
88+
"additional_names" => {
89+
if v.is_null() {
90+
continue;
91+
}
92+
additional_names =
93+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
94+
}
7895
"name" => {
7996
name = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
8097
}
@@ -94,6 +111,7 @@ impl<'de> Deserialize<'de> for Library {
94111
let name = name.ok_or_else(|| M::Error::missing_field("name"))?;
95112

96113
let content = Library {
114+
additional_names,
97115
name,
98116
version,
99117
additional_properties,

src/datadogV2/model/model_vulnerability_attributes.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ pub struct VulnerabilityAttributes {
6565
/// Vulnerability risks.
6666
#[serde(rename = "risks")]
6767
pub risks: crate::datadogV2::model::VulnerabilityRisks,
68+
/// True if the vulnerability affects a package in the host’s running kernel, false if it affects a non-running kernel, and omit if it is not kernel-related.
69+
#[serde(rename = "running_kernel")]
70+
pub running_kernel: Option<bool>,
6871
/// The vulnerability status.
6972
#[serde(rename = "status")]
7073
pub status: crate::datadogV2::model::VulnerabilityStatus,
@@ -121,6 +124,7 @@ impl VulnerabilityAttributes {
121124
remediations,
122125
repo_digests: None,
123126
risks,
127+
running_kernel: None,
124128
status,
125129
title,
126130
tool,
@@ -168,6 +172,11 @@ impl VulnerabilityAttributes {
168172
self
169173
}
170174

175+
pub fn running_kernel(mut self, value: bool) -> Self {
176+
self.running_kernel = Some(value);
177+
self
178+
}
179+
171180
pub fn additional_properties(
172181
mut self,
173182
value: std::collections::BTreeMap<String, serde_json::Value>,
@@ -214,6 +223,7 @@ impl<'de> Deserialize<'de> for VulnerabilityAttributes {
214223
let mut remediations: Option<Vec<crate::datadogV2::model::Remediation>> = None;
215224
let mut repo_digests: Option<Vec<String>> = None;
216225
let mut risks: Option<crate::datadogV2::model::VulnerabilityRisks> = None;
226+
let mut running_kernel: Option<bool> = None;
217227
let mut status: Option<crate::datadogV2::model::VulnerabilityStatus> = None;
218228
let mut title: Option<String> = None;
219229
let mut tool: Option<crate::datadogV2::model::VulnerabilityTool> = None;
@@ -319,6 +329,13 @@ impl<'de> Deserialize<'de> for VulnerabilityAttributes {
319329
"risks" => {
320330
risks = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
321331
}
332+
"running_kernel" => {
333+
if v.is_null() {
334+
continue;
335+
}
336+
running_kernel =
337+
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
338+
}
322339
"status" => {
323340
status = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
324341
if let Some(ref _status) = status {
@@ -407,6 +424,7 @@ impl<'de> Deserialize<'de> for VulnerabilityAttributes {
407424
remediations,
408425
repo_digests,
409426
risks,
427+
running_kernel,
410428
status,
411429
title,
412430
tool,

0 commit comments

Comments
 (0)