Class: SwaggerClient::VulnerabilityCvssV3
- Inherits:
-
Object
- Object
- SwaggerClient::VulnerabilityCvssV3
- Defined in:
- lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#attack_complexity ⇒ Object
Access Complexity (AC) component with measures the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.
-
#attack_vector ⇒ Object
Attack Vector (AV) component which measures context by which vulnerability exploitation is possible.
-
#availability_impact ⇒ Object
Availability Impact (A) measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.
-
#confidentiality_impact ⇒ Object
Confidentiality Impact © component which measures the impact on confidentiality of a successfully exploited vulnerability.
-
#exploit_score ⇒ Object
The CVSS impact score.
-
#impact_score ⇒ Object
The CVSS exploit score.
-
#integrity_impact ⇒ Object
Integrity Impact (I) measures the impact to integrity of a successfully exploited vulnerability.
-
#privilege_required ⇒ Object
Privileges Required (PR) measures the level of privileges an attacker must possess before successfully exploiting the vulnerability.
-
#scope ⇒ Object
Scope (S) measures the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc).
-
#score ⇒ Object
The CVSS score, which ranges from 0-10.
-
#user_interaction ⇒ Object
User Interaction (UI) measures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component.
-
#vector ⇒ Object
The <a target="_blank" rel="noopener noreferrer" href="www.first.org/cvss/specification-document">CVSS v3</a> vector.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ VulnerabilityCvssV3
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ VulnerabilityCvssV3
Initializes the object
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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 118 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `SwaggerClient::VulnerabilityCvssV3` 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::VulnerabilityCvssV3`. 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?(:'attack_complexity') self.attack_complexity = attributes[:'attack_complexity'] end if attributes.key?(:'attack_vector') self.attack_vector = attributes[:'attack_vector'] 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?(:'privilege_required') self.privilege_required = attributes[:'privilege_required'] end if attributes.key?(:'scope') self.scope = attributes[:'scope'] end if attributes.key?(:'score') self.score = attributes[:'score'] end if attributes.key?(:'user_interaction') self.user_interaction = attributes[:'user_interaction'] end if attributes.key?(:'vector') self.vector = attributes[:'vector'] end end |
Instance Attribute Details
#attack_complexity ⇒ Object
Access Complexity (AC) component with measures the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability. | Access Complexity | Description | | ———————- | ———————————————————————— | | Low (‘"L"`) | Specialized access conditions or extenuating circumstances do not exist. | | High (`"H"`) | A successful attack depends on conditions beyond the attacker’s control. |
17 18 19 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 17 def attack_complexity @attack_complexity end |
#attack_vector ⇒ Object
Attack Vector (AV) component which measures context by which vulnerability exploitation is possible. | 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 (`"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_v3.rb', line 20 def attack_vector @attack_vector end |
#availability_impact ⇒ Object
Availability Impact (A) measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability. | Availability Impact | Description | | ————————– | ———— | | High (‘"H"`) | There is total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). | | Low (`"L"`) | There is reduced performance or interruptions in resource availability. Even if repeated exploitation of the vulnerability is possible, the attacker does not have the ability to completely deny service to legitimate users. | | None (`"N"`) | There is no impact to availability within the impacted component. |
23 24 25 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 23 def availability_impact @availability_impact end |
#confidentiality_impact ⇒ Object
Confidentiality Impact © component which measures the impact on confidentiality of a successfully exploited vulnerability. | Confidentiality Impact | Description | | ————————– | ———— | | High (‘"H"`) | There is total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. | | Low (`"L"`) | There is some loss of confidentiality. Access to some restricted information is obtained, but the attacker does not have control over what information is obtained, or the amount or kind of loss is constrained. | | None (`"N"`) | There is no loss of confidentiality within the impacted component. |
26 27 28 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 26 def confidentiality_impact @confidentiality_impact end |
#exploit_score ⇒ Object
The CVSS impact score.
29 30 31 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 29 def exploit_score @exploit_score end |
#impact_score ⇒ Object
The CVSS exploit score.
32 33 34 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 32 def impact_score @impact_score end |
#integrity_impact ⇒ Object
Integrity Impact (I) measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. | Integrity Impact | Description | | ——————- | ———— | | High (‘"H"`) | There is a total loss of integrity, or a complete loss of protection. | | Low (`"L"`) | Modification of data is possible, but the attacker does not have control over the consequence of a modification, or the amount of modification is constrained. | | None (`"N"`) | There is no loss of integrity within the impacted component. |
35 36 37 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 35 def integrity_impact @integrity_impact end |
#privilege_required ⇒ Object
Privileges Required (PR) measures the level of privileges an attacker must possess before successfully exploiting the vulnerability. | Privileges Required (PR) | Description | | —————————- | ———————————————————————— | | None (‘"N"`) | The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files to carry out an attack. | | Low (`"L"`) | The attacker is authorized with (i.e. requires) privileges that provide basic user capabilities that could normally affect only settings and files owned by a user. | | High (`"H"`) | The attacker is authorized with (i.e. requires) privileges that provide significant (e.g. administrative) control over the vulnerable component that could affect component-wide settings and files. |
38 39 40 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 38 def privilege_required @privilege_required end |
#scope ⇒ Object
Scope (S) measures the collection of privileges defined by a computing authority (e.g. an application, an operating system, or a sandbox environment) when granting access to computing resources (e.g. files, CPU, memory, etc). These privileges are assigned based on some method of identification and authorization. | Scope (S) | Description | | ——————– | ———————————————————————— | | Unchanged (‘"U"`) | An exploited vulnerability can only affect resources managed by the same authority. In this case the vulnerable component and the impacted component are the same. | | Changed (`"C"`) | An exploited vulnerability can affect resources beyond the authorization privileges intended by the vulnerable component. In this case the vulnerable component and the impacted component are different. |
41 42 43 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 41 def scope @scope end |
#score ⇒ Object
The CVSS score, which ranges from 0-10.
44 45 46 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 44 def score @score end |
#user_interaction ⇒ Object
User Interaction (UI) measures the requirement for a user, other than the attacker, to participate in the successful compromise of the vulnerable component. | User Interaction (UI) | Description | | —————————- | ————————————————————————- | | None (‘"N"`) | The vulnerable system can be exploited without interaction from any user. | | Required (`"R"`) | Successful exploitation of this vulnerability requires a user to take some action before the vulnerability can be exploited. |
47 48 49 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 47 def user_interaction @user_interaction end |
#vector ⇒ Object
The <a target="_blank" rel="noopener noreferrer" href="www.first.org/cvss/specification-document">CVSS v3</a> vector.
50 51 52 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 50 def vector @vector end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 75 def self.attribute_map { :'attack_complexity' => :'attackComplexity', :'attack_vector' => :'attackVector', :'availability_impact' => :'availabilityImpact', :'confidentiality_impact' => :'confidentialityImpact', :'exploit_score' => :'exploitScore', :'impact_score' => :'impactScore', :'integrity_impact' => :'integrityImpact', :'privilege_required' => :'privilegeRequired', :'scope' => :'scope', :'score' => :'score', :'user_interaction' => :'userInteraction', :'vector' => :'vector' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
323 324 325 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 323 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
111 112 113 114 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 111 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 93 def self.openapi_types { :'attack_complexity' => :'Object', :'attack_vector' => :'Object', :'availability_impact' => :'Object', :'confidentiality_impact' => :'Object', :'exploit_score' => :'Object', :'impact_score' => :'Object', :'integrity_impact' => :'Object', :'privilege_required' => :'Object', :'scope' => :'Object', :'score' => :'Object', :'user_interaction' => :'Object', :'vector' => :'Object' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 291 def ==(o) return true if self.equal?(o) self.class == o.class && attack_complexity == o.attack_complexity && attack_vector == o.attack_vector && 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 && privilege_required == o.privilege_required && scope == o.scope && score == o.score && user_interaction == o.user_interaction && vector == o.vector end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 353 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
422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 422 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
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 330 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
310 311 312 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 310 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
316 317 318 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 316 def hash [attack_complexity, attack_vector, availability_impact, confidentiality_impact, exploit_score, impact_score, integrity_impact, privilege_required, scope, score, user_interaction, vector].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
182 183 184 185 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 182 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
398 399 400 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 398 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 404 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_s ⇒ String
Returns the string representation of the object
392 393 394 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 392 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/service/api/rapid7_insightvm_client/lib/swagger_client/models/vulnerability_cvss_v3.rb', line 189 def valid? attack_complexity_validator = EnumAttributeValidator.new('Object', ['L', 'H']) return false unless attack_complexity_validator.valid?(@attack_complexity) attack_vector_validator = EnumAttributeValidator.new('Object', ['N', 'A', 'L', 'P']) return false unless attack_vector_validator.valid?(@attack_vector) availability_impact_validator = EnumAttributeValidator.new('Object', ['N', 'L', 'H']) return false unless availability_impact_validator.valid?(@availability_impact) confidentiality_impact_validator = EnumAttributeValidator.new('Object', ['N', 'L', 'H']) return false unless confidentiality_impact_validator.valid?(@confidentiality_impact) integrity_impact_validator = EnumAttributeValidator.new('Object', ['N', 'L', 'H']) return false unless integrity_impact_validator.valid?(@integrity_impact) privilege_required_validator = EnumAttributeValidator.new('Object', ['N', 'L', 'H']) return false unless privilege_required_validator.valid?(@privilege_required) scope_validator = EnumAttributeValidator.new('Object', ['U', 'C']) return false unless scope_validator.valid?(@scope) user_interaction_validator = EnumAttributeValidator.new('Object', ['N', 'R']) return false unless user_interaction_validator.valid?(@user_interaction) true end |