Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.
This repository was archived by the owner on May 14, 2021. It is now read-only.

Creating a new site fails with "NexposeFailureException: templateID must be specified." #6

Closed

Description

@santsys

Expected Behavior

A new site would be created.

Current Behavior

An error of "NexposeFailureException: templateID must be specified."

File "W:\Python27\lib\site-packages\nexpose\nexpose.py", line 1314, in SaveSiteConfiguration
    return self._ExecuteSave(self.RequestSiteSave, site_configuration, 'SiteSaveResponse', 'site-id') # TODO: if this turns out to be 'id' instead of 'site-id' than remove the paramet
er from the function
  File "W:\Python27\lib\site-packages\nexpose\nexpose.py", line 1143, in _ExecuteSave
    response = self.VerifySuccess(save_function(object_to_save.AsXML(exclude_id=False)))
  File "W:\Python27\lib\site-packages\nexpose\nexpose.py", line 1280, in VerifySuccess
    raise NexposeFailureException(message)
NexposeFailureException: templateID must be specified.

Steps to Reproduce (for bugs)

Attempt to create a new site using "SaveSiteConfiguration".

Python code that reproduces the issue:

site_name = "Test-Site-Nexpose-" + datetime.now().strftime("%Y%m%dT%H%M%z")
site_desc = "Test Site"

site_cfg = nexpose.SiteConfiguration.Create()
site_cfg.id = -1
site_cfg.name = site_name
site_cfg.description = site_desc
site_cfg.hosts.append(Host("192.168.0.100"))

session.SaveSiteConfiguration(site_cfg)

Context

Attempting to dynamically add hosts to a sites that can then be scanned.

Your Environment

  • Nexpose-client-python version: 0.1.0
  • Python version: 2.7.13
  • Nexpose product version: 6.4.45

Activity

  1. gschneider-r7 commented on Jul 12, 2017

    @gschneider-r7
    Contributor

    The Nexpose API requires a scan template ID to be specified in a SiteConfigSaveRequest so we should update the code here to default to full-audit-without-webspider to match what the Ruby gem does.

  2. santsys commented on Jul 12, 2017

    @santsys
    Author

    The templateId is set in the AsXML call, however it's after the XML is built (or so it appears).

    https://github.com/rapid7/nexpose-client-python/blob/master/nexpose/nexpose_site.py#L129

  3. gschneider-r7 commented on Jul 12, 2017

    @gschneider-r7
    Contributor

    Ah, yep I noticed this the other day when first looking into it.

  4. santsys commented on Jul 15, 2017

    @santsys
    Author

    @gschneider-r7 Is there any timeline for releasing bug fixes? Thanks!

  5. scottjpack commented on Jul 18, 2017

    @scottjpack
    Contributor

    @gschneider-r7 , I've made a PR that addresses this.

    #8

  6. gschneider-r7 commented on Jul 19, 2017

    @gschneider-r7
    Contributor

    Fix has been merged and a new version, 0.1.1, will be released shortly.

    Side note: please use Range(from, to) for IP addresses, even single addresses, instead of Host.

    e.g.

    site_cfg.hosts.append(Range("192.168.0.100", None))
  7. gschneider-r7 commented on Jul 20, 2017

    @gschneider-r7
    Contributor

    I should be able to release the new version tomorrow as I've run into issues with the pypi service today.

  8. gschneider-r7 commented on Jul 20, 2017

    @gschneider-r7
    Contributor

    Version 0.1.1 is now published on pypi (for pip install) and the packages are also available on the github release page: https://github.com/rapid7/nexpose-client-python/releases/tag/0.1.1

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions