-
Notifications
You must be signed in to change notification settings - Fork 103
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
Adhoc scan subset of assets within a site, with a different scan template and scan engine #195
Adhoc scan subset of assets within a site, with a different scan template and scan engine #195
Conversation
Naming could be |
I am getting the following error when using peach to allow for parallel processing:
Specifically, It's important to note the Rexml error does not occur until about 20 JIRA tickets in (pull data, kick off scan, evaluate results, update jira ticket, repeat). I have tried to limit the processing to only 10 concurrent threads
^ This block will repeat multiple times and I am not sure how this condition is being met. The scans start and finish ok. However, maybe the Let me know how I can help here or if you need more information. Not looking for help with the 3rd party plugin, just curious on the Rexml error as it relates to Nexpose and also the NexposeAPI error. |
Yes there is currently a locking behavior with sites, I believe original intent was to prevent accidental simultaneous scans. You could sleep for a bit and/or retry after sleep since the lock shouldn't be very long. Although increased load on the console may potentially result in locks holding longer while waiting for the scan to start. |
# @param [Fixnum] scan_engine The scan engine ID. | ||
# @return [Fixnum] Scan ID. | ||
# | ||
def scan_assets_with_template_and_engine(site_id, assets, scan_template, scan_engine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per your name comment, i think that looks mostly okay but if makes more sense maybe we can include like either site
or ad_hoc
?
so like scan_adhoc_with_template_and_engine
or scan_adhoc_site_with_template_and_engine
.
but i don't know how much that helps in the way of clarity.
As for the rexml error it seems that something caused a strange response when working with scan templates based on your output. Would have to inspect the actual output that rexml tried to parse or look at console logs to see what error might have been thrown. |
How can I get you the output? |
You can PM me on community, email me (attachment or link to gist paste or something), or if absolutely needed you can go through support to get it to me. |
Hi @gschneider-r7, I apologize for the delay in response. I haven't had the ability to work on this for a little while. It appears that the issue for RexML was related to Peach. I resolved it by using pmap. The #peach method was doing an iterative loop over and over again. The error occurred when attempting to transition an issue key already transitioned. At this point, I can launch over 30 concurrent scans at the same time and they all finish. I don't have any additional bugs to report. |
Hi @gschneider-r7, It looks like the bundle install adds rex -v 2.0.9. This is not currently compatible based on what I am seeing. I have verified that uninstalling rex 2.0.9 resolves the issue. If you have any other ideas, this is how I am requiring the version of Nexpose:
This is the error I see when running my code in script.rb:
|
If you're still using my branch or pre-built gem it is not up to date with the Rex changes on the official releases. The official 2.1.3 and 2.2.0 versions set Rex to 2.0.8 to prevent this issue. |
This behaves like the "Scan Now" dialog in the UI where you can select a subset of a site's defined assets, a scan template, and a scan engine to scan them with. These settings are not persisted to a site configuration and allows multiple simultaneous scans on a single site.
This makes it easier to identify mistakes when using the experimental adhoc scan method from this branch. Not tested against other UI endpoints used elsewhere in the gem.
This allows passing in an array with only 1 address in it and not having to worry about trailing commas.
e808f14
to
4b24437
Compare
ok. Thanks. |
I just rebased all of my branches so they should all require Rex 2.0.8 now. |
Adhoc scan subset of assets within a site, with a different scan template and scan engine
I still need feedback on the method name. I added an
and
to it to be more English-y, but it's super long and I'm not a huge fan of it right now.Changes include:
/data/
endpoints when they are plain textAdditional testing needed:
Blurb:
This behaves like the "Scan Now" dialog in the UI where you can select a subset of a site's defined assets, a scan template, and a scan engine to scan them with. These settings are not persisted to a site configuration and allows multiple simultaneous scans on a single site.
Example usage:
Resolves #188