Class: Nexpose::VulnerabilityDetail
- Inherits:
-
Object
- Object
- Nexpose::VulnerabilityDetail
- Defined in:
- lib/nexpose/vuln.rb
Overview
Description
Object that represents the details for an entry in the vulnerability database
Instance Attribute Summary collapse
-
#added ⇒ Object
readonly
The date this vulnerability was added to Nexpose.
-
#connection ⇒ Object
readonly
The NSC Connection associated with this object.
-
#cvssScore ⇒ Object
readonly
The CVSS score of this vulnerability.
-
#cvssVector ⇒ Object
readonly
The CVSS vector of this vulnerability.
-
#description ⇒ Object
readonly
The HTML Description of this vulnerability.
-
#error ⇒ Object
readonly
true if an error condition exists; false otherwise.
-
#error_msg ⇒ Object
readonly
Error message string.
-
#id ⇒ Object
readonly
The unique ID string for this vulnerability.
-
#modified ⇒ Object
readonly
The last date this vulnerability was modified.
-
#pciSeverity ⇒ Object
readonly
The pciSeverity of this vulnerability.
-
#published ⇒ Object
readonly
The date this vulnerability was published.
-
#references ⇒ Object
readonly
External References for this vulnerability Array containing (Reference).
-
#severity ⇒ Object
readonly
The severity of this vulnerability (1 – 10).
-
#solution ⇒ Object
readonly
The HTML Solution for this vulnerability.
-
#title ⇒ Object
readonly
The title of this vulnerability.
Instance Method Summary collapse
-
#initialize(connection, id) ⇒ VulnerabilityDetail
constructor
Constructor VulnerabilityListing(connection,id).
Constructor Details
#initialize(connection, id) ⇒ VulnerabilityDetail
Constructor VulnerabilityListing(connection,id)
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/nexpose/vuln.rb', line 429 def initialize(connection, id) @error = false @connection = connection @id = id @references = [] r = @connection.execute('<VulnerabilityDetailsRequest session-id="' + @connection.session_id + '" vuln-id="' + @id + '"/>') if r.success r.res.elements.each('VulnerabilityDetailsResponse/Vulnerability') do |v| @id = v.attributes['id'] @title = v.attributes["title"] @severity = v.attributes["severity"] @pciSeverity = v.attributes['pciSeverity'] @cvssScore = v.attributes['cvssScore'] @cvssVector = v.attributes['cvssVector'] @published = v.attributes['published'] @added = v.attributes['added'] @modified = v.attributes['modified'] v.elements.each('description') do |desc| @description = desc.to_s.gsub(/\<\/?description\>/i, '') end v.elements.each('solution') do |sol| @solution = sol.to_s.gsub(/\<\/?solution\>/i, '') end v.elements.each('references/reference') do |ref| @references.push(Reference.new(ref.attributes['source'], ref.text)) end end else @error = true @error_msg = 'VulnerabilitySummary Parse Error' end end |
Instance Attribute Details
#added ⇒ Object (readonly)
The date this vulnerability was added to Nexpose
416 417 418 |
# File 'lib/nexpose/vuln.rb', line 416 def added @added end |
#connection ⇒ Object (readonly)
The NSC Connection associated with this object
400 401 402 |
# File 'lib/nexpose/vuln.rb', line 400 def connection @connection end |
#cvssScore ⇒ Object (readonly)
The CVSS score of this vulnerability
410 411 412 |
# File 'lib/nexpose/vuln.rb', line 410 def cvssScore @cvssScore end |
#cvssVector ⇒ Object (readonly)
The CVSS vector of this vulnerability
412 413 414 |
# File 'lib/nexpose/vuln.rb', line 412 def cvssVector @cvssVector end |
#description ⇒ Object (readonly)
The HTML Description of this vulnerability
420 421 422 |
# File 'lib/nexpose/vuln.rb', line 420 def description @description end |
#error ⇒ Object (readonly)
true if an error condition exists; false otherwise
396 397 398 |
# File 'lib/nexpose/vuln.rb', line 396 def error @error end |
#error_msg ⇒ Object (readonly)
Error message string
398 399 400 |
# File 'lib/nexpose/vuln.rb', line 398 def error_msg @error_msg end |
#id ⇒ Object (readonly)
The unique ID string for this vulnerability
402 403 404 |
# File 'lib/nexpose/vuln.rb', line 402 def id @id end |
#modified ⇒ Object (readonly)
The last date this vulnerability was modified
418 419 420 |
# File 'lib/nexpose/vuln.rb', line 418 def modified @modified end |
#pciSeverity ⇒ Object (readonly)
The pciSeverity of this vulnerability
408 409 410 |
# File 'lib/nexpose/vuln.rb', line 408 def pciSeverity @pciSeverity end |
#published ⇒ Object (readonly)
The date this vulnerability was published
414 415 416 |
# File 'lib/nexpose/vuln.rb', line 414 def published @published end |
#references ⇒ Object (readonly)
External References for this vulnerability Array containing (Reference)
423 424 425 |
# File 'lib/nexpose/vuln.rb', line 423 def references @references end |
#severity ⇒ Object (readonly)
The severity of this vulnerability (1 – 10)
406 407 408 |
# File 'lib/nexpose/vuln.rb', line 406 def severity @severity end |
#solution ⇒ Object (readonly)
The HTML Solution for this vulnerability
425 426 427 |
# File 'lib/nexpose/vuln.rb', line 425 def solution @solution end |
#title ⇒ Object (readonly)
The title of this vulnerability
404 405 406 |
# File 'lib/nexpose/vuln.rb', line 404 def title @title end |