pub struct Finding {
pub id: String,
pub title: String,
pub severity: Severity,
pub affected_crate: String,
pub affected_version: Option<String>,
pub url: Option<String>,
pub description: Option<String>,
pub source: FindingSource,
}Expand description
A single security finding.
§Example
use dev_security::{Finding, FindingSource};
use dev_report::Severity;
let f = Finding {
id: "RUSTSEC-2024-0001".into(),
title: "Use after free in foo".into(),
severity: Severity::Critical,
affected_crate: "foo".into(),
affected_version: Some("1.2.3".into()),
url: Some("https://rustsec.org/advisories/RUSTSEC-2024-0001".into()),
description: None,
source: FindingSource::Audit,
};
assert_eq!(f.severity, Severity::Critical);Fields§
§id: StringAdvisory ID (e.g. RUSTSEC-2024-0001) or cargo-deny rule code.
title: StringShort human-readable title.
severity: SeveritySeverity classification mapped from the underlying tool.
affected_crate: StringAffected crate name.
affected_version: Option<String>Affected crate version, when the underlying tool exposed it.
url: Option<String>URL with more detail (advisory page, license SPDX page, etc.).
description: Option<String>Long-form description, when the underlying tool exposed it.
source: FindingSourceWhich tool emitted this finding.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Finding
impl<'de> Deserialize<'de> for Finding
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
Auto Trait Implementations§
impl Freeze for Finding
impl RefUnwindSafe for Finding
impl Send for Finding
impl Sync for Finding
impl Unpin for Finding
impl UnsafeUnpin for Finding
impl UnwindSafe for Finding
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