Class: Qualys::Vulnerability

Inherits:
Object
  • Object
show all
Defined in:
lib/qualys/vulnerability.rb

Overview

Qualys vulnerabilities from a report xml

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vuln, glossary) ⇒ Vulnerability

Returns a new instance of Vulnerability.



12
13
14
15
16
17
18
19
20
21
# File 'lib/qualys/vulnerability.rb', line 12

def initialize(vuln, glossary)
  parse_vuln vuln

  match_details glossary

  parse_cve if @details['CVE_ID_LIST']
  parse_details
  # gives the url to the qualys knowledge base for this vulnerabitlty
  parse_url
end

Instance Attribute Details

#categoryObject

Returns the value of attribute category.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def category
  @category
end

#correlationObject

Returns the value of attribute correlation.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def correlation
  @correlation
end

#cve_code_listObject

Returns the value of attribute cve_code_list.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def cve_code_list
  @cve_code_list
end

#detailsObject

Returns the value of attribute details.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def details
  @details
end

#first_foundObject

Returns the value of attribute first_found.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def first_found
  @first_found
end

#impactObject

Returns the value of attribute impact.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def impact
  @impact
end

#last_foundObject

Returns the value of attribute last_found.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def last_found
  @last_found
end

#last_updateObject

Returns the value of attribute last_update.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def last_update
  @last_update
end

#pci_flagObject

Returns the value of attribute pci_flag.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def pci_flag
  @pci_flag
end

#portObject

Returns the value of attribute port.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def port
  @port
end

#protocolObject

Returns the value of attribute protocol.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def protocol
  @protocol
end

#qidObject

Returns the value of attribute qid.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def qid
  @qid
end

#resultObject

Returns the value of attribute result.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def result
  @result
end

#serviceObject

Returns the value of attribute service.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def service
  @service
end

#severityObject

Returns the value of attribute severity.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def severity
  @severity
end

#solutionObject

Returns the value of attribute solution.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def solution
  @solution
end

#sslObject

Returns the value of attribute ssl.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def ssl
  @ssl
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def status
  @status
end

#threatObject

Returns the value of attribute threat.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def threat
  @threat
end

#times_foundObject

Returns the value of attribute times_found.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def times_found
  @times_found
end

#titleObject

Returns the value of attribute title.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def title
  @title
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def type
  @type
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def url
  @url
end

#vendor_reference_listObject

Returns the value of attribute vendor_reference_list.



6
7
8
# File 'lib/qualys/vulnerability.rb', line 6

def vendor_reference_list
  @vendor_reference_list
end

Instance Method Details

#to_sObject



23
24
25
# File 'lib/qualys/vulnerability.rb', line 23

def to_s
  "#{qid}, #{title}, severity : #{severity}, cves: #{cve_code_list&.join(', ') || 'no cve'}"
end