Class: Nexpose::VulnerabilityDetail

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose/vuln.rb

Overview

Description

Object that represents the details for an entry in the vulnerability database

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addedObject (readonly)

The date this vulnerability was added to Nexpose



416
417
418
# File 'lib/nexpose/vuln.rb', line 416

def added
  @added
end

#connectionObject (readonly)

The NSC Connection associated with this object



400
401
402
# File 'lib/nexpose/vuln.rb', line 400

def connection
  @connection
end

#cvssScoreObject (readonly)

The CVSS score of this vulnerability



410
411
412
# File 'lib/nexpose/vuln.rb', line 410

def cvssScore
  @cvssScore
end

#cvssVectorObject (readonly)

The CVSS vector of this vulnerability



412
413
414
# File 'lib/nexpose/vuln.rb', line 412

def cvssVector
  @cvssVector
end

#descriptionObject (readonly)

The HTML Description of this vulnerability



420
421
422
# File 'lib/nexpose/vuln.rb', line 420

def description
  @description
end

#errorObject (readonly)

true if an error condition exists; false otherwise



396
397
398
# File 'lib/nexpose/vuln.rb', line 396

def error
  @error
end

#error_msgObject (readonly)

Error message string



398
399
400
# File 'lib/nexpose/vuln.rb', line 398

def error_msg
  @error_msg
end

#idObject (readonly)

The unique ID string for this vulnerability



402
403
404
# File 'lib/nexpose/vuln.rb', line 402

def id
  @id
end

#modifiedObject (readonly)

The last date this vulnerability was modified



418
419
420
# File 'lib/nexpose/vuln.rb', line 418

def modified
  @modified
end

#pciSeverityObject (readonly)

The pciSeverity of this vulnerability



408
409
410
# File 'lib/nexpose/vuln.rb', line 408

def pciSeverity
  @pciSeverity
end

#publishedObject (readonly)

The date this vulnerability was published



414
415
416
# File 'lib/nexpose/vuln.rb', line 414

def published
  @published
end

#referencesObject (readonly)

External References for this vulnerability Array containing (Reference)



423
424
425
# File 'lib/nexpose/vuln.rb', line 423

def references
  @references
end

#severityObject (readonly)

The severity of this vulnerability (1 – 10)



406
407
408
# File 'lib/nexpose/vuln.rb', line 406

def severity
  @severity
end

#solutionObject (readonly)

The HTML Solution for this vulnerability



425
426
427
# File 'lib/nexpose/vuln.rb', line 425

def solution
  @solution
end

#titleObject (readonly)

The title of this vulnerability



404
405
406
# File 'lib/nexpose/vuln.rb', line 404

def title
  @title
end