Crate cvssrust

Source
Expand description

Rust implementation of the Common Vulnerability Scoring System (v2 / v3.0 / v3.1).

Supports parsing, generation and score calculation (base, temporal, environmental) for CVSS vectors v2/v3.0/v3.1

Current CVSS version is v3.1, but v3.0 and v2 are still in use.

§Example

use cvssrust::v3::V3Vector;
use cvssrust::CVSSScore;
use std::str::FromStr;

let cvss_str = "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P/RL:W/RC:C";
let cvss = V3Vector::from_str(cvss_str).unwrap();

assert_eq!(cvss.to_string(), String::from(cvss_str));
assert_eq!(cvss.base_score().value(), 6.1);
assert_eq!(cvss.base_score().severity().to_string(), "Medium");
assert_eq!(cvss.temporal_score().value(), 5.6);

Modules§

v2
CVSS v2 implementation
v3
CVSS v3.0/v3.1 implementation

Structs§

Score
Base/Temporal/Environmental CVSS Score

Enums§

CVSS
Enum type and parser for CVSS of all supported versions.
ParseError
Parsing error type
Severity
Qualitative Severity Rating Scale

Traits§

CVSSScore
CVSS Score implementation: Base/Temporal/Environmental
Display
Format trait for an empty format, {}.
FromStr
Parse a value from a string