Skip to content

Commit

Permalink
Update cvss4.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdlangton authored Apr 3, 2024
1 parent ff07181 commit e9f7a0c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cvss/cvss4.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,32 @@ def compute_severity(self):
else:
self.severity = "Critical"

def scores(self):
"""
Returns computed base score as tuple for backwards compatibility.
Returns:
(tuple of floats): Base Score
"""
return (self.base_score,)

def severities(self):
"""
Returns severities based on base score as tuple for backwards compatibility.
Returns:
(tuple): Base Severity as string
"""
return (self.severity,)

def rh_vector(self):
"""
Returns cleaned vector with score in Red Hat notation, e.g. score/vector.
Example: 6.5/CVSS:3.0/AV:P/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:N/E:H/RL:O/RC:R/CR:H/MAC:H/MC:L
"""
return str(self.base_score) + "/" + self.clean_vector()

def as_json(self, sort=False, minimal=False):
"""
Returns a dictionary formatted with attribute names and values defined by the official
Expand Down

0 comments on commit e9f7a0c

Please sign in to comment.