pub struct VulnerabilityDiscovery {
pub cwes: Vec<Cwe>,
pub complexity: Score,
pub locality: Score,
}Expand description
How hard it is to find the bug, given that the code is already understood.
Fields§
§cwes: Vec<Cwe>The distinct weakness classes that must be found — ideally one per vulnerability. Only the length feeds the arithmetic.
complexity: ScoreSophistication of the vulnerability, or of the whole chain when several are needed.
locality: ScoreHow far apart the code paths that reveal it are; the highest of the chain.
Implementations§
Source§impl VulnerabilityDiscovery
impl VulnerabilityDiscovery
Sourcepub fn new(
cwes: impl Into<Vec<Cwe>>,
complexity: Score,
locality: Score,
) -> Self
pub fn new( cwes: impl Into<Vec<Cwe>>, complexity: Score, locality: Score, ) -> Self
Builds from an enumerated weakness list.
Sourcepub fn with_cwe_count(count: usize, complexity: Score, locality: Score) -> Self
pub fn with_cwe_count(count: usize, complexity: Score, locality: Score) -> Self
Builds when only the number of weaknesses is known, filling with Cwe::UNSPECIFIED.
Sourcepub fn vulnerability_complexity(&self) -> Score
pub fn vulnerability_complexity(&self) -> Score
min(10, complexity + cwe_count).
Trait Implementations§
Source§impl Clone for VulnerabilityDiscovery
impl Clone for VulnerabilityDiscovery
Source§impl Debug for VulnerabilityDiscovery
impl Debug for VulnerabilityDiscovery
impl Eq for VulnerabilityDiscovery
Source§impl PartialEq for VulnerabilityDiscovery
impl PartialEq for VulnerabilityDiscovery
impl StructuralPartialEq for VulnerabilityDiscovery
Auto Trait Implementations§
impl Freeze for VulnerabilityDiscovery
impl RefUnwindSafe for VulnerabilityDiscovery
impl Send for VulnerabilityDiscovery
impl Sync for VulnerabilityDiscovery
impl Unpin for VulnerabilityDiscovery
impl UnsafeUnpin for VulnerabilityDiscovery
impl UnwindSafe for VulnerabilityDiscovery
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