Class: CvssSuite::Cvss3Environmental
- Inherits:
-
CvssMetric
- Object
- CvssMetric
- CvssSuite::Cvss3Environmental
- Defined in:
- lib/cvss_suite/cvss3/cvss3_environmental.rb
Overview
This class represents a CVSS Environmental metric in version 3.
Instance Attribute Summary collapse
-
#availability_requirement ⇒ Object
readonly
Property of this metric.
-
#confidentiality_requirement ⇒ Object
readonly
Property of this metric.
-
#integrity_requirement ⇒ Object
readonly
Property of this metric.
-
#modified_attack_complexity ⇒ Object
readonly
Property of this metric.
-
#modified_attack_vector ⇒ Object
readonly
Property of this metric.
-
#modified_availability ⇒ Object
readonly
Property of this metric.
-
#modified_confidentiality ⇒ Object
readonly
Property of this metric.
-
#modified_integrity ⇒ Object
readonly
Property of this metric.
-
#modified_privileges_required ⇒ Object
readonly
Property of this metric.
-
#modified_scope ⇒ Object
readonly
Property of this metric.
-
#modified_user_interaction ⇒ Object
readonly
Property of this metric.
Attributes inherited from CvssMetric
Instance Method Summary collapse
-
#score(base, temporal) ⇒ Object
Returns score of this metric.
Methods inherited from CvssMetric
Constructor Details
This class inherits a constructor from CvssSuite::CvssMetric
Instance Attribute Details
#availability_requirement ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def availability_requirement @availability_requirement end |
#confidentiality_requirement ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def confidentiality_requirement @confidentiality_requirement end |
#integrity_requirement ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def integrity_requirement @integrity_requirement end |
#modified_attack_complexity ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_attack_complexity @modified_attack_complexity end |
#modified_attack_vector ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_attack_vector @modified_attack_vector end |
#modified_availability ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_availability @modified_availability end |
#modified_confidentiality ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_confidentiality @modified_confidentiality end |
#modified_integrity ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_integrity @modified_integrity end |
#modified_privileges_required ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_privileges_required @modified_privileges_required end |
#modified_scope ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_scope @modified_scope end |
#modified_user_interaction ⇒ Object (readonly)
Property of this metric
16 17 18 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 16 def modified_user_interaction @modified_user_interaction end |
Instance Method Details
#score(base, temporal) ⇒ Object
Returns score of this metric
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cvss_suite/cvss3/cvss3_environmental.rb', line 24 def score(base, temporal) @base = base merged_modified_privileges_required = @modified_privileges_required if @modified_privileges_required.selected_value[:name] == 'Not Defined' merged_modified_privileges_required = @base.privileges_required end merged_modified_scope = @modified_scope if @modified_scope.selected_value[:name] == 'Not Defined' merged_modified_scope = @base.scope end privilege_score = Cvss3Helper.privileges_required_score(merged_modified_privileges_required, merged_modified_scope) modified_exploitability_sub_score = modified_exploitability_sub(privilege_score) modified_impact_sub_score = modified_impact_sub(isc_modified) return 0 if modified_impact_sub_score <= 0 calculate_score modified_impact_sub_score, modified_exploitability_sub_score, temporal.score end |