Class: CVESchema::CVE::Impact::CVSSv3::BM
- Inherits:
-
Object
- Object
- CVESchema::CVE::Impact::CVSSv3::BM
- Defined in:
- lib/cve_schema/cve/impact/cvss_v3.rb
Overview
The Base Metric Group scoring information.
Constant Summary collapse
- AV =
{'N' => :N, 'A' => :A, 'L' => :L, 'P' => :P}
- AC =
{'L' => :L, 'H' => :H}
- PR =
{'N' => :N, 'L' => :L, 'H' => :H}
- UI =
{'N' => :N, 'R' => :R}
- S =
{'U' => :U, 'C' => :C}
- C =
{'H' => :H, 'L' => :L, 'N' => :N}
- I =
{'H' => :H, 'L' => :L, 'N' => :N}
- A =
{'H' => :H, 'L' => :L, 'N' => :N}
Instance Attribute Summary collapse
-
#a ⇒ :H, ...
readonly
The Availability Impact.
-
#ac ⇒ :L, :H
readonly
The Attack Complexity.
-
#av ⇒ :N, ...
readonly
The Attack Vector.
-
#c ⇒ :H, ...
readonly
The Confidentiality Impact.
-
#i ⇒ :H, ...
readonly
The Integrity Impact.
-
#pr ⇒ :N, ...
readonly
The Privileges Required.
-
#s ⇒ :U, :C
readonly
The Scope.
-
#score ⇒ String
readonly
The CVSSv3 score.
-
#ui ⇒ :N, :R
readonly
The User Interaction.
Class Method Summary collapse
-
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
-
.load(json) ⇒ BM
Loads the BM object from the parsed JSON.
Instance Method Summary collapse
-
#initialize(av: nil, ac: nil, pr: nil, ui: nil, s: nil, c: nil, i: nil, a: nil, score: nil) ⇒ BM
constructor
Initializes the BM object.
Constructor Details
#initialize(av: nil, ac: nil, pr: nil, ui: nil, s: nil, c: nil, i: nil, a: nil, score: nil) ⇒ BM
Initializes the BM object.
77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 77 def initialize(av: nil, ac: nil, pr: nil, ui: nil, s: nil, c: nil, i: nil, a: nil, score: nil) @av = av @ac = ac @pr = pr @ui = ui @s = s @c = c @i = i @a = a @score = score end |
Instance Attribute Details
#a ⇒ :H, ... (readonly)
The Availability Impact
67 68 69 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 67 def a @a end |
#ac ⇒ :L, :H (readonly)
The Attack Complexity.
25 26 27 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 25 def ac @ac end |
#av ⇒ :N, ... (readonly)
The Attack Vector.
18 19 20 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 18 def av @av end |
#c ⇒ :H, ... (readonly)
The Confidentiality Impact.
53 54 55 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 53 def c @c end |
#i ⇒ :H, ... (readonly)
The Integrity Impact
60 61 62 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 60 def i @i end |
#pr ⇒ :N, ... (readonly)
The Privileges Required.
32 33 34 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 32 def pr @pr end |
#s ⇒ :U, :C (readonly)
The Scope
46 47 48 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 46 def s @s end |
#score ⇒ String (readonly)
The CVSSv3 score.
72 73 74 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 72 def score @score end |
#ui ⇒ :N, :R (readonly)
The User Interaction.
39 40 41 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 39 def ui @ui end |
Class Method Details
.from_json(json) ⇒ Hash{Symbol => Object}
Maps the parsed JSON to a Symbol Hash for #initialize.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 100 def self.from_json(json) { av: AV[json['AV']], ac: AC[json['AC']], pr: PR[json['PR']], ui: UI[json['UI']], s: S[json['S']], c: C[json['C']], i: I[json['I']], a: A[json['A']], score: json['SCORE'] } end |
.load(json) ⇒ BM
Loads the BM object from the parsed JSON.
124 125 126 |
# File 'lib/cve_schema/cve/impact/cvss_v3.rb', line 124 def self.load(json) new(**from_json(json)) end |