Class: CvssSuite::Cvss2Environmental
- Inherits:
-
CvssMetric
- Object
- CvssMetric
- CvssSuite::Cvss2Environmental
- Defined in:
- lib/cvss_suite/cvss2/cvss2_environmental.rb
Overview
This class represents a CVSS Environmental metric in version 2.
Instance Attribute Summary collapse
-
#collateral_damage_potential ⇒ Object
readonly
Property of this metric.
-
#security_requirements_ar ⇒ Object
readonly
Property of this metric.
-
#security_requirements_cr ⇒ Object
readonly
Property of this metric.
-
#security_requirements_ir ⇒ Object
readonly
Property of this metric.
-
#target_distribution ⇒ Object
readonly
Property of this metric.
Attributes inherited from CvssMetric
Instance Method Summary collapse
-
#score(base, temporal_score) ⇒ Object
Returns score of this metric.
Methods inherited from CvssMetric
Constructor Details
This class inherits a constructor from CvssSuite::CvssMetric
Instance Attribute Details
#collateral_damage_potential ⇒ Object (readonly)
Property of this metric
15 16 17 |
# File 'lib/cvss_suite/cvss2/cvss2_environmental.rb', line 15 def collateral_damage_potential @collateral_damage_potential end |
#security_requirements_ar ⇒ Object (readonly)
Property of this metric
15 16 17 |
# File 'lib/cvss_suite/cvss2/cvss2_environmental.rb', line 15 def security_requirements_ar @security_requirements_ar end |
#security_requirements_cr ⇒ Object (readonly)
Property of this metric
15 16 17 |
# File 'lib/cvss_suite/cvss2/cvss2_environmental.rb', line 15 def security_requirements_cr @security_requirements_cr end |
#security_requirements_ir ⇒ Object (readonly)
Property of this metric
15 16 17 |
# File 'lib/cvss_suite/cvss2/cvss2_environmental.rb', line 15 def security_requirements_ir @security_requirements_ir end |
#target_distribution ⇒ Object (readonly)
Property of this metric
15 16 17 |
# File 'lib/cvss_suite/cvss2/cvss2_environmental.rb', line 15 def target_distribution @target_distribution end |
Instance Method Details
#score(base, temporal_score) ⇒ Object
Returns score of this metric
20 21 22 23 24 25 26 27 |
# File 'lib/cvss_suite/cvss2/cvss2_environmental.rb', line 20 def score(base, temporal_score) base_score = base.score(@security_requirements_cr.score, @security_requirements_ir.score, @security_requirements_ar.score).round(1) adjusted_temporal = (base_score * temporal_score).round(1) (adjusted_temporal + (10 - adjusted_temporal) * @collateral_damage_potential.score) * @target_distribution.score end |