Class: Nexpose::AssetScan
- Inherits:
-
Object
- Object
- Nexpose::AssetScan
- Defined in:
- lib/nexpose/device.rb
Overview
Summary object of a scan for a particular asset.
Instance Attribute Summary collapse
-
#asset_id ⇒ Object
readonly
Unique identifier of an asset.
-
#end_time ⇒ Object
readonly
Time when the asset finished scanning.
-
#engine_name ⇒ Object
readonly
Name of the scan engine used for the scan.
-
#host_name ⇒ Object
readonly
Host name of the asset, if discovered.
-
#ip ⇒ Object
readonly
IP address of the asset.
-
#os ⇒ Object
readonly
Operating system fingerprint of the asset.
-
#scan_id ⇒ Object
readonly
Unique identifier for the scan.
-
#site_id ⇒ Object
readonly
Unique identifier for the site where the scan originated.
-
#site_name ⇒ Object
readonly
Site name where the scan originated.
-
#vulns ⇒ Object
readonly
Number of vulnerabilities discovered on the asset.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(&block) ⇒ AssetScan
constructor
Internal constructor to be called by #parse_json.
Constructor Details
#initialize(&block) ⇒ AssetScan
Internal constructor to be called by #parse_json.
266 267 268 |
# File 'lib/nexpose/device.rb', line 266 def initialize(&block) instance_eval(&block) if block_given? end |
Instance Attribute Details
#asset_id ⇒ Object (readonly)
Unique identifier of an asset.
245 246 247 |
# File 'lib/nexpose/device.rb', line 245 def asset_id @asset_id end |
#end_time ⇒ Object (readonly)
Time when the asset finished scanning.
257 258 259 |
# File 'lib/nexpose/device.rb', line 257 def end_time @end_time end |
#engine_name ⇒ Object (readonly)
Name of the scan engine used for the scan.
263 264 265 |
# File 'lib/nexpose/device.rb', line 263 def engine_name @engine_name end |
#host_name ⇒ Object (readonly)
Host name of the asset, if discovered.
249 250 251 |
# File 'lib/nexpose/device.rb', line 249 def host_name @host_name end |
#ip ⇒ Object (readonly)
IP address of the asset.
247 248 249 |
# File 'lib/nexpose/device.rb', line 247 def ip @ip end |
#os ⇒ Object (readonly)
Operating system fingerprint of the asset.
261 262 263 |
# File 'lib/nexpose/device.rb', line 261 def os @os end |
#scan_id ⇒ Object (readonly)
Unique identifier for the scan.
255 256 257 |
# File 'lib/nexpose/device.rb', line 255 def scan_id @scan_id end |
#site_id ⇒ Object (readonly)
Unique identifier for the site where the scan originated.
253 254 255 |
# File 'lib/nexpose/device.rb', line 253 def site_id @site_id end |
#site_name ⇒ Object (readonly)
Site name where the scan originated.
251 252 253 |
# File 'lib/nexpose/device.rb', line 251 def site_name @site_name end |
#vulns ⇒ Object (readonly)
Number of vulnerabilities discovered on the asset.
259 260 261 |
# File 'lib/nexpose/device.rb', line 259 def vulns @vulns end |
Class Method Details
.parse_json(json) ⇒ Object
270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/nexpose/device.rb', line 270 def self.parse_json(json) new do @asset_id = json['assetID'].to_i @scan_id = json['scanID'].to_i @site_id = json['siteID'].to_i @ip = json['ipAddress'] @host_name = json['hostname'] @os = json['operatingSystem'] @vulns = json['vulnCount'] @end_time = Time.at(json['completed'].to_i / 1000) @site_name = json['siteName'] @engine_name = json['scanEngineName'] end end |