Class: CvssSuite::Cvss31

Inherits:
Cvss
  • Object
show all
Defined in:
lib/cvss_suite/cvss31/cvss31.rb

Overview

This class represents a CVSS vector in version 3.1.

Instance Attribute Summary

Attributes inherited from Cvss

#base, #environmental, #temporal, #vector

Instance Method Summary collapse

Methods inherited from Cvss

#initialize, #overall_score, #severity, #valid?

Constructor Details

This class inherits a constructor from CvssSuite::Cvss

Instance Method Details

#base_scoreObject

Returns the Base Score of the CVSS vector.



32
33
34
35
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 32

def base_score
  check_validity
  Cvss31Helper.round_up(@base.score)
end

#environmental_scoreObject

Returns the Environmental Score of the CVSS vector.



47
48
49
50
51
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 47

def environmental_score
  return temporal_score unless @environmental.valid?

  Cvss31Helper.round_up(@environmental.score(@base, @temporal))
end

#temporal_scoreObject

Returns the Temporal Score of the CVSS vector.



40
41
42
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 40

def temporal_score
  Cvss31Helper.round_up(Cvss31Helper.round_up(@base.score) * @temporal.score)
end

#versionObject

Returns the Version of the CVSS vector.



25
26
27
# File 'lib/cvss_suite/cvss31/cvss31.rb', line 25

def version
  3.1
end