Class: SwaggerClient::VulnerabilityCvssV2

Inherits:
Object
  • Object
show all
Defined in:
lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ VulnerabilityCvssV2

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 108

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerClient::VulnerabilityCvssV2` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `SwaggerClient::VulnerabilityCvssV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'access_complexity')
    self.access_complexity = attributes[:'access_complexity']
  end

  if attributes.key?(:'access_vector')
    self.access_vector = attributes[:'access_vector']
  end

  if attributes.key?(:'authentication')
    self.authentication = attributes[:'authentication']
  end

  if attributes.key?(:'availability_impact')
    self.availability_impact = attributes[:'availability_impact']
  end

  if attributes.key?(:'confidentiality_impact')
    self.confidentiality_impact = attributes[:'confidentiality_impact']
  end

  if attributes.key?(:'exploit_score')
    self.exploit_score = attributes[:'exploit_score']
  end

  if attributes.key?(:'impact_score')
    self.impact_score = attributes[:'impact_score']
  end

  if attributes.key?(:'integrity_impact')
    self.integrity_impact = attributes[:'integrity_impact']
  end

  if attributes.key?(:'score')
    self.score = attributes[:'score']
  end

  if attributes.key?(:'vector')
    self.vector = attributes[:'vector']
  end
end

Instance Attribute Details

#access_complexityObject

Access Complexity (AC) component which measures the complexity of the attack required to exploit the vulnerability once an attacker has gained access to the target system. | Access Complexity | Description | | ———————– | ———————————————————————— | | High (‘"H"`) | Specialized access conditions exist. | | Medium (`"M"`) | The access conditions are somewhat specialized. | | Low (`"L"`) | Specialized access conditions or extenuating circumstances do not exist. |



17
18
19
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 17

def access_complexity
  @access_complexity
end

#access_vectorObject

Access Vector (Av) component which reflects how the vulnerability is exploited. | Access Vector | Description | | ————————– | ———– | | Local (‘"L"`) | A vulnerability exploitable with only local access requires the attacker to have either physical access to the vulnerable system or a local (shell) account. | | Adjacent Network (`"A"`) | A vulnerability exploitable with adjacent network access requires the attacker to have access to either the broadcast or collision domain of the vulnerable software. | | Network (`"N"`) | A vulnerability exploitable with network access means the vulnerable software is bound to the network stack and the attacker does not require local network access or local access. Such a vulnerability is often termed "remotely exploitable". |



20
21
22
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 20

def access_vector
  @access_vector
end

#authenticationObject

Authentication (Au) component which measures the number of times an attacker must authenticate to a target in order to exploit a vulnerability. | Authentication | Description | | ——————– | ———– | | Multiple (‘"M"`) | Exploiting the vulnerability requires that the attacker authenticate two or more times, even if the same credentials are used each time. | | Single (`"S"`) | The vulnerability requires an attacker to be logged into the system. | | None (`"N"`) | Authentication is not required to exploit the vulnerability. |



23
24
25
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 23

def authentication
  @authentication
end

#availability_impactObject

Availability Impact (A) component which measures the impact to availability of a successfully exploited vulnerability. | Availability Impact | Description | | ————————– | ———— | | None (‘"N"`) | There is no impact to the availability of the system. | | Partial (`"P"`) | There is reduced performance or interruptions in resource availability. | | Complete (`"C"`) | There is a total shutdown of the affected resource. The attacker can render the resource completely unavailable. |



26
27
28
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 26

def availability_impact
  @availability_impact
end

#confidentiality_impactObject

Confidentiality Impact © component which measures the impact on confidentiality of a successfully exploited vulnerability. | Confidentiality Impact | Description | | ————————– | ———— | | None (‘"N"`) | There is no impact to the confidentiality of the system. | | Partial (`"P"`) | There is considerable informational disclosure. Access to some system files is possible, but the attacker does not have control over what is obtained, or the scope of the loss is constrained. | | Complete (`"C"`) | There is total information disclosure, resulting in all system files being revealed. The attacker is able to read all of the system’s data (memory, files, etc.) |



29
30
31
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 29

def confidentiality_impact
  @confidentiality_impact
end

#exploit_scoreObject

The CVSS exploit score.



32
33
34
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 32

def exploit_score
  @exploit_score
end

#impact_scoreObject

The CVSS impact score.



35
36
37
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 35

def impact_score
  @impact_score
end

#integrity_impactObject

Integrity Impact (I) component measures the impact to integrity of a successfully exploited vulnerability. | Integrity Impact | Description | | ————————– | ———— | | None (‘"N"`) | There is no impact to the integrity of the system. | | Partial (`"P"`) | Modification of some system files or information is possible, but the attacker does not have control over what can be modified, or the scope of what the attacker can affect is limited. | | Complete (`"C"`) | There is a total compromise of system integrity. There is a complete loss of system protection, resulting in the entire system being compromised. The attacker is able to modify any files on the target system. |



38
39
40
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 38

def integrity_impact
  @integrity_impact
end

#scoreObject

The CVSS score, which ranges from 0-10.



41
42
43
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 41

def score
  @score
end

#vectorObject

The <a target="_blank" rel="noopener noreferrer" href="www.first.org/cvss/v2/guide">CVSS v2</a> vector.



44
45
46
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 44

def vector
  @vector
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 69

def self.attribute_map
  {
    :'access_complexity' => :'accessComplexity',
    :'access_vector' => :'accessVector',
    :'authentication' => :'authentication',
    :'availability_impact' => :'availabilityImpact',
    :'confidentiality_impact' => :'confidentialityImpact',
    :'exploit_score' => :'exploitScore',
    :'impact_score' => :'impactScore',
    :'integrity_impact' => :'integrityImpact',
    :'score' => :'score',
    :'vector' => :'vector'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



279
280
281
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 279

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



101
102
103
104
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 101

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 85

def self.openapi_types
  {
    :'access_complexity' => :'Object',
    :'access_vector' => :'Object',
    :'authentication' => :'Object',
    :'availability_impact' => :'Object',
    :'confidentiality_impact' => :'Object',
    :'exploit_score' => :'Object',
    :'impact_score' => :'Object',
    :'integrity_impact' => :'Object',
    :'score' => :'Object',
    :'vector' => :'Object'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 249

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      access_complexity == o.access_complexity &&
      access_vector == o.access_vector &&
      authentication == o.authentication &&
      availability_impact == o.availability_impact &&
      confidentiality_impact == o.confidentiality_impact &&
      exploit_score == o.exploit_score &&
      impact_score == o.impact_score &&
      integrity_impact == o.integrity_impact &&
      score == o.score &&
      vector == o.vector
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 309

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    SwaggerClient.const_get(type).build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 378

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 286

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.openapi_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


266
267
268
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 266

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



272
273
274
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 272

def hash
  [access_complexity, access_vector, authentication, availability_impact, confidentiality_impact, exploit_score, impact_score, integrity_impact, score, vector].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



164
165
166
167
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 164

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



354
355
356
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 354

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 360

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



348
349
350
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 348

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v2.rb', line 171

def valid?
  access_complexity_validator = EnumAttributeValidator.new('Object', ['L', 'M', 'H'])
  return false unless access_complexity_validator.valid?(@access_complexity)
  access_vector_validator = EnumAttributeValidator.new('Object', ['L', 'A', 'N'])
  return false unless access_vector_validator.valid?(@access_vector)
  authentication_validator = EnumAttributeValidator.new('Object', ['N', 'S', 'M'])
  return false unless authentication_validator.valid?(@authentication)
  availability_impact_validator = EnumAttributeValidator.new('Object', ['N', 'P', 'C'])
  return false unless availability_impact_validator.valid?(@availability_impact)
  confidentiality_impact_validator = EnumAttributeValidator.new('Object', ['N', 'P', 'C'])
  return false unless confidentiality_impact_validator.valid?(@confidentiality_impact)
  integrity_impact_validator = EnumAttributeValidator.new('Object', ['N', 'P', 'C'])
  return false unless integrity_impact_validator.valid?(@integrity_impact)
  true
end