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.



198
199
200
201
202
203
# File 'lib/nexpose/vuln.rb', line 198

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

Instance Attribute Details

#descriptionObject

The HTML Description of this vulnerability.



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

def description
  @description
end

#referencesObject

External References for this vulnerability. Array containing (Reference)



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

def references
  @references
end

#solutionObject

The HTML Solution for this vulnerability.



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

def solution
  @solution
end

Class Method Details

.parse(xml) ⇒ Object



205
206
207
208
209
210
211
212
213
# File 'lib/nexpose/vuln.rb', line 205

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