rapid7 / nexpose-client-python

DEPRECATED : Rapid7 Nexpose API client library written in Python
https://www.rapid7.com/
BSD 3-Clause "New" or "Revised" License
25 stars 20 forks source link

SaveSiteConfiguration doesn't preserve all schedule details #54

Open danbourke opened 6 years ago

danbourke commented 6 years ago

Expected Behavior

getting a SiteConfig object with GetSiteConfiguration(site), and then saving it with SaveSiteConfiguration(site) shouldn't change anything about the site's configuration.

Current Behavior

If you get a SiteConfig object with GetSiteConfiguration, then save it with SaveSiteConfiguration, without making any changes to the object, scan schedules will lose their:

Possible Solution

I'm not sure what populates the 'schedules' object on a SiteConfiguration object, but update it so it also fetches names + templates (and make sure SaveSiteConfiguration respects those)

Steps to Reproduce (for bugs)

  1. Create a scan schedule in a site, with a name and a non-default template.
  2. run the code below
  3. look at the scan schedule for your site, see name=n/a, template=default, targets=n/a

Python code that reproduces the issue:

site = client.GetSiteConfiguration(site_summary_object)
client.SaveSiteConfiguration(site)

Context

We're trying to automate some scheduling but we kept finding out schedule details wiped (we were using names to update schedules when required, and can't)

Your Environment

gschneider-r7 commented 6 years ago

Similar to #38 and #39. The problem is that this library is using the legacy XML APIs which don't really support the latest features very well, and they are difficult to update on the product side since they need to remain backwards-compatible. The original plan was to update this library to use the newer APIs that the Ruby gem uses, but with the release of API v3 which is self-documenting and includes a swagger file for generating clients this library has mostly become obsolete. You can find a generated Python client here: https://github.com/rapid7/vm-console-client-python

It is unlikely that any Rapid7 employees will be making further changes to this project given the above (also see comments in #51), but we'll merge pull requests and release new versions upon request.