class CVESchema::CVE::Impact::CVSSv3::BM

The Base Metric Group scoring information.

Constants

A
AC
AV
C
I
PR
S
UI

Attributes

a[R]

The Availability Impact

@return [:H, :L, :N]

ac[R]

The Attack Complexity.

@return [:L, :H]

av[R]

The Attack Vector.

@return [:N, :A, :L, :P]

c[R]

The Confidentiality Impact.

@return [:H, :L, :N]

i[R]

The Integrity Impact

@return [:H, :L, :N]

pr[R]

The Privileges Required.

@return [:N, :L, :H]

s[R]

The Scope

@return [:U, :C]

score[R]

The CVSSv3 score.

@return [String]

ui[R]

The User Interaction.

@return [:N, :R]

Public Class Methods

from_json(json) click to toggle source

Maps the parsed JSON to a Symbol Hash for {#initialize}.

@param [Hash{String => Object}] json

The parsed JSON.

@return [Hash{Symbol => Object}]

The mapped Symbol Hash.
# 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) click to toggle source

Loads the BM object from the parsed JSON.

@param [Hash{String => Object}] json

The parsed JSON.

@return [BM]

The loaded BM object.
# File lib/cve_schema/cve/impact/cvss_v3.rb, line 124
def self.load(json)
  new(**from_json(json))
end
new(av: nil, ac: nil, pr: nil, ui: nil, s: nil, c: nil, i: nil, a: nil, score: nil) click to toggle source

Initializes the BM object.

# 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