While the Content and Structure is defined in the Vulnerability Rating Taxonomy Repository, this defines methods to allow for easy handling of VRT logic. This gem is used and maintained by Bugcrowd Engineering.
Add this line to your application's Gemfile:
gem'vrt'To create the initializer:
rails generate vrt:installFor convenience in development, we provide a utility for spinning up a playground for playing with the gem. You can invoke it with:
bin/consoleWhen one has a VRT Classification ID, one can check it's validity:
vrt=VRT::Map.newvrt.valid?('server_side_injection')=>truevrt.valid?('test_vrt_classification')=>falseGet a pretty output for its lineage:
vrt=VRT::Map.newvrt.get_lineage('server_side_injection.file_inclusion.local')=>"Server-Side Injection > File Inclusion > Local"The information within that node:
vrt=VRT::Map.newvrt.find_node('server_side_injection.file_inclusion.local')Which returns the corresponding VRT::Node. This node has a variety of methods:
vrt_map=VRT::Map.newnode=vrt_map.find_node('server_side_injection.file_inclusion.local')node.children# Returns Child Nodesnode.parent# Returns Parent Nodenode.prioritynode.idnode.namenode.mappings# The node's mappings to other classificationsVRT module also has a find_node method that is version agnostic. This is used to find the best
match for a node under any version and has options to specify a preferred version.
# Find a node in a given preferred version that best maps to the given idVRT.find_node(vrt_id: 'social_engineering',preferred_version: '1.1')# returns 'other'# Aggregate vulnerabilities by categoryVRT.find_node(vrt_id: vrt_id,max_depth: 'category')# Query for vulnerabilities by category while maintaining deprecated mappings by adding# deprecated ids to the search with `all_matching_categories`categories_to_search_for += VRT.all_matching_categories(categories_to_search_for)A mapping is a relationship defined from a node to another classification like cvss or cwe or to more information like remediation advice. The relationships that are defined in mappings are maintained by the Bugcrowd team as well as external contributors to the VRT repo.
VRT.find_node(vrt_id: 'server_security_misconfiguration.unsafe_cross_origin_resource_sharing').mappings[:cwe]=>["CWE-942","CWE-16"]These are simillar to mappings, but the relationships are maintained by an external party instead of Bugcrowd.
VRT.find_node(vrt_id: 'server_security_misconfiguration.unsafe_cross_origin_resource_sharing').third_party_links[:scw]=>"https://integration-api.securecodewarrior.com/api/v1/trial?id=bugcrowd&mappingList=vrt&mappingKey=server_security_misconfiguration:unsafe_cross_origin_resource_sharing&redirect=true"