diff --git a/vulnerabilities/severity_systems.py b/vulnerabilities/severity_systems.py index de0d45f69..6260750b2 100644 --- a/vulnerabilities/severity_systems.py +++ b/vulnerabilities/severity_systems.py @@ -37,6 +37,9 @@ def compute(self, scoring_elements: str) -> str: """ return NotImplementedError + def get(self, scoring_elements: str): + return NotImplementedError + @dataclasses.dataclass(order=True) class Cvssv2ScoringSystem(ScoringSystem): @@ -49,6 +52,10 @@ def compute(self, scoring_elements: str) -> str: """ return str(CVSS2(vector=scoring_elements).base_score) + def get(self, scoring_elements: str) -> dict: + scoring_elements = scoring_elements.strip() + return CVSS2(vector=scoring_elements).as_json() + CVSSV2 = Cvssv2ScoringSystem( identifier="cvssv2", @@ -71,6 +78,10 @@ def compute(self, scoring_elements: str) -> str: """ return str(CVSS3(vector=scoring_elements).base_score) + def get(self, scoring_elements: str) -> dict: + scoring_elements = scoring_elements.strip() + return CVSS3(vector=scoring_elements).as_json() + CVSSV3 = Cvssv3ScoringSystem( identifier="cvssv3", diff --git a/vulnerabilities/templates/vulnerability_details.html b/vulnerabilities/templates/vulnerability_details.html index a7c1a4d4f..4f16c32ff 100644 --- a/vulnerabilities/templates/vulnerability_details.html +++ b/vulnerabilities/templates/vulnerability_details.html @@ -2,6 +2,7 @@ {% load humanize %} {% load widget_tweaks %} {% load static %} +{% load show_cvss %} {% block title %} VulnerableCode Vulnerability Details - {{ vulnerability.vulnerability_id }} @@ -52,6 +53,13 @@ +
Exploitability (E) | +Access Vector (AV) | +Access Complexity (AC) | +Authentication (Au) | +Confidentiality Impact (C) | +Integrity Impact (I) | +Availability Impact (A) | +
---|---|---|---|---|---|---|
{{ severity_vector.exploitability|cvss_printer:"high,functional,unproven,proof_of_concept,not_defined" }} | +{{ severity_vector.accessVector|cvss_printer:"local,adjacent_network,network" }} | +{{ severity_vector.accessComplexity|cvss_printer:"high,medium,low" }} | +{{ severity_vector.authentication|cvss_printer:"multiple,single,none" }} | +{{ severity_vector.confidentialityImpact|cvss_printer:"none,partial,complete" }} | +{{ severity_vector.integrityImpact|cvss_printer:"none,partial,complete" }} | +{{ severity_vector.availabilityImpact|cvss_printer:"none,partial,complete" }} | +
Attack Vector (AV) | +Attack Complexity (AC) | +Privileges Required (PR) | +User Interaction (UI) | +Scope (S) | +Confidentiality Impact (C) | +Integrity Impact (I) | +Availability Impact (A) | +
---|---|---|---|---|---|---|---|
{{ severity_vector.attackVector|cvss_printer:"network,adjacent_network,local,physical"}} | +{{ severity_vector.attackComplexity|cvss_printer:"low,high" }} | +{{ severity_vector.privilegesRequired|cvss_printer:"none,low,high" }} | +{{ severity_vector.userInteraction|cvss_printer:"none,required"}} | +{{ severity_vector.scope|cvss_printer:"unchanged,changed" }} | +{{ severity_vector.confidentialityImpact|cvss_printer:"high,low,none" }} | +{{ severity_vector.integrityImpact|cvss_printer:"high,low,none" }} | +{{ severity_vector.availabilityImpact|cvss_printer:"high,low,none" }} | +