Skip to content

Connection object scan_devices method failure on Global assets #318

Description

@tmsteen

Expected Behavior

# Get device object from IP address
device = [@nsc.find_device_by_address('1.2.3.4')]
=> #<Nexpose::Device:0x000055a4a0a9c2a8 @id=103179, @address="1.2.3.4", @site_id=123, @risk_factor=1.0, @risk_score=125.19699>
# Use scan_devices method to perform ad hoc scan of asset
@nsc.scan_devices(device)
# returns scan ID and scan is started

Current Behavior

Scan does not start, API Error is returned.

Nexpose::APIError: NexposeAPI: Action failed: The requested scan cannot be run at this time. No assets were selected to be scanned, verify site configuration includes the given assets.
	from /var/lib/gems/2.3.0/gems/nexpose-7.2.0/lib/nexpose/api_request.rb:148:in `execute'
	from /var/lib/gems/2.3.0/gems/nexpose-7.2.0/lib/nexpose/connection.rb:124:in `execute'
	from /var/lib/gems/2.3.0/gems/nexpose-7.2.0/lib/nexpose/scan.rb:252:in `_scan_ad_hoc'
	from /var/lib/gems/2.3.0/gems/nexpose-7.2.0/lib/nexpose/scan.rb:45:in `scan_devices'
	from (irb):9
	from /usr/bin/irb:11:in `<main>'

This did work previously for Global assets (I am pretty sure). Not sure if this is due to an update in the gem. Previously installed version was 5.3.0. I just downgraded back to that version and still did not work.

Possible Solution

The asset is a "Global" asset in multiple sites. Suspicion is that something changed here in how Global assets are treated.

Steps to Reproduce (for bugs)

See above.

Context

This is used in a Slack Bot that users can message to kick off ad hoc scans for a set of IPs. Not being able to do this for "Global" assets severely limits the utility of this tool.

Your Environment

  • Nexpose gem version: 7.2.0 (tried with 5.3.0)
  • Ruby version: 2.3.0
  • Operating System and version: Linux linop 4.14.0-kali3-amd64 No Method geturl in nexpose.rb:2536 #1 SMP Debian 4.14.12-2kali2 (2018-01-11) x86_64 GNU/Linux
  • Nexpose product version: 6.5.5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions