class Nexpose::External::Asset
Object for importing assets from external sources into a Nexpose
console. This exists primarily as a convenience for marshalling the data into the proper JSON format.
In order to successfully import an asset, it must contain at least one scannable identifier: IP address, fully qualified domain name, or NetBIOS name. This ensures that once an asset is imported to the console, it can be scanned.
Besides a scannable identifier, all other fields are optional.
Attributes
A list of alternate identifiers of the asset. This can include additional IP addresses and host names.
A list of key-value attributes associated with the asset.
Files and directories on the asset.
A fully qualified domain name of the asset.
A list of group accounts on the asset.
The host type of the asset. One of: GUEST, HYPERVISOR, PHYSICAL, MOBILE.
IPv4 or IPv6 that is the primary identifier of the asset.
The MAC address of the asset.
A NetBIOS name of the asset.
The CPE for the operating system on the asset.
The date the asset was scanned. If left blank, the current time will be used by the console. Use the ISO 8601 basic date-time format. For example: 20141211T100614.526Z
A list of service endpoints on the asset.
A list of CPEs identifying software installed on the asset.
Unique system identifiers on the asset.
A list of user accounts on the asset.
Asset-level vulnerabilities.
Public Class Methods
# File lib/nexpose/external.rb, line 89 def initialize @aliases = [] @software = [] @services = [] @attributes = [] @users = [] @groups = [] @files = [] @unique_identifiers = [] @vulnerabilities = [] end
Public Instance Methods
# File lib/nexpose/external.rb, line 105 def to_h { ip: ip, fqdn: fqdn, net_bios: net_bios, mac: mac, host_type: host_type, aliases: aliases, scan_date: scan_date, os: os, software: software, services: services.map(&:to_h), users: users.map(&:to_h), groups: groups.map(&:to_h), files: files.map(&:to_h), unique_identifiers: unique_identifiers.map(&:to_h), vulnerabilities: vulnerabilities.map(&:to_h), attributes: Attributes.to_hash(attributes) } end
# File lib/nexpose/external.rb, line 101 def to_json JSON.generate(to_h) end