Class: Nexpose::XML::VulnerabilityDetail

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

Overview

Details for a vulnerability.

Instance Attribute Summary collapse

Attributes inherited from VulnerabilitySummary

#added, #credentials, #cvss_score, #cvss_vector, #modified, #pci_severity, #published, #safe

Attributes inherited from Vulnerability

#id, #severity, #title

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from VulnerabilitySummary

parse_attributes

Constructor Details

#initialize(id, title, severity) ⇒ VulnerabilityDetail

Returns a new instance of VulnerabilityDetail.



196
197
198
199
# File 'lib/nexpose/vuln.rb', line 196

def initialize(id, title, severity)
  @id, @title, @severity = id, title, severity
  @references = []
end

Instance Attribute Details

#descriptionObject

The HTML Description of this vulnerability.



189
190
191
# File 'lib/nexpose/vuln.rb', line 189

def description
  @description
end

#referencesObject

External References for this vulnerability. Array containing (Reference)



192
193
194
# File 'lib/nexpose/vuln.rb', line 192

def references
  @references
end

#solutionObject

The HTML Solution for this vulnerability.



194
195
196
# File 'lib/nexpose/vuln.rb', line 194

def solution
  @solution
end

Class Method Details

.parse(xml) ⇒ Object



201
202
203
204
205
206
207
208
209
210
211
# File 'lib/nexpose/vuln.rb', line 201

def self.parse(xml)
  vuln = parse_attributes(xml)

  vuln.description = REXML::XPath.first(xml, 'description').text
  vuln.solution = REXML::XPath.first(xml, 'solution').text

  xml.elements.each('references/reference') do |ref|
    vuln.references << Reference.new(ref.attributes['source'], ref.text)
  end
  vuln
end