Class: Nexpose::VulnerabilityListing
- Inherits:
-
Object
- Object
- Nexpose::VulnerabilityListing
- Defined in:
- lib/nexpose.rb
Overview
Description
Object that represents a listing of all of the vulnerabilities in the vulnerability database
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
The NSC Connection associated with this object.
-
#error ⇒ Object
readonly
true if an error condition exists; false otherwise.
-
#error_msg ⇒ Object
readonly
Error message string.
-
#request_xml ⇒ Object
readonly
The last XML request sent by this object.
-
#response_xml ⇒ Object
readonly
The last XML response received by this object.
-
#vulnerability_count ⇒ Object
readonly
The number of vulnerability definitions.
-
#vulnerability_summaries ⇒ Object
readonly
Array containing (VulnerabilitySummary*).
Instance Method Summary collapse
-
#initialize(connection) ⇒ VulnerabilityListing
constructor
Constructor VulnerabilityListing(connection).
Constructor Details
#initialize(connection) ⇒ VulnerabilityListing
Constructor VulnerabilityListing(connection)
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 |
# File 'lib/nexpose.rb', line 2066 def initialize(connection) @error = false @vulnerability_summaries = [] @connection = connection r = @connection.execute('<VulnerabilityListingRequest session-id="' + @connection.session_id + '"/>') if (r.success) r.res.elements.each('VulnerabilityListingResponse/VulnerabilitySummary') do |v| @vulnerability_summaries.push(VulnerabilitySummary.new(v.attributes['id'],v.attributes["title"],v.attributes["severity"])) end else @error = true @error_msg = 'VulnerabilitySummaryRequest Parse Error' end @vulnerability_count = @vulnerability_summaries.length end |
Instance Attribute Details
#connection ⇒ Object (readonly)
The NSC Connection associated with this object
2058 2059 2060 |
# File 'lib/nexpose.rb', line 2058 def connection @connection end |
#error ⇒ Object (readonly)
true if an error condition exists; false otherwise
2050 2051 2052 |
# File 'lib/nexpose.rb', line 2050 def error @error end |
#error_msg ⇒ Object (readonly)
Error message string
2052 2053 2054 |
# File 'lib/nexpose.rb', line 2052 def error_msg @error_msg end |
#request_xml ⇒ Object (readonly)
The last XML request sent by this object
2054 2055 2056 |
# File 'lib/nexpose.rb', line 2054 def request_xml @request_xml end |
#response_xml ⇒ Object (readonly)
The last XML response received by this object
2056 2057 2058 |
# File 'lib/nexpose.rb', line 2056 def response_xml @response_xml end |
#vulnerability_count ⇒ Object (readonly)
The number of vulnerability definitions
2062 2063 2064 |
# File 'lib/nexpose.rb', line 2062 def vulnerability_count @vulnerability_count end |
#vulnerability_summaries ⇒ Object (readonly)
Array containing (VulnerabilitySummary*)
2060 2061 2062 |
# File 'lib/nexpose.rb', line 2060 def vulnerability_summaries @vulnerability_summaries end |