Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not return scan object. "This returns a Scan object" #284

Closed
orcuntagtekin opened this issue Aug 18, 2017 · 4 comments
Closed

Does not return scan object. "This returns a Scan object" #284

orcuntagtekin opened this issue Aug 18, 2017 · 4 comments

Comments

@orcuntagtekin
Copy link

When new scan started
scan = site.scan(nsc)

Expected Behavior

puts scan
should return a response

Current Behavior

However it waits until discovery scan finishes and returns site locked or
NexposeAPI: Action failed: Nexpose did not respond within 60 seconds. (Nexpose::APIError)

Possible Solution

Need to find out the cause so that scan status can be tracked

Steps to Reproduce (for bugs)

site = Nexpose::Site.load(nsc, siteId)
puts site
scan = site.scan(nsc)

or

scan = nsc.scan_site(siteId)

Context

We are implementing a integration and vulnerability reporting and this is vital.

Your Environment

Ruby Gem 6 and 5 produce the same result on a single tenant this issue did not happen on the multi tenant

  • Nexpose gem version:
  • Ruby version:
  • Operating System and version:
  • Nexpose product version:
@sgreen-r7
Copy link
Contributor

Hi @orcuntagtekin,
Thanks for reaching out, and help me understand what the issue is here.

In your example:

site = Nexpose::Site.load(nsc, siteId)
scan = site.scan(nsc)

Are you experiencing scan being nil? Or are you requesting an enhancement/change to where scan should return the API response of site.scan?

If scan === nil then I would agree, that's broken and should not be happening. If it's something else, then we can continue that discussion. I just want to make sure I'm on the same page, and I want to correctly address your concern.

Either way, thanks for submitting the issue and bringing your issue to light.
-scott

@orcuntagtekin
Copy link
Author

orcuntagtekin commented Aug 18, 2017

scan = site.scan(nsc) executes and scripts waits, the next thing is
NexposeAPI: Action failed: Nexpose did not respond within 60 seconds. (Nexpose::APIError)
on the console, engine is running the discovery and than the scan normally. However, I can not get the scan information through the API.

@sgreen-r7
Copy link
Contributor

@orcuntagtekin gotcha, that "makes sense". That happens from time to time depending on the scan parameters, and some other variables.

Once we fix this ticket, #269, this should stop happening, and would let you adjust the timeout. We have some internal code that we use as a workaround, which might help in the meantime. I can copy/paste it into the issue to show how we use it, and that might give you an idea of how we deal with the same issue.

But to be clear, there is technically nothing wrong with the behavior you reported. The Nexpose API did not response back within the default 60 seconds after issuing the site.scan(nsc) command; and the gem throws a Timeout error.

Let me know if you want to see our rescue behavior that we have in-place for our internally testing/automation. Also, I might just add a scan_with_safe_timeout method or something, which could implement what I'm referring to.

@sgreen-r7
Copy link
Contributor

Try upgrade to >7.0.0 and editing the timeout.
https://github.com/rapid7/nexpose-client/releases/tag/v7.0.0

Feel free to comment on this issue, or reopen a new one if this is still happening after upgrading and setting a custom timeout.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants