pub struct SecurityFinding {Show 13 fields
pub id: String,
pub category: SecurityCategory,
pub severity: Severity,
pub confidence: Confidence,
pub location: Location,
pub title: String,
pub description: String,
pub cwe_id: Option<u32>,
pub remediation: String,
pub code_snippet: String,
pub metadata: HashMap<String, String>,
pub suppressed: bool,
pub dedup_hash: u64,
}Expand description
A unified security finding that can represent any type of vulnerability.
This struct provides a consistent interface for all security analyzers, enabling unified reporting, filtering, and output formatting.
Fields§
§id: StringUnique identifier for the finding type (e.g., “SQLI-001”, “CMD-002”)
category: SecurityCategoryCategory of the security issue
severity: SeveritySeverity level
confidence: ConfidenceConfidence in the finding
location: LocationLocation in source code
title: StringShort title describing the issue
description: StringDetailed description of the vulnerability
cwe_id: Option<u32>CWE (Common Weakness Enumeration) reference ID
remediation: StringSuggested remediation/fix
code_snippet: StringCode snippet showing the vulnerable code
metadata: HashMap<String, String>Additional metadata (analyzer-specific information)
suppressed: boolWhether this finding has been suppressed via comment
dedup_hash: u64Hash for deduplication (based on location + category)
Implementations§
Source§impl SecurityFinding
impl SecurityFinding
Sourcepub fn new(
id: impl Into<String>,
category: SecurityCategory,
severity: Severity,
confidence: Confidence,
location: Location,
title: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( id: impl Into<String>, category: SecurityCategory, severity: Severity, confidence: Confidence, location: Location, title: impl Into<String>, description: impl Into<String>, ) -> Self
Create a new security finding with required fields.
Sourcepub fn with_remediation(self, remediation: impl Into<String>) -> Self
pub fn with_remediation(self, remediation: impl Into<String>) -> Self
Add remediation advice.
Sourcepub fn with_code_snippet(self, snippet: impl Into<String>) -> Self
pub fn with_code_snippet(self, snippet: impl Into<String>) -> Self
Add code snippet.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata key-value pair.
Sourcepub fn suppressed(self) -> Self
pub fn suppressed(self) -> Self
Mark as suppressed.
Sourcepub fn fingerprint(&self) -> String
pub fn fingerprint(&self) -> String
Get a fingerprint for this finding (used for deduplication).
Trait Implementations§
Source§impl Clone for SecurityFinding
impl Clone for SecurityFinding
Source§fn clone(&self) -> SecurityFinding
fn clone(&self) -> SecurityFinding
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityFinding
impl Debug for SecurityFinding
Source§impl<'de> Deserialize<'de> for SecurityFinding
impl<'de> Deserialize<'de> for SecurityFinding
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 Hash for SecurityFinding
impl Hash for SecurityFinding
Source§impl PartialEq for SecurityFinding
impl PartialEq for SecurityFinding
Source§impl Serialize for SecurityFinding
impl Serialize for SecurityFinding
impl Eq for SecurityFinding
Auto Trait Implementations§
impl Freeze for SecurityFinding
impl RefUnwindSafe for SecurityFinding
impl Send for SecurityFinding
impl Sync for SecurityFinding
impl Unpin for SecurityFinding
impl UnwindSafe for SecurityFinding
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> 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.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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request