tenable / pyTenable

Python Library for interfacing into Tenable's platform APIs
https://pytenable.readthedocs.io
MIT License
356 stars 175 forks source link

Error in Scans API #50

Closed InsanesTheName closed 5 years ago

InsanesTheName commented 6 years ago

Describe the bug Calling sc.scans.create() with a specified target(s) fails due to an apparent typo.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/tenable/sc/scans.py", line 301, in create
    scan = self._constructor(**kw)
  File "/usr/local/lib/python3.5/dist-packages/tenable/sc/scans.py", line 112, in _constructor
    del(kw['trargets'])
KeyError: 'trargets'

To Reproduce Steps to reproduce the behavior:

  1. Create a TenableSC object and authenticate with login()
  2. Call create()
    • e.g. sc.scans.create(name="myName", repo=1, targets=[target_ip])
  3. See error

Expected behavior The scan is created successfully.

System Information (please complete the following information):

SteveMcGrath commented 6 years ago

Thanks for this. I have tested any of the api classes for SC outside of analysis yet, so i fully expect some of these to crop up.

InsanesTheName commented 5 years ago

Thank you!