tenable / pyTenable

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

Policy Preference Update Only Accept Strings Values #800

Closed Gabuardi closed 3 months ago

Gabuardi commented 3 months ago

Describe the bug As the sc.policy.edit method describe, I was trying to update preferences of a policy sending a dictionary with the updated values to update the netapp_api authentication. This field of preferences is a list field since it looks like this:

...
netapp_api: [
  {
    user: "xxxx"
    password: "xxxx"
    port: ###
    vfile: ""
  }
]
...

But seems pytenable always checks that this values are a pair of string key-values and not strings-list. So I'm receiving a type error:

TypeError: preference:netapp_api:value is of type list.  Expected str

To Reproduce Steps to reproduce the behavior:

  1. Call 'sc.policy.edit()'
  2. Do 'Try to update any value of authentication preferences (like netapp_api or similar with actual valid values)'
  3. See the error
  4. Expected behavior Update the authentication preferences of policy with no error

Screenshots image System Information (please complete the following information): image

specs Using Security Center Plus Version: 6.3.0

Gabuardi commented 3 months ago

Nevermind, it was fixed in new versions of PyTenable