tenable / pyTenable

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

Can't get agent list by group #600

Closed midav7 closed 2 years ago

midav7 commented 2 years ago

Describe the bug I'm trying to get a specific group of agents with usage of filters. Before that I tried to use other filters like ('distro', 'match', 'win') and it works for me.

To Reproduce Steps to reproduce the behavior:

  1. I'm trying to get a list of agents by group id, I know that the group exists, I have checked it with my credentials on https://developer.tenable.com/reference/io-filters-agents-list . I also have checked the filter groups:eq:171128 on https://developer.tenable.com/reference/agents-list and it works for me, I'm getting what I expect.
    access_key = config['tenable_access']
    secret = config['tenable_secret']
    tio = TenableIO(access_key, secret)
    info = tio.agents.list(('groups', 'eq', '171128'))
  2. I'm getting the following error:

ERROR 2022-06-29 23:39:26,319 tenable.errors.UnexpectedValueError __init__ 28 : filter_value has value of 171128. Expected one of -1,209162,230835,276504,171128,243129,272959,272807,209161,243120,238401,231055,283642,171129,230973,231978,238399,171138,223584,242261,209160,208373 The id I specify is among the list, I'm wondering what might be the issue? I also tried to change id type to integer but it doesn't help, the filter requires it to be string.

Expected behavior I expect to get a list of agents by group id.

Screenshots

Screen Shot 2022-06-30 at 16 49 05 Screen Shot 2022-06-30 at 16 49 30

System Information: Name: pyTenable Version: 1.4.6

midav7 commented 2 years ago

it turned out old version was used on production