pub struct VulnerabilityCategorizer { /* private fields */ }Expand description
Helper for categorizing vulnerability findings
Implementations§
Source§impl VulnerabilityCategorizer
impl VulnerabilityCategorizer
Sourcepub fn new(vrt: VrtTaxonomy) -> Self
pub fn new(vrt: VrtTaxonomy) -> Self
Creates a new categorizer with VRT taxonomy only
Sourcepub fn with_all_mappings(
vrt: VrtTaxonomy,
cwe_mapping: CweMapping,
cvss_mapping: CvssV3Mapping,
) -> Self
pub fn with_all_mappings( vrt: VrtTaxonomy, cwe_mapping: CweMapping, cvss_mapping: CvssV3Mapping, ) -> Self
Creates a categorizer with all mappings (VRT, CWE, CVSS)
Sourcepub fn with_cwe_mapping(self, cwe_mapping: CweMapping) -> Self
pub fn with_cwe_mapping(self, cwe_mapping: CweMapping) -> Self
Adds CWE mapping
Sourcepub fn with_cvss_mapping(self, cvss_mapping: CvssV3Mapping) -> Self
pub fn with_cvss_mapping(self, cvss_mapping: CvssV3Mapping) -> Self
Adds CVSS v3 mapping
Sourcepub fn categorize_by_id(&self, vrt_id: &str) -> Option<CategorizedFinding>
pub fn categorize_by_id(&self, vrt_id: &str) -> Option<CategorizedFinding>
Categorizes a finding by VRT ID
§Example
use bugcrowd_vrt::{VulnerabilityCategorizer, load_vrt_from_file};
let vrt = load_vrt_from_file("vrt.json").expect("Failed to load VRT");
let categorizer = VulnerabilityCategorizer::new(vrt);
if let Some(finding) = categorizer.categorize_by_id("sql_injection") {
println!("VRT: {} (P{})", finding.vrt_name, finding.priority.unwrap_or(0));
}Sourcepub fn search_by_name(&self, query: &str) -> Vec<String>
pub fn search_by_name(&self, query: &str) -> Vec<String>
Searches for VRT IDs by name (case-insensitive substring match)
Returns a list of matching VRT IDs
§Example
use bugcrowd_vrt::{VulnerabilityCategorizer, load_vrt_from_file};
let vrt = load_vrt_from_file("vrt.json").expect("Failed to load VRT");
let categorizer = VulnerabilityCategorizer::new(vrt);
let matches = categorizer.search_by_name("sql");
for id in matches {
println!("Found: {}", id);
}Sourcepub fn categorize_by_description(
&self,
description: &str,
) -> Option<CategorizedFinding>
pub fn categorize_by_description( &self, description: &str, ) -> Option<CategorizedFinding>
Finds the best matching VRT ID for a vulnerability name/description
Uses keyword matching to find the most relevant VRT category
§Example
use bugcrowd_vrt::{VulnerabilityCategorizer, load_vrt_from_file};
let vrt = load_vrt_from_file("vrt.json").expect("Failed to load VRT");
let categorizer = VulnerabilityCategorizer::new(vrt);
let finding_name = "SQL Injection detected in login form";
if let Some(finding) = categorizer.categorize_by_description(finding_name) {
println!("Categorized as: {} (P{})", finding.vrt_name, finding.priority.unwrap_or(0));
}Sourcepub fn list_all_variants(&self) -> Vec<String>
pub fn list_all_variants(&self) -> Vec<String>
Lists all available VRT variant IDs (leaf nodes)
Sourcepub fn get_all_categorizations(&self) -> Vec<CategorizedFinding>
pub fn get_all_categorizations(&self) -> Vec<CategorizedFinding>
Gets all categorized findings for all variants
Auto Trait Implementations§
impl Freeze for VulnerabilityCategorizer
impl RefUnwindSafe for VulnerabilityCategorizer
impl Send for VulnerabilityCategorizer
impl Sync for VulnerabilityCategorizer
impl Unpin for VulnerabilityCategorizer
impl UnwindSafe for VulnerabilityCategorizer
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