nexpose-client-python icon indicating copy to clipboard operation
nexpose-client-python copied to clipboard

SaveSiteConfiguration doesn't save excluded asset IPs

Open derpadoo opened this issue 8 years ago • 1 comments

SaveSiteConfiguration doesn't save excluded assets IPs.

Expected Behavior

Specified assets that should not be scanned should be saved.

Current Behavior

The excluded scan asset IPs are not included.

Possible Solution

Similar to the tags not being populated. Likely need to update nexpose_site.py

Steps to Reproduce (for bugs)

Python code that reproduces the issue:

    # Load configuration for a site based on site ID
    config = session.GetSiteConfiguration(site_id)

    new_ip_list = []
    for ip in ip_list:
        new_ip_list.append(nexpose.Range(ip, ''))

    # Assign new IPs to the hosts attribute.
    config.hosts = new_ip_list

    try:
        session.SaveSiteConfiguration(config)
        print("[+] Successfully saved IPs to site: {0} (Site ID: {1})".format(config.name, config.id))
    except Exception as e:
        print("[-] Error saving IPs to site: {0} (Site ID: {1})".format(config.name, config.id))
        print("EXCEPTION: {0}".format(e))

Context

Need to save all details of a site when updating it.

Your Environment

  • Nexpose-client-python version: nexpose==0.1.4
  • Python version: Python 2.7.13
  • Operating System and version: Ubuntu 14.04.5 LTS
  • Nexpose product version: 6.4.58

derpadoo avatar Oct 11 '17 17:10 derpadoo

Used the ruby gem to compare the info in a site before running the Python library and after.

site = Nexpose::Site.load(@nsc, 2)
pp site

derpadoo avatar Oct 11 '17 18:10 derpadoo