cvss-suite 1.2.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +23 -0
- data/.github/workflows/rubocop.yml +21 -0
- data/.rubocop.yml +47 -1
- data/.rubocop_todo.yml +59 -0
- data/CHANGES.md +40 -1
- data/README.md +16 -11
- data/_config.yml +1 -0
- data/bin/console +3 -3
- data/cvss_suite.gemspec +14 -14
- data/lib/cvss_suite.rb +10 -14
- data/lib/cvss_suite/cvss.rb +93 -95
- data/lib/cvss_suite/cvss2/cvss2.rb +50 -28
- data/lib/cvss_suite/cvss2/cvss2_base.rb +69 -75
- data/lib/cvss_suite/cvss2/cvss2_environmental.rb +52 -54
- data/lib/cvss_suite/cvss2/cvss2_temporal.rb +40 -41
- data/lib/cvss_suite/cvss3/cvss3.rb +39 -36
- data/lib/cvss_suite/cvss3/cvss3_base.rb +72 -75
- data/lib/cvss_suite/cvss3/cvss3_environmental.rb +159 -109
- data/lib/cvss_suite/cvss3/cvss3_temporal.rb +41 -42
- data/lib/cvss_suite/cvss31/cvss31.rb +36 -28
- data/lib/cvss_suite/cvss31/cvss31_base.rb +66 -68
- data/lib/cvss_suite/cvss31/cvss31_environmental.rb +159 -109
- data/lib/cvss_suite/cvss31/cvss31_temporal.rb +41 -42
- data/lib/cvss_suite/cvss_metric.rb +31 -35
- data/lib/cvss_suite/cvss_property.rb +57 -56
- data/lib/cvss_suite/errors.rb +2 -0
- data/lib/cvss_suite/helpers/cvss31_helper.rb +27 -0
- data/lib/cvss_suite/helpers/cvss3_helper.rb +21 -15
- data/lib/cvss_suite/invalid_cvss.rb +39 -45
- data/lib/cvss_suite/version.rb +2 -2
- metadata +12 -23
- data/.travis.yml +0 -4
- data/lib/cvss_suite/helpers/extensions.rb +0 -56
data/lib/cvss_suite/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# CVSS-Suite, a Ruby gem to manage the CVSS vector
|
2
2
|
#
|
3
|
-
# Copyright (c) Siemens AG,
|
3
|
+
# Copyright (c) Siemens AG, 2020
|
4
4
|
#
|
5
5
|
# Authors:
|
6
6
|
# Oliver Hambörger <oliver.hamboerger@siemens.com>
|
@@ -9,5 +9,5 @@
|
|
9
9
|
# See the LICENSE.md file in the top-level directory.
|
10
10
|
|
11
11
|
module CvssSuite
|
12
|
-
VERSION =
|
12
|
+
VERSION = '2.0.2'.freeze
|
13
13
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cvss-suite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Hamboerger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.10'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -52,34 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.2'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rdoc
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '4.2'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '4.2'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: simplecov
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
59
|
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
61
|
+
version: '0.18'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
68
|
+
version: '0.18'
|
83
69
|
description: |-
|
84
70
|
This Ruby gem helps you to process the vector of the Common Vulnerability Scoring System (https://www.first.org/cvss/specification-document).
|
85
71
|
Besides calculating the Base, Temporal and Environmental Score, you are able to extract the selected option.
|
@@ -92,16 +78,19 @@ files:
|
|
92
78
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
93
79
|
- ".github/ISSUE_TEMPLATE/custom.md"
|
94
80
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
81
|
+
- ".github/workflows/rspec.yml"
|
82
|
+
- ".github/workflows/rubocop.yml"
|
95
83
|
- ".gitignore"
|
96
84
|
- ".rspec"
|
97
85
|
- ".rubocop.yml"
|
98
|
-
- ".
|
86
|
+
- ".rubocop_todo.yml"
|
99
87
|
- CHANGES.md
|
100
88
|
- CODE_OF_CONDUCT.md
|
101
89
|
- Gemfile
|
102
90
|
- LICENSE.md
|
103
91
|
- PULL_REQUEST_TEMPLATE.md
|
104
92
|
- README.md
|
93
|
+
- _config.yml
|
105
94
|
- bin/console
|
106
95
|
- bin/setup
|
107
96
|
- cvss_suite.gemspec
|
@@ -122,8 +111,8 @@ files:
|
|
122
111
|
- lib/cvss_suite/cvss_metric.rb
|
123
112
|
- lib/cvss_suite/cvss_property.rb
|
124
113
|
- lib/cvss_suite/errors.rb
|
114
|
+
- lib/cvss_suite/helpers/cvss31_helper.rb
|
125
115
|
- lib/cvss_suite/helpers/cvss3_helper.rb
|
126
|
-
- lib/cvss_suite/helpers/extensions.rb
|
127
116
|
- lib/cvss_suite/invalid_cvss.rb
|
128
117
|
- lib/cvss_suite/version.rb
|
129
118
|
homepage: https://siemens.github.io/cvss-suite/
|
@@ -138,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
138
127
|
requirements:
|
139
128
|
- - ">="
|
140
129
|
- !ruby/object:Gem::Version
|
141
|
-
version: 2.
|
130
|
+
version: 2.4.0
|
142
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
132
|
requirements:
|
144
133
|
- - ">="
|
data/.travis.yml
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
# CVSS-Suite, a Ruby gem to manage the CVSS vector
|
2
|
-
#
|
3
|
-
# Copyright (c) Siemens AG, 2016
|
4
|
-
#
|
5
|
-
# Authors:
|
6
|
-
# Oliver Hambörger <oliver.hamboerger@siemens.com>
|
7
|
-
#
|
8
|
-
# This work is licensed under the terms of the MIT license.
|
9
|
-
# See the LICENSE.md file in the top-level directory.
|
10
|
-
|
11
|
-
##
|
12
|
-
# This class includes extensions for the Float datatype.
|
13
|
-
|
14
|
-
class Float
|
15
|
-
|
16
|
-
##
|
17
|
-
# Since CVSS 3 all float values are rounded up, therefore this method is used instead of the mathematically correct method round().
|
18
|
-
|
19
|
-
def round_up(decimal_paces = 0)
|
20
|
-
(self * 10.0**decimal_paces).ceil / 10.0**decimal_paces
|
21
|
-
end
|
22
|
-
|
23
|
-
##
|
24
|
-
# The “Round up” function in CVSS v3.0 has been renamed Roundup and is now defined more precisely to minimize the possibility of implementations generating different scores due to small floating-point inaccuracies. This can happen due to differences in floating point arithmetic between different languages and hardware platforms.
|
25
|
-
|
26
|
-
def roundup
|
27
|
-
output = (self * 100000).round
|
28
|
-
if (output % 10000) == 0
|
29
|
-
return output / 100000.0
|
30
|
-
else
|
31
|
-
return ((output / 10000).floor + 1) / 10.0
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
class Integer
|
37
|
-
|
38
|
-
##
|
39
|
-
# Since CVSS 3 all float values are rounded up, therefore this method is used instead of the mathematically correct method round().
|
40
|
-
|
41
|
-
def round_up(decimal_paces = 0)
|
42
|
-
(self * 10.0**decimal_paces).ceil / 10.0**decimal_paces
|
43
|
-
end
|
44
|
-
|
45
|
-
##
|
46
|
-
# The “Round up” function in CVSS v3.0 has been renamed Roundup and is now defined more precisely to minimize the possibility of implementations generating different scores due to small floating-point inaccuracies. This can happen due to differences in floating point arithmetic between different languages and hardware platforms.
|
47
|
-
|
48
|
-
def roundup
|
49
|
-
output = (self * 100000).round
|
50
|
-
if (output % 10000) == 0
|
51
|
-
return output / 100000.0
|
52
|
-
else
|
53
|
-
return ((output / 10000).floor + 1) / 10.0
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|