Skip to main content

Finding

Struct Finding 

Source
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: u32

Format version.

Implementations§

Source§

impl Finding

Source

pub fn builder( scanner: impl Into<String>, target: impl Into<String>, severity: Severity, ) -> FindingBuilder

Start building a finding with the three required fields.

Source

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

Source

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).

Source

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

Source

pub fn version(&self) -> u32

Get the finding version.

Source

pub fn id(&self) -> Uuid

Get the finding unique identifier.

Source

pub fn scanner(&self) -> &str

Get the scanner name.

Source

pub fn target(&self) -> &str

Get the target scanned.

Source

pub fn severity(&self) -> Severity

Get the finding severity.

Source

pub fn title(&self) -> &str

Get the finding title.

Source

pub fn detail(&self) -> &str

Get the finding detailed description.

Source

pub fn kind(&self) -> FindingKind

Get the finding classification.

Source

pub fn status(&self) -> FindingStatus

Get the finding status.

Source

pub fn evidence(&self) -> &[Evidence]

Get the evidence associated with the finding.

Source

pub fn location(&self) -> Option<&Location>

Get the location of the finding.

Source

pub fn tags(&self) -> &[Arc<str>]

Get the tags associated with the finding.

Source

pub fn timestamp(&self) -> DateTime<Utc>

Get the timestamp when the finding was produced.

Source

pub fn cve_ids(&self) -> &[Arc<str>]

Get the CVE identifiers associated with the finding.

Source

pub fn cwe_ids(&self) -> &[Arc<str>]

Get the CWE identifiers associated with the finding.

Source

pub fn references(&self) -> &[Arc<str>]

Get the reference URLs associated with the finding.

Source

pub fn confidence(&self) -> Option<f64>

Get the statistical confidence score (0.0 to 1.0).

Source

pub fn cvss_score(&self) -> Option<f64>

Get the CVSS score (0.0 to 10.0).

Source

pub fn scan_id(&self) -> Option<&str>

Get the scan ID that produced this finding.

Source

pub fn exploit_hint(&self) -> Option<&str>

Get the exploit hint.

Source

pub fn remediation(&self) -> Option<&str>

Get the remediation guidance.

Source

pub fn matched_values(&self) -> &[Arc<str>]

Get the matched values that triggered the finding.

Trait Implementations§

Source§

impl Clone for Finding

Source§

fn clone(&self) -> Finding

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Finding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Finding

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Finding

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for Finding

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Finding

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Finding

Source§

fn eq(&self, other: &Finding) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Finding

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Reportable for Finding

Blanket: secfinding’s own Finding implements Reportable.

Source§

fn scanner(&self) -> &str

Which tool produced this finding.
Source§

fn target(&self) -> &str

What was scanned (URL, file path, package name, etc.).
Source§

fn severity(&self) -> Severity

How severe is this finding.
Source§

fn title(&self) -> &str

Short human-readable title.
Source§

fn detail(&self) -> &str

Detailed description.
Source§

fn cwe_ids(&self) -> &[Arc<str>]

CWE identifiers (e.g. ["CWE-89"]).
Source§

fn cve_ids(&self) -> &[Arc<str>]

CVE identifiers.
Source§

fn tags(&self) -> &[Arc<str>]

Free-form tags.
Source§

fn confidence(&self) -> Option<f64>

Confidence score 0.0-1.0 (None = not applicable).
Source§

fn cvss_score(&self) -> Option<f64>

CVSS score (0.0 to 10.0) if applicable.
Source§

fn status(&self) -> FindingStatus

Current lifecycle state of the finding.
Source§

fn location(&self) -> Option<&Location>

Specific location in a file where the finding was discovered.
Source§

fn scan_id(&self) -> Option<&str>

ID of the scan run that produced this finding.
Source§

fn exploit_hint(&self) -> Option<&str>

Exploit hint / PoC command.
Source§

fn remediation(&self) -> Option<&str>

Actionable remediation guidance.
Source§

fn evidence(&self) -> &[Evidence]

Evidence attached to the finding.
Source§

fn kind(&self) -> FindingKind

The domain classification of this finding.
Source§

fn rule_id(&self) -> String

SARIF rule ID (defaults to “scanner/title-slug”).
Source§

fn sarif_level(&self) -> &str

SARIF severity level string.
Source§

impl Serialize for Finding

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Finding

Source§

impl StructuralPartialEq for Finding

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,