pub struct V2Vector {Show 14 fields
pub access_vector: AccessVector,
pub access_complexity: AccessComplexity,
pub authentication: Authentication,
pub confidentiality_impact: ConfidentialityImpact,
pub integrity_impact: IntegrityImpact,
pub availability_impact: AvailabilityImpact,
pub exploitability: Exploitability,
pub remediation_level: RemediationLevel,
pub report_confidence: ReportConfidence,
pub collateral_damage_potential: CollateralDamagePotential,
pub target_distribution: TargetDistribution,
pub confidentiality_requirement: ConfidentialityRequirement,
pub integrity_requirement: IntegrityRequirement,
pub availability_requirement: AvailabilityRequirement,
}
Expand description
CVSS vector version v2
use cvssrust::v2::V2Vector;
use cvssrust::CVSSScore;
use std::str::FromStr;
let cvss_str = "AV:A/AC:L/Au:S/C:P/I:P/A:C/E:POC/RL:W/RC:UR/CDP:LM/TD:H/CR:M/IR:M/AR:M";
let cvss = V2Vector::from_str(cvss_str).unwrap();
assert_eq!(cvss.to_string(), String::from(cvss_str));
assert_eq!(cvss.base_score().value(), 6.7);
assert_eq!(cvss.base_score().severity().to_string(), "Medium");
assert_eq!(cvss.temporal_score().value(), 5.5);
Fields§
§access_vector: AccessVector
§access_complexity: AccessComplexity
§authentication: Authentication
§confidentiality_impact: ConfidentialityImpact
§integrity_impact: IntegrityImpact
§availability_impact: AvailabilityImpact
§exploitability: Exploitability
§remediation_level: RemediationLevel
§report_confidence: ReportConfidence
§collateral_damage_potential: CollateralDamagePotential
§target_distribution: TargetDistribution
§confidentiality_requirement: ConfidentialityRequirement
§integrity_requirement: IntegrityRequirement
§availability_requirement: AvailabilityRequirement
Implementations§
Source§impl V2Vector
impl V2Vector
Sourcepub fn new(
access_vector: AccessVector,
access_complexity: AccessComplexity,
authentication: Authentication,
confidentiality_impact: ConfidentialityImpact,
integrity_impact: IntegrityImpact,
availability_impact: AvailabilityImpact,
) -> Self
pub fn new( access_vector: AccessVector, access_complexity: AccessComplexity, authentication: Authentication, confidentiality_impact: ConfidentialityImpact, integrity_impact: IntegrityImpact, availability_impact: AvailabilityImpact, ) -> Self
Constructor
Sourcepub fn extend_with_temporal(
&mut self,
temporal_str: &str,
) -> Result<(), ParseError>
pub fn extend_with_temporal( &mut self, temporal_str: &str, ) -> Result<(), ParseError>
Parse the temporal fields in temporal_str
, adding them to the V2Vector
.
use cvssrust::v2::V2Vector;
use cvssrust::v2::temporal::{Exploitability, RemediationLevel, ReportConfidence};
use std::str::FromStr;
let cvss_base = "AV:A/AC:L/Au:S/C:P/I:P/A:C";
let cvss_temporal = "E:POC/RL:W/RC:UR";
let mut cvss = V2Vector::from_str(cvss_base).unwrap();
assert_eq!(cvss.exploitability, Exploitability::NotDefined);
assert_eq!(cvss.remediation_level, RemediationLevel::NotDefined);
assert_eq!(cvss.report_confidence, ReportConfidence::NotDefined);
cvss.extend_with_temporal(cvss_temporal).unwrap();
assert_eq!(cvss.exploitability, Exploitability::ProofOfConcept);
assert_eq!(cvss.remediation_level, RemediationLevel::Workaround);
assert_eq!(cvss.report_confidence, ReportConfidence::Uncorroborated);
Trait Implementations§
Source§impl CVSSScore for V2Vector
impl CVSSScore for V2Vector
Source§fn temporal_score(&self) -> Score
fn temporal_score(&self) -> Score
TemporalScore = round_to_1_decimal(BaseScore*Exploitability RemediationLevelReportConfidence)
Source§fn environmental_score(&self) -> Score
fn environmental_score(&self) -> Score
round_to_1_decimal((AdjustedTemporal+ (10-AdjustedTemporal)*CollateralDamagePotential)*TargetDistribution)
Source§fn impact_score(&self) -> Score
fn impact_score(&self) -> Score
Calculate Impact Sub Score
Source§fn expoitability_score(&self) -> Score
fn expoitability_score(&self) -> Score
Calculate Exploitability Score
Source§fn base_score(&self) -> Score
fn base_score(&self) -> Score
Calculate CVSS Base Score
Source§impl<'de> Deserialize<'de> for V2Vector
impl<'de> Deserialize<'de> for V2Vector
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for V2Vector
impl Eq for V2Vector
impl StructuralPartialEq for V2Vector
Auto Trait Implementations§
impl Freeze for V2Vector
impl RefUnwindSafe for V2Vector
impl Send for V2Vector
impl Sync for V2Vector
impl Unpin for V2Vector
impl UnwindSafe for V2Vector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more