tenable / pyTenable

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

Bug with the parameter "last_modified" in the method "list" of tenable.io scans.py #810

Open megavexus opened 2 months ago

megavexus commented 2 months ago

Describe the bug Sin this change, a few weeks ago, the method "list" of "scans.py" of "Tenable IO" is not working with the parameter "last_modified". imagen

To Reproduce Steps to reproduce the behavior:

  1. Call the method "list" of scans.py of the library "io"
  2. Add a paramether with a datetime:
    list_scans = api.scans.list(
            last_modified=datetime.today()
    )
  3. See error:
    File "XXXX/site-packages/tenable/io/scans.py", line 1205, in list
    lm = int(time.mktime(last_modified).timetuple())
    AttributeError: 'float' object has no attribute 'timetuple'

Expected behavior A clear and concise description of what you expected to happen.

System Information (please complete the following information):

Additional context To fix it, you only have to replace the affected line with:

     lm = int(time.mktime(start_time.timetuple()))
SteveMcGrath commented 1 month ago

As you are already aware of the issue and the fix, do you want to file a PR to fix as well?