class

CVSS::V2::Vector

Inherits CVSS::Vector < Comparable < Reference < Object

CVSS v2.0 vector. Format has no CVSS:x.y/ prefix: "AV:N/AC:L/Au:N/C:P/I:P/A:P"

Constants

BASE_REQUIRED = ["AV", "AC", "Au", "C", "I", "A"] of ::String

The six required base metrics — parse fails if any is missing.

METRIC_ORDER = ["AV", "AC", "Au", "C", "I", "A", "E", "RL", "RC", "CDP", "TD", "CR", "IR", "AR"] of ::String

Canonical metric ordering used by to_s. v2.0 has no CVSS:x.y/ prefix, so the first emitted metric appears with no leading separator.

Constructors

new(av : AccessVector, ac : AccessComplexity, au : Authentication, c : Impact, i : Impact, a : Impact, e : Exploitability | Nil = nil, rl : RemediationLevel | Nil = nil, rc : ReportConfidence | Nil = nil, cdp : CollateralDamagePotential | Nil = nil, td : TargetDistribution | Nil = nil, cr : SecurityRequirement | Nil = nil, ir : SecurityRequirement | Nil = nil, ar : SecurityRequirement | Nil = nil)
Source
parse(input : String) : Vector
Source

Class methods

parse?(input : String) : Vector | Nil

Non-raising parse — returns nil if the input is malformed.

Source

Instance methods

==(other : self)

Returns true if this reference is the same as other. Invokes same?.

adjacent_network?
Source
base_score
Source
environmental_score
Source
environmental_severity
Source
hash(hasher)

See Object#hash(hasher)

impacts_availability?
Source
impacts_confidentiality?
Source
impacts_integrity?
Source
local?
Source
metric_value(name : String) : String

Returns the stored short-code for a metric. Optional metrics that have not been set return "ND" (the v2 NotDefined code). Raises CVSS::Error if name is not a recognised v2 metric key.

Source
network?
Source
requires_authentication?
Source
severity
Source
temporal_score
Source
temporal_severity
Source
to_h

Returns a Hash(String, String) of metric short-codes, in canonical order. Optional metrics are only included when set.

Source
to_s(io : IO) : Nil

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>
Source
version
Source