CVSS::V4::Vector
Inherits CVSS::Vector < Comparable < Reference < Object
CVSS v4.0 vector.
vec = CVSS::V4::Vector.parse("CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N")
vec.base_score # => 9.3
vec.severity # => CVSS::Severity::Critical
Constants
Canonical metric ordering used by to_s. Matches the FIRST calculator.
Constructors
Class methods
Instance methods
Returns true if this reference is the same as other. Invokes same?.
Mirror of the JS m() function — applies X-defaults and Modified
overrides when the score algorithm asks for an effective metric value.
True when any Environmental metric (Security Requirements or Modified base) carries a meaningful (non-X) value.
See Object#hash(hasher)
The 6-character MacroVector this vector falls into. Concatenates
EQ1 EQ2 EQ3 EQ4 EQ5 EQ6 digits as defined in the CVSS v4.0 spec.
CVSS::V4::Vector.parse("CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N").macro_vector
# => "000200"
Return the raw code stored for a metric, or "X" if unset.
Vector nomenclature per CVSS v4.0 spec §6 — classifies the vector by which optional metric groups are populated (Base only, +Threat, +Environmental, or both).
vec = CVSS::V4::Vector.parse("CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N")
vec.nomenclature.to_s # => "CVSS-B"
vec.nomenclature.base? # => true
In v4.0 the single score is the threat/environmental-aware score (Threat metrics are part of the macro-vector). We expose aliases for API symmetry with the v3 vector class.
Returns a Hash(String, String) of metric short-codes, in canonical
order. Optional metrics are only included when set. Note that
supplemental metric U (Provider Urgency) keeps its full word value
("Clear" / "Green" / "Amber" / "Red") rather than a single letter.
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>