tenable / pyTenable

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

[Tenable.sc] Defining multiple tuples in "filter" for sc.plugins.list #718

Open stiong-p opened 1 year ago

stiong-p commented 1 year ago

Hi Team,

I am looking to list out plugins within a specified time range, based on plugin modified date. Single filter works fine.

plugins = sc.plugins.list(
        fields=['id','name','pluginModDate'],
        filter=('pluginModDate','gte','1692399599'))
for plugin in plugins:
        print(plugin)

However, it spits out all the plugins with the following: filter=(('pluginModDate','gte','1692399599')and('pluginModDate','lte','1692489599'))

1692399599 = Friday, August 18, 2023 10:59:59 PM GMT 1692489599 = Saturday, August 19, 2023 11:59:59 PM GMT

What am I missing? Please kindly advise.

If multiple conditions for the same filter parameter cannot be made, are there other workarounds?

Thank you.

aseemsavio commented 1 year ago

The API seems to support multiple filters and pyTenable doesn't. Adding this as an enhancement to do to pyTenable.