pub trait Reportable {
Show 13 methods
// Required methods
fn scanner(&self) -> &str;
fn target(&self) -> &str;
fn severity(&self) -> Severity;
fn title(&self) -> &str;
fn cwe_ids(&self) -> &[String];
fn cve_ids(&self) -> &[String];
fn tags(&self) -> &[String];
// Provided methods
fn detail(&self) -> &str { ... }
fn confidence(&self) -> Option<f64> { ... }
fn rule_id(&self) -> String { ... }
fn sarif_level(&self) -> &str { ... }
fn exploit_hint(&self) -> Option<&str> { ... }
fn evidence(&self) -> &[Evidence] { ... }
}Expand description
Trait for any finding-like type that can be rendered into reports.
Implement this on your domain-specific finding type. The secreport
crate accepts &[impl Reportable] for all output formats.
Only scanner, target, severity, and title are required.
Everything else has sensible defaults.
Required Methods§
Free-form tags.
Provided Methods§
Sourcefn detail(&self) -> &str
fn detail(&self) -> &str
Detailed description.
Examples found in repository?
examples/custom_reportable.rs (line 67)
55fn main() {
56 let f = PolicyFinding {
57 source: "s3://bucket/config.yaml".into(),
58 title: "Excessive privilege policy statement".into(),
59 score: 0.93,
60 };
61
62 println!("scanner: {}", f.scanner());
63 println!("target: {}", f.target());
64 println!("severity: {}", f.severity());
65 println!("rule id: {}", f.rule_id());
66 println!("tags: {}", f.tags().join(", "));
67 println!("{}", f.detail());
68}Sourcefn confidence(&self) -> Option<f64>
fn confidence(&self) -> Option<f64>
Confidence score 0.0-1.0 (None = not applicable).
Sourcefn rule_id(&self) -> String
fn rule_id(&self) -> String
SARIF rule ID (defaults to “scanner/title-slug”).
Examples found in repository?
examples/custom_reportable.rs (line 65)
55fn main() {
56 let f = PolicyFinding {
57 source: "s3://bucket/config.yaml".into(),
58 title: "Excessive privilege policy statement".into(),
59 score: 0.93,
60 };
61
62 println!("scanner: {}", f.scanner());
63 println!("target: {}", f.target());
64 println!("severity: {}", f.severity());
65 println!("rule id: {}", f.rule_id());
66 println!("tags: {}", f.tags().join(", "));
67 println!("{}", f.detail());
68}Sourcefn sarif_level(&self) -> &str
fn sarif_level(&self) -> &str
SARIF severity level string.
Sourcefn exploit_hint(&self) -> Option<&str>
fn exploit_hint(&self) -> Option<&str>
Exploit hint / PoC command.
Implementors§
impl Reportable for Finding
Blanket: secfinding’s own Finding implements Reportable.