Vulnerability

Struct Vulnerability 

Source
pub struct Vulnerability { /* private fields */ }
Expand description

The vulnerability fields describe information about a vulnerability that is relevant to an event.

Implementations§

Source§

impl Vulnerability

Source

pub fn get_classification(&self) -> Option<&String>

The classification of the vulnerability scoring system. For example (https://www.first.org/cvss/)

Source

pub fn set_classification(&mut self, classification_arg: String)

The classification of the vulnerability scoring system. For example (https://www.first.org/cvss/)

§Example

CVSS

Source

pub fn get_enumeration(&self) -> Option<&String>

The type of identifier used for this vulnerability. For example (https://cve.mitre.org/about/)

Source

pub fn set_enumeration(&mut self, enumeration_arg: String)

The type of identifier used for this vulnerability. For example (https://cve.mitre.org/about/)

§Example

CVE

Source

pub fn get_reference(&self) -> Option<&String>

A resource that provides additional information, context, and mitigations for the identified vulnerability.

Source

pub fn set_reference(&mut self, reference_arg: String)

A resource that provides additional information, context, and mitigations for the identified vulnerability.

§Example

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6111

Source

pub fn get_score_base(&self) -> Option<&f64>

Scores can range from 0.0 to 10.0, with 10.0 being the most severe.

Base scores cover an assessment for exploitability metrics (attack vector, complexity, privileges, and user interaction), impact metrics (confidentiality, integrity, and availability), and scope. For example (https://www.first.org/cvss/specification-document)

Source

pub fn set_score_base(&mut self, score_base_arg: f64)

Scores can range from 0.0 to 10.0, with 10.0 being the most severe.

Base scores cover an assessment for exploitability metrics (attack vector, complexity, privileges, and user interaction), impact metrics (confidentiality, integrity, and availability), and scope. For example (https://www.first.org/cvss/specification-document)

§Example

5.5

Source

pub fn get_score_temporal(&self) -> Option<&f64>

Scores can range from 0.0 to 10.0, with 10.0 being the most severe.

Temporal scores cover an assessment for code maturity, remediation level, and confidence. For example (https://www.first.org/cvss/specification-document)

Source

pub fn set_score_temporal(&mut self, score_temporal_arg: f64)

Scores can range from 0.0 to 10.0, with 10.0 being the most severe.

Temporal scores cover an assessment for code maturity, remediation level, and confidence. For example (https://www.first.org/cvss/specification-document)

Source

pub fn get_score_environmental(&self) -> Option<&f64>

Scores can range from 0.0 to 10.0, with 10.0 being the most severe.

Environmental scores cover an assessment for any modified Base metrics, confidentiality, integrity, and availability requirements. For example (https://www.first.org/cvss/specification-document)

Source

pub fn set_score_environmental(&mut self, score_environmental_arg: f64)

Scores can range from 0.0 to 10.0, with 10.0 being the most severe.

Environmental scores cover an assessment for any modified Base metrics, confidentiality, integrity, and availability requirements. For example (https://www.first.org/cvss/specification-document)

§Example

5.5

Source

pub fn get_score_version(&self) -> Option<&String>

The National Vulnerability Database (NVD) provides qualitative severity rankings of “Low”, “Medium”, and “High” for CVSS v2.0 base score ranges in addition to the severity ratings for CVSS v3.0 as they are defined in the CVSS v3.0 specification.

CVSS is owned and managed by FIRST.Org, Inc. (FIRST), a US-based non-profit organization, whose mission is to help computer security incident response teams across the world. For example (https://nvd.nist.gov/vuln-metrics/cvss)

Source

pub fn set_score_version(&mut self, score_version_arg: String)

The National Vulnerability Database (NVD) provides qualitative severity rankings of “Low”, “Medium”, and “High” for CVSS v2.0 base score ranges in addition to the severity ratings for CVSS v3.0 as they are defined in the CVSS v3.0 specification.

CVSS is owned and managed by FIRST.Org, Inc. (FIRST), a US-based non-profit organization, whose mission is to help computer security incident response teams across the world. For example (https://nvd.nist.gov/vuln-metrics/cvss)

§Example

2.0

Source

pub fn get_category(&self) -> &Vec<String>

The type of system or architecture that the vulnerability affects. These may be platform-specific (for example, Debian or SUSE) or general (for example, Database or Firewall). For example (Qualys vulnerability categories)

This field must be an array.

Source

pub fn add_category(&mut self, category_arg: String)

The type of system or architecture that the vulnerability affects. These may be platform-specific (for example, Debian or SUSE) or general (for example, Database or Firewall). For example (Qualys vulnerability categories)

This field must be an array.

§Example

["Firewall"]

Source

pub fn get_description(&self) -> Option<&String>

The description of the vulnerability that provides additional context of the vulnerability. For example (Common Vulnerabilities and Exposure CVE description)

Source

pub fn set_description(&mut self, description_arg: String)

The description of the vulnerability that provides additional context of the vulnerability. For example (Common Vulnerabilities and Exposure CVE description)

§Example

In macOS before 2.12.6, there is a vulnerability in the RPC...

Source

pub fn get_id(&self) -> Option<&String>

The identification (ID) is the number portion of a vulnerability entry. It includes a unique identification number for the vulnerability. For example (Common Vulnerabilities and Exposure CVE ID)

Source

pub fn set_id(&mut self, id_arg: String)

The identification (ID) is the number portion of a vulnerability entry. It includes a unique identification number for the vulnerability. For example (Common Vulnerabilities and Exposure CVE ID)

§Example

CVE-2019-00001

Source

pub fn get_scanner_vendor(&self) -> Option<&String>

The name of the vulnerability scanner vendor.

Source

pub fn set_scanner_vendor(&mut self, scanner_vendor_arg: String)

The name of the vulnerability scanner vendor.

§Example

Tenable

Source

pub fn get_severity(&self) -> Option<&String>

The severity of the vulnerability can help with metrics and internal prioritization regarding remediation. For example (https://nvd.nist.gov/vuln-metrics/cvss)

Source

pub fn set_severity(&mut self, severity_arg: String)

The severity of the vulnerability can help with metrics and internal prioritization regarding remediation. For example (https://nvd.nist.gov/vuln-metrics/cvss)

§Example

Critical

Source

pub fn get_report_id(&self) -> Option<&String>

The report or scan identification number.

Source

pub fn set_report_id(&mut self, report_id_arg: String)

The report or scan identification number.

§Example

20191018.0001

Trait Implementations§

Source§

impl Clone for Vulnerability

Source§

fn clone(&self) -> Vulnerability

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Vulnerability

Source§

fn default() -> Vulnerability

Returns the “default value” for a type. Read more
Source§

impl Serialize for Vulnerability

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.