Class: Nexpose::Asset
Overview
Asset object as return from the 2.1 API.
Instance Attribute Summary collapse
-
#assessment ⇒ Object
readonly
Assessment summary of the asset, including most recent scan info.
-
#exploits ⇒ Object
readonly
Vulnerability exploits to which this asset is susceptible.
-
#files ⇒ Object
readonly
Files and directories that have been enumerated on the asset.
-
#group_accounts ⇒ Object
readonly
Group accounts enumerated on the asset.
-
#host_names ⇒ Object
readonly
Known host names found for the asset.
-
#host_type ⇒ Object
readonly
The host type of the asset.
-
#id ⇒ Object
readonly
Unique identifier of the asset on the Nexpose console.
-
#ip ⇒ Object
readonly
Primary IP address of the asset.
-
#mac ⇒ Object
readonly
MAC address of the asset.
-
#malware_kits ⇒ Object
readonly
Malware kits to which this asset is susceptible.
-
#os_cpe ⇒ Object
readonly
The CPE for the asset’s operating system.
-
#os_name ⇒ Object
readonly
Operating system name.
-
#services ⇒ Object
readonly
Service endpoints enumerated on the asset.
-
#software ⇒ Object
readonly
Software enumerated on the asset.
-
#user_accounts ⇒ Object
readonly
User accounts enumerated on the asset.
-
#vulnerabilities ⇒ Object
readonly
Vulnerabilities detected on the asset.
-
#vulnerability_instances ⇒ Object
readonly
Vulnerability instances detected on the asset.
Class Method Summary collapse
-
.load(nsc, id) ⇒ Asset
Load an asset from the provided console.
Instance Method Summary collapse
-
#initialize ⇒ Asset
constructor
A new instance of Asset.
Methods inherited from APIObject
Constructor Details
#initialize ⇒ Asset
Returns a new instance of Asset.
42 43 44 45 |
# File 'lib/nexpose/asset.rb', line 42 def initialize @addresses = [] @host_names = [] end |
Instance Attribute Details
#assessment ⇒ Object (readonly)
Assessment summary of the asset, including most recent scan info. [Lazy]
21 22 23 |
# File 'lib/nexpose/asset.rb', line 21 def assessment @assessment end |
#exploits ⇒ Object (readonly)
Vulnerability exploits to which this asset is susceptible. [Lazy]
31 32 33 |
# File 'lib/nexpose/asset.rb', line 31 def exploits @exploits end |
#files ⇒ Object (readonly)
Files and directories that have been enumerated on the asset. [Lazy]
40 41 42 |
# File 'lib/nexpose/asset.rb', line 40 def files @files end |
#group_accounts ⇒ Object (readonly)
Group accounts enumerated on the asset. [Lazy]
38 39 40 |
# File 'lib/nexpose/asset.rb', line 38 def group_accounts @group_accounts end |
#host_names ⇒ Object (readonly)
Known host names found for the asset.
12 13 14 |
# File 'lib/nexpose/asset.rb', line 12 def host_names @host_names end |
#host_type ⇒ Object (readonly)
The host type of the asset. One of: GUEST, HYPERVISOR, PHYSICAL, MOBILE.
18 19 20 |
# File 'lib/nexpose/asset.rb', line 18 def host_type @host_type end |
#id ⇒ Object (readonly)
Unique identifier of the asset on the Nexpose console.
6 7 8 |
# File 'lib/nexpose/asset.rb', line 6 def id @id end |
#ip ⇒ Object (readonly)
Primary IP address of the asset.
8 9 10 |
# File 'lib/nexpose/asset.rb', line 8 def ip @ip end |
#mac ⇒ Object (readonly)
MAC address of the asset.
10 11 12 |
# File 'lib/nexpose/asset.rb', line 10 def mac @mac end |
#malware_kits ⇒ Object (readonly)
Malware kits to which this asset is susceptible. [Lazy]
33 34 35 |
# File 'lib/nexpose/asset.rb', line 33 def malware_kits @malware_kits end |
#os_cpe ⇒ Object (readonly)
The CPE for the asset’s operating system.
16 17 18 |
# File 'lib/nexpose/asset.rb', line 16 def os_cpe @os_cpe end |
#os_name ⇒ Object (readonly)
Operating system name.
14 15 16 |
# File 'lib/nexpose/asset.rb', line 14 def os_name @os_name end |
#services ⇒ Object (readonly)
Service endpoints enumerated on the asset. [Lazy]
23 24 25 |
# File 'lib/nexpose/asset.rb', line 23 def services @services end |
#software ⇒ Object (readonly)
Software enumerated on the asset. [Lazy]
25 26 27 |
# File 'lib/nexpose/asset.rb', line 25 def software @software end |
#user_accounts ⇒ Object (readonly)
User accounts enumerated on the asset. [Lazy]
36 37 38 |
# File 'lib/nexpose/asset.rb', line 36 def user_accounts @user_accounts end |
#vulnerabilities ⇒ Object (readonly)
Vulnerabilities detected on the asset. [Lazy]
27 28 29 |
# File 'lib/nexpose/asset.rb', line 27 def vulnerabilities @vulnerabilities end |
#vulnerability_instances ⇒ Object (readonly)
Vulnerability instances detected on the asset. [Lazy]
29 30 31 |
# File 'lib/nexpose/asset.rb', line 29 def vulnerability_instances @vulnerability_instances end |
Class Method Details
.load(nsc, id) ⇒ Asset
Load an asset from the provided console.
53 54 55 56 57 58 |
# File 'lib/nexpose/asset.rb', line 53 def self.load(nsc, id) uri = "/api/2.1/assets/#{id}" resp = AJAX.get(nsc, uri, AJAX::CONTENT_TYPE::JSON) hash = JSON.parse(resp, symbolize_names: true) new.object_from_hash(nsc, hash) end |