Class: Nexpose::ScanStatistics

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

Overview

TODO

Description

Object that represents the overview statistics for a particular scan.

Examples

# Create a new Nexpose Connection on the default port and Login
nsc = Connection.new("10.1.40.10","nxadmin","password")
nsc.()

# Get a Site (Site ID = 12) from the NSC
site = new Site(nsc,12)

# Start a Scan of this site and pause for 1 minute
scan1 = site.scanSite()
sleep(60)

# Get the Scan Statistics for this scan
scanStatistics = new ScanStatistics(nsc,scan1["scan_id"])

# Print out number of confirmed vulnerabilities with a 10 severity
puts scanStatistics.scansummary.vuln_exploit[10]

# Print out the number of pending tasks left in the scan
puts scanStatistics.scan_summary.tasks_pending

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, scan_id) ⇒ ScanStatistics

Returns a new instance of ScanStatistics.



219
220
221
222
223
# File 'lib/nexpose/scan.rb', line 219

def initialize(connection, scan_id)
  @error = false
  @connection = connection
  @scan_id = scan_id
end

Instance Attribute Details

#connectionObject (readonly)

The NSC Connection associated with this object



214
215
216
# File 'lib/nexpose/scan.rb', line 214

def connection
  @connection
end

#errorObject (readonly)

true if an error condition exists; false otherwise



202
203
204
# File 'lib/nexpose/scan.rb', line 202

def error
  @error
end

#error_msgObject (readonly)

Error message string



204
205
206
# File 'lib/nexpose/scan.rb', line 204

def error_msg
  @error_msg
end

#request_xmlObject (readonly)

The last XML request sent by this object



206
207
208
# File 'lib/nexpose/scan.rb', line 206

def request_xml
  @request_xml
end

#reseponse_xmlObject (readonly)

The last XML response received by this object



208
209
210
# File 'lib/nexpose/scan.rb', line 208

def reseponse_xml
  @reseponse_xml
end

#scan_idObject (readonly)

The Scan ID



210
211
212
# File 'lib/nexpose/scan.rb', line 210

def scan_id
  @scan_id
end

#scan_summaryObject (readonly)

The ScanSummary of the scan



212
213
214
# File 'lib/nexpose/scan.rb', line 212

def scan_summary
  @scan_summary
end

#vuln_otherObject (readonly)

Vulnerability checks other



217
218
219
# File 'lib/nexpose/scan.rb', line 217

def vuln_other
  @vuln_other
end