#[non_exhaustive]pub enum Evidence {
HttpResponse {
status: u16,
headers: Vec<(String, String)>,
body_excerpt: Option<String>,
},
DnsRecord {
record_type: String,
value: String,
},
Banner {
raw: String,
},
JsSnippet {
url: String,
line: usize,
snippet: String,
},
Certificate {
subject: String,
san: Vec<String>,
issuer: String,
expires: String,
},
CodeSnippet {
file: String,
line: usize,
column: Option<usize>,
snippet: String,
language: Option<String>,
},
HttpRequest {
method: String,
url: String,
headers: Vec<(String, String)>,
body: Option<String>,
},
PatternMatch {
pattern: String,
matched: String,
},
Raw(String),
}Expand description
Concrete evidence proving a finding is real.
Extensible via #[non_exhaustive] — new evidence types can be added
for new tools (firmware, mobile, etc.) without breaking existing consumers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
HttpResponse
HTTP response data (status, headers, body excerpt).
Fields
DnsRecord
DNS record evidence.
Banner
Service banner captured during port scanning.
JsSnippet
JavaScript source snippet with context.
Fields
Certificate
TLS certificate information.
Fields
CodeSnippet
Source code snippet (for SAST, malware detection).
Fields
HttpRequest
HTTP request that triggered the finding (for template/vuln scanners).
Fields
PatternMatch
Matched pattern or regex (for pattern-based scanners).
Raw(String)
Unstructured evidence — fallback for anything that doesn’t fit above.
Implementations§
Source§impl Evidence
impl Evidence
Sourcepub fn http_status(status: u16) -> Self
pub fn http_status(status: u16) -> Self
Create an HTTP response evidence with just a status code.
Examples found in repository?
examples/basic.rs (line 8)
3fn main() {
4 let finding = Finding::builder("basic-scanner", "https://example.com", Severity::High)
5 .title("Potential command injection")
6 .detail("Untrusted input reaches shell execution")
7 .tag("rce")
8 .evidence(secfinding::Evidence::http_status(500))
9 .build();
10
11 println!("{finding}");
12
13 let json = serde_json::to_string_pretty(&finding).unwrap();
14 println!("{json}");
15}Trait Implementations§
Source§impl<'de> Deserialize<'de> for Evidence
impl<'de> Deserialize<'de> for Evidence
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 Evidence
impl RefUnwindSafe for Evidence
impl Send for Evidence
impl Sync for Evidence
impl Unpin for Evidence
impl UnsafeUnpin for Evidence
impl UnwindSafe for Evidence
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