pub struct Finding {
pub version: u32,
/* private fields */
}Expand description
A single security finding produced by any Santh tool.
This is the universal output format. Whether the finding comes from
Gossan (discovery), Karyx (routing), Calyx (templates), Sear (SAST),
jsdet (JS malware), or a binding (sqlmap-rs), it produces a Finding.
§Examples
use secfinding::{Finding, FindingKind, Severity};
let finding = Finding::builder("scanner", "https://example.com", Severity::High)
.title("SQL injection")
.kind(FindingKind::Vulnerability)
.build()?;
assert_eq!(finding.kind(), FindingKind::Vulnerability);§Thread Safety
Finding is Send and Sync.
Fields§
§version: u32Format version.
Implementations§
Source§impl Finding
impl Finding
Sourcepub fn builder(
scanner: impl Into<String>,
target: impl Into<String>,
severity: Severity,
) -> FindingBuilder
pub fn builder( scanner: impl Into<String>, target: impl Into<String>, severity: Severity, ) -> FindingBuilder
Start building a finding with the three required fields.
Sourcepub fn new(
scanner: impl Into<String>,
target: impl Into<String>,
severity: Severity,
title: impl Into<String>,
detail: impl Into<String>,
) -> Result<Self, FindingBuildError>
pub fn new( scanner: impl Into<String>, target: impl Into<String>, severity: Severity, title: impl Into<String>, detail: impl Into<String>, ) -> Result<Self, FindingBuildError>
Quick constructor for simple findings without the builder.
§Errors
Returns an error if any of the required fields are empty or exceed crate limits.
Source§impl Finding
impl Finding
Sourcepub fn group_by_target<'a>(
findings: &'a [Finding],
) -> HashMap<&'a str, Vec<&'a Finding>>
pub fn group_by_target<'a>( findings: &'a [Finding], ) -> HashMap<&'a str, Vec<&'a Finding>>
Group findings by target for batch triage.
Returns a map from target string to the findings on that target, sorted by severity (descending).
Sourcepub fn merge_chain(
a: &Finding,
b: &Finding,
) -> Result<Finding, FindingBuildError>
pub fn merge_chain( a: &Finding, b: &Finding, ) -> Result<Finding, FindingBuildError>
Merge two related findings into a single chain finding.
The resulting finding takes the higher severity, combines
evidence, tags, CVEs, CWEs, references, and matched values from
both inputs. CVSS score and confidence are taken as the maximum
of the two — preserving the most-severe quantitative signal.
The title is combined with → to indicate the chain
relationship.
§Errors
Returns FindingBuildError if the combined fields fail validation
(e.g., empty title or overly long strings).
Source§impl Finding
impl Finding
Sourcepub fn kind(&self) -> FindingKind
pub fn kind(&self) -> FindingKind
Get the finding classification.
Sourcepub fn status(&self) -> FindingStatus
pub fn status(&self) -> FindingStatus
Get the finding status.
Get the tags associated with the finding.
Sourcepub fn references(&self) -> &[Arc<str>]
pub fn references(&self) -> &[Arc<str>]
Get the reference URLs associated with the finding.
Sourcepub fn confidence(&self) -> Option<f64>
pub fn confidence(&self) -> Option<f64>
Get the statistical confidence score (0.0 to 1.0).
Sourcepub fn cvss_score(&self) -> Option<f64>
pub fn cvss_score(&self) -> Option<f64>
Get the CVSS score (0.0 to 10.0).
Sourcepub fn exploit_hint(&self) -> Option<&str>
pub fn exploit_hint(&self) -> Option<&str>
Get the exploit hint.
Sourcepub fn remediation(&self) -> Option<&str>
pub fn remediation(&self) -> Option<&str>
Get the remediation guidance.
Sourcepub fn matched_values(&self) -> &[Arc<str>]
pub fn matched_values(&self) -> &[Arc<str>]
Get the matched values that triggered the 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>,
Source§impl Ord for Finding
impl Ord for Finding
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Finding
impl PartialOrd for Finding
Source§impl Reportable for Finding
Blanket: secfinding’s own Finding implements Reportable.
impl Reportable for Finding
Blanket: secfinding’s own Finding implements Reportable.
Source§fn confidence(&self) -> Option<f64>
fn confidence(&self) -> Option<f64>
Source§fn cvss_score(&self) -> Option<f64>
fn cvss_score(&self) -> Option<f64>
Source§fn status(&self) -> FindingStatus
fn status(&self) -> FindingStatus
Source§fn location(&self) -> Option<&Location>
fn location(&self) -> Option<&Location>
Source§fn exploit_hint(&self) -> Option<&str>
fn exploit_hint(&self) -> Option<&str>
PoC command.Source§fn remediation(&self) -> Option<&str>
fn remediation(&self) -> Option<&str>
Source§fn kind(&self) -> FindingKind
fn kind(&self) -> FindingKind
Source§fn sarif_level(&self) -> &str
fn sarif_level(&self) -> &str
impl Eq for Finding
impl StructuralPartialEq for Finding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.