1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A vulnerability associated with a finding.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Vulnerability {
/// <p>The identifier of the vulnerability.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>List of software packages that have the vulnerability.</p>
pub vulnerable_packages: ::std::option::Option<::std::vec::Vec<crate::types::SoftwarePackage>>,
/// <p>CVSS scores from the advisory related to the vulnerability.</p>
pub cvss: ::std::option::Option<::std::vec::Vec<crate::types::Cvss>>,
/// <p>List of vulnerabilities that are related to this vulnerability.</p>
pub related_vulnerabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Information about the vendor that generates the vulnerability report.</p>
pub vendor: ::std::option::Option<crate::types::VulnerabilityVendor>,
/// <p>A list of URLs that provide additional information about the vulnerability.</p>
pub reference_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>Specifies if all vulnerable packages in a finding have a value for <code>FixedInVersion</code> and <code>Remediation</code>. This field is evaluated for each vulnerability <code>Id</code> based on the number of vulnerable packages that have a value for both <code>FixedInVersion</code> and <code>Remediation</code>. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>YES</code> if all vulnerable packages have a value for both <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>NO</code> if no vulnerable packages have a value for <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>PARTIAL</code> otherwise</p></li>
/// </ul>
pub fix_available: ::std::option::Option<crate::types::VulnerabilityFixAvailable>,
/// <p>The Exploit Prediction Scoring System (EPSS) score for a finding.</p>
pub epss_score: ::std::option::Option<f64>,
/// <p>Whether an exploit is available for a finding.</p>
pub exploit_available: ::std::option::Option<crate::types::VulnerabilityExploitAvailable>,
/// <p>The date and time of the last exploit associated with a finding discovered in your environment.</p>
pub last_known_exploit_at: ::std::option::Option<::std::string::String>,
/// <p>The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub CSPM receives from Amazon Inspector.</p>
pub code_vulnerabilities: ::std::option::Option<::std::vec::Vec<crate::types::VulnerabilityCodeVulnerabilities>>,
}
impl Vulnerability {
/// <p>The identifier of the vulnerability.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>List of software packages that have the vulnerability.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.vulnerable_packages.is_none()`.
pub fn vulnerable_packages(&self) -> &[crate::types::SoftwarePackage] {
self.vulnerable_packages.as_deref().unwrap_or_default()
}
/// <p>CVSS scores from the advisory related to the vulnerability.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cvss.is_none()`.
pub fn cvss(&self) -> &[crate::types::Cvss] {
self.cvss.as_deref().unwrap_or_default()
}
/// <p>List of vulnerabilities that are related to this vulnerability.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.related_vulnerabilities.is_none()`.
pub fn related_vulnerabilities(&self) -> &[::std::string::String] {
self.related_vulnerabilities.as_deref().unwrap_or_default()
}
/// <p>Information about the vendor that generates the vulnerability report.</p>
pub fn vendor(&self) -> ::std::option::Option<&crate::types::VulnerabilityVendor> {
self.vendor.as_ref()
}
/// <p>A list of URLs that provide additional information about the vulnerability.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.reference_urls.is_none()`.
pub fn reference_urls(&self) -> &[::std::string::String] {
self.reference_urls.as_deref().unwrap_or_default()
}
/// <p>Specifies if all vulnerable packages in a finding have a value for <code>FixedInVersion</code> and <code>Remediation</code>. This field is evaluated for each vulnerability <code>Id</code> based on the number of vulnerable packages that have a value for both <code>FixedInVersion</code> and <code>Remediation</code>. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>YES</code> if all vulnerable packages have a value for both <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>NO</code> if no vulnerable packages have a value for <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>PARTIAL</code> otherwise</p></li>
/// </ul>
pub fn fix_available(&self) -> ::std::option::Option<&crate::types::VulnerabilityFixAvailable> {
self.fix_available.as_ref()
}
/// <p>The Exploit Prediction Scoring System (EPSS) score for a finding.</p>
pub fn epss_score(&self) -> ::std::option::Option<f64> {
self.epss_score
}
/// <p>Whether an exploit is available for a finding.</p>
pub fn exploit_available(&self) -> ::std::option::Option<&crate::types::VulnerabilityExploitAvailable> {
self.exploit_available.as_ref()
}
/// <p>The date and time of the last exploit associated with a finding discovered in your environment.</p>
pub fn last_known_exploit_at(&self) -> ::std::option::Option<&str> {
self.last_known_exploit_at.as_deref()
}
/// <p>The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub CSPM receives from Amazon Inspector.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.code_vulnerabilities.is_none()`.
pub fn code_vulnerabilities(&self) -> &[crate::types::VulnerabilityCodeVulnerabilities] {
self.code_vulnerabilities.as_deref().unwrap_or_default()
}
}
impl Vulnerability {
/// Creates a new builder-style object to manufacture [`Vulnerability`](crate::types::Vulnerability).
pub fn builder() -> crate::types::builders::VulnerabilityBuilder {
crate::types::builders::VulnerabilityBuilder::default()
}
}
/// A builder for [`Vulnerability`](crate::types::Vulnerability).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct VulnerabilityBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) vulnerable_packages: ::std::option::Option<::std::vec::Vec<crate::types::SoftwarePackage>>,
pub(crate) cvss: ::std::option::Option<::std::vec::Vec<crate::types::Cvss>>,
pub(crate) related_vulnerabilities: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) vendor: ::std::option::Option<crate::types::VulnerabilityVendor>,
pub(crate) reference_urls: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) fix_available: ::std::option::Option<crate::types::VulnerabilityFixAvailable>,
pub(crate) epss_score: ::std::option::Option<f64>,
pub(crate) exploit_available: ::std::option::Option<crate::types::VulnerabilityExploitAvailable>,
pub(crate) last_known_exploit_at: ::std::option::Option<::std::string::String>,
pub(crate) code_vulnerabilities: ::std::option::Option<::std::vec::Vec<crate::types::VulnerabilityCodeVulnerabilities>>,
}
impl VulnerabilityBuilder {
/// <p>The identifier of the vulnerability.</p>
/// This field is required.
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The identifier of the vulnerability.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The identifier of the vulnerability.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// Appends an item to `vulnerable_packages`.
///
/// To override the contents of this collection use [`set_vulnerable_packages`](Self::set_vulnerable_packages).
///
/// <p>List of software packages that have the vulnerability.</p>
pub fn vulnerable_packages(mut self, input: crate::types::SoftwarePackage) -> Self {
let mut v = self.vulnerable_packages.unwrap_or_default();
v.push(input);
self.vulnerable_packages = ::std::option::Option::Some(v);
self
}
/// <p>List of software packages that have the vulnerability.</p>
pub fn set_vulnerable_packages(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SoftwarePackage>>) -> Self {
self.vulnerable_packages = input;
self
}
/// <p>List of software packages that have the vulnerability.</p>
pub fn get_vulnerable_packages(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SoftwarePackage>> {
&self.vulnerable_packages
}
/// Appends an item to `cvss`.
///
/// To override the contents of this collection use [`set_cvss`](Self::set_cvss).
///
/// <p>CVSS scores from the advisory related to the vulnerability.</p>
pub fn cvss(mut self, input: crate::types::Cvss) -> Self {
let mut v = self.cvss.unwrap_or_default();
v.push(input);
self.cvss = ::std::option::Option::Some(v);
self
}
/// <p>CVSS scores from the advisory related to the vulnerability.</p>
pub fn set_cvss(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Cvss>>) -> Self {
self.cvss = input;
self
}
/// <p>CVSS scores from the advisory related to the vulnerability.</p>
pub fn get_cvss(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Cvss>> {
&self.cvss
}
/// Appends an item to `related_vulnerabilities`.
///
/// To override the contents of this collection use [`set_related_vulnerabilities`](Self::set_related_vulnerabilities).
///
/// <p>List of vulnerabilities that are related to this vulnerability.</p>
pub fn related_vulnerabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.related_vulnerabilities.unwrap_or_default();
v.push(input.into());
self.related_vulnerabilities = ::std::option::Option::Some(v);
self
}
/// <p>List of vulnerabilities that are related to this vulnerability.</p>
pub fn set_related_vulnerabilities(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.related_vulnerabilities = input;
self
}
/// <p>List of vulnerabilities that are related to this vulnerability.</p>
pub fn get_related_vulnerabilities(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.related_vulnerabilities
}
/// <p>Information about the vendor that generates the vulnerability report.</p>
pub fn vendor(mut self, input: crate::types::VulnerabilityVendor) -> Self {
self.vendor = ::std::option::Option::Some(input);
self
}
/// <p>Information about the vendor that generates the vulnerability report.</p>
pub fn set_vendor(mut self, input: ::std::option::Option<crate::types::VulnerabilityVendor>) -> Self {
self.vendor = input;
self
}
/// <p>Information about the vendor that generates the vulnerability report.</p>
pub fn get_vendor(&self) -> &::std::option::Option<crate::types::VulnerabilityVendor> {
&self.vendor
}
/// Appends an item to `reference_urls`.
///
/// To override the contents of this collection use [`set_reference_urls`](Self::set_reference_urls).
///
/// <p>A list of URLs that provide additional information about the vulnerability.</p>
pub fn reference_urls(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.reference_urls.unwrap_or_default();
v.push(input.into());
self.reference_urls = ::std::option::Option::Some(v);
self
}
/// <p>A list of URLs that provide additional information about the vulnerability.</p>
pub fn set_reference_urls(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.reference_urls = input;
self
}
/// <p>A list of URLs that provide additional information about the vulnerability.</p>
pub fn get_reference_urls(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.reference_urls
}
/// <p>Specifies if all vulnerable packages in a finding have a value for <code>FixedInVersion</code> and <code>Remediation</code>. This field is evaluated for each vulnerability <code>Id</code> based on the number of vulnerable packages that have a value for both <code>FixedInVersion</code> and <code>Remediation</code>. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>YES</code> if all vulnerable packages have a value for both <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>NO</code> if no vulnerable packages have a value for <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>PARTIAL</code> otherwise</p></li>
/// </ul>
pub fn fix_available(mut self, input: crate::types::VulnerabilityFixAvailable) -> Self {
self.fix_available = ::std::option::Option::Some(input);
self
}
/// <p>Specifies if all vulnerable packages in a finding have a value for <code>FixedInVersion</code> and <code>Remediation</code>. This field is evaluated for each vulnerability <code>Id</code> based on the number of vulnerable packages that have a value for both <code>FixedInVersion</code> and <code>Remediation</code>. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>YES</code> if all vulnerable packages have a value for both <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>NO</code> if no vulnerable packages have a value for <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>PARTIAL</code> otherwise</p></li>
/// </ul>
pub fn set_fix_available(mut self, input: ::std::option::Option<crate::types::VulnerabilityFixAvailable>) -> Self {
self.fix_available = input;
self
}
/// <p>Specifies if all vulnerable packages in a finding have a value for <code>FixedInVersion</code> and <code>Remediation</code>. This field is evaluated for each vulnerability <code>Id</code> based on the number of vulnerable packages that have a value for both <code>FixedInVersion</code> and <code>Remediation</code>. Valid values are as follows:</p>
/// <ul>
/// <li>
/// <p><code>YES</code> if all vulnerable packages have a value for both <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>NO</code> if no vulnerable packages have a value for <code>FixedInVersion</code> and <code>Remediation</code></p></li>
/// <li>
/// <p><code>PARTIAL</code> otherwise</p></li>
/// </ul>
pub fn get_fix_available(&self) -> &::std::option::Option<crate::types::VulnerabilityFixAvailable> {
&self.fix_available
}
/// <p>The Exploit Prediction Scoring System (EPSS) score for a finding.</p>
pub fn epss_score(mut self, input: f64) -> Self {
self.epss_score = ::std::option::Option::Some(input);
self
}
/// <p>The Exploit Prediction Scoring System (EPSS) score for a finding.</p>
pub fn set_epss_score(mut self, input: ::std::option::Option<f64>) -> Self {
self.epss_score = input;
self
}
/// <p>The Exploit Prediction Scoring System (EPSS) score for a finding.</p>
pub fn get_epss_score(&self) -> &::std::option::Option<f64> {
&self.epss_score
}
/// <p>Whether an exploit is available for a finding.</p>
pub fn exploit_available(mut self, input: crate::types::VulnerabilityExploitAvailable) -> Self {
self.exploit_available = ::std::option::Option::Some(input);
self
}
/// <p>Whether an exploit is available for a finding.</p>
pub fn set_exploit_available(mut self, input: ::std::option::Option<crate::types::VulnerabilityExploitAvailable>) -> Self {
self.exploit_available = input;
self
}
/// <p>Whether an exploit is available for a finding.</p>
pub fn get_exploit_available(&self) -> &::std::option::Option<crate::types::VulnerabilityExploitAvailable> {
&self.exploit_available
}
/// <p>The date and time of the last exploit associated with a finding discovered in your environment.</p>
pub fn last_known_exploit_at(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.last_known_exploit_at = ::std::option::Option::Some(input.into());
self
}
/// <p>The date and time of the last exploit associated with a finding discovered in your environment.</p>
pub fn set_last_known_exploit_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.last_known_exploit_at = input;
self
}
/// <p>The date and time of the last exploit associated with a finding discovered in your environment.</p>
pub fn get_last_known_exploit_at(&self) -> &::std::option::Option<::std::string::String> {
&self.last_known_exploit_at
}
/// Appends an item to `code_vulnerabilities`.
///
/// To override the contents of this collection use [`set_code_vulnerabilities`](Self::set_code_vulnerabilities).
///
/// <p>The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub CSPM receives from Amazon Inspector.</p>
pub fn code_vulnerabilities(mut self, input: crate::types::VulnerabilityCodeVulnerabilities) -> Self {
let mut v = self.code_vulnerabilities.unwrap_or_default();
v.push(input);
self.code_vulnerabilities = ::std::option::Option::Some(v);
self
}
/// <p>The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub CSPM receives from Amazon Inspector.</p>
pub fn set_code_vulnerabilities(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VulnerabilityCodeVulnerabilities>>) -> Self {
self.code_vulnerabilities = input;
self
}
/// <p>The vulnerabilities found in your Lambda function code. This field pertains to findings that Security Hub CSPM receives from Amazon Inspector.</p>
pub fn get_code_vulnerabilities(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VulnerabilityCodeVulnerabilities>> {
&self.code_vulnerabilities
}
/// Consumes the builder and constructs a [`Vulnerability`](crate::types::Vulnerability).
pub fn build(self) -> crate::types::Vulnerability {
crate::types::Vulnerability {
id: self.id,
vulnerable_packages: self.vulnerable_packages,
cvss: self.cvss,
related_vulnerabilities: self.related_vulnerabilities,
vendor: self.vendor,
reference_urls: self.reference_urls,
fix_available: self.fix_available,
epss_score: self.epss_score,
exploit_available: self.exploit_available,
last_known_exploit_at: self.last_known_exploit_at,
code_vulnerabilities: self.code_vulnerabilities,
}
}
}