pub struct Advisory {Show 15 fields
pub id: String,
pub name: String,
pub kind: AdvisoryKind,
pub cve: Option<String>,
pub osvdb: Option<String>,
pub ghsa: Option<String>,
pub url: Option<String>,
pub title: Option<String>,
pub date: Option<String>,
pub description: Option<String>,
pub cvss_v2: Option<f64>,
pub cvss_v3: Option<f64>,
pub framework: Option<String>,
pub patched_versions: Vec<Requirement>,
pub unaffected_versions: Vec<Requirement>,
}Expand description
A security advisory loaded from the ruby-advisory-db.
Fields§
§id: StringThe advisory identifier (filename without .yml).
name: StringThe affected gem or Ruby engine name.
kind: AdvisoryKindWhether this advisory is for a gem or a Ruby interpreter.
cve: Option<String>CVE identifier (e.g., “2020-1234”).
osvdb: Option<String>OSVDB identifier.
ghsa: Option<String>GitHub Security Advisory identifier (e.g., “aaaa-bbbb-cccc”).
url: Option<String>URL with vulnerability details.
title: Option<String>Vulnerability title.
date: Option<String>Discovery/publication date.
description: Option<String>Full vulnerability description.
cvss_v2: Option<f64>CVSS v2 score (0.0-10.0).
cvss_v3: Option<f64>CVSS v3 score (0.0-10.0).
framework: Option<String>Framework (e.g., “rails”).
patched_versions: Vec<Requirement>Version requirements for patched versions.
unaffected_versions: Vec<Requirement>Version requirements for unaffected versions.
Implementations§
Source§impl Advisory
impl Advisory
Sourcepub fn from_yaml(yaml: &str, path: &Path) -> Result<Self, AdvisoryError>
pub fn from_yaml(yaml: &str, path: &Path) -> Result<Self, AdvisoryError>
Parse an advisory from a YAML string with a path for ID extraction.
Sourcepub fn patched(&self, version: &Version) -> bool
pub fn patched(&self, version: &Version) -> bool
Check if the given version is patched against this advisory.
Sourcepub fn unaffected(&self, version: &Version) -> bool
pub fn unaffected(&self, version: &Version) -> bool
Check if the given version is unaffected by this advisory.
Sourcepub fn vulnerable(&self, version: &Version) -> bool
pub fn vulnerable(&self, version: &Version) -> bool
Check if the given version is vulnerable to this advisory.
A version is vulnerable if it is neither patched nor unaffected.
Sourcepub fn ghsa_id(&self) -> Option<String>
pub fn ghsa_id(&self) -> Option<String>
The GHSA identifier string (e.g., “GHSA-aaaa-bbbb-cccc”).
Sourcepub fn identifiers(&self) -> Vec<String>
pub fn identifiers(&self) -> Vec<String>
All identifiers (CVE, OSVDB, GHSA) as a list.
Sourcepub fn criticality(&self) -> Option<Criticality>
pub fn criticality(&self) -> Option<Criticality>
Determine the criticality based on CVSS scores.
CVSS v3 is preferred over v2. Scoring follows NIST/NVD guidelines.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Advisory
impl RefUnwindSafe for Advisory
impl Send for Advisory
impl Sync for Advisory
impl Unpin for Advisory
impl UnsafeUnpin for Advisory
impl UnwindSafe for Advisory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.