You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using sc.organizations.edit to save restricted_ips, the parameter groupAssign seems to be applied incorrectly.
To Reproduce
from tenable.sc import TenableSC
sc = TenableSC(url='https://...', access_key='...', secret_key='...')
# Get all restrictions
ips = sc.organizations.details(1, fields=['restrictedIPs'])['restrictedIPs']
# Add new ip
ips += f',1.2.3.4'
# Save new restrictions
sc.organizations.edit(1, restricted_ips=[ips])
Error
restfly.errors.APIError: [403: PATCH] https://.../rest/organization/1 body=b'{"type":"regular","response":"","error_code":146,"error_msg":"The parameter 'groupAssign' must be empty or must be 'all' or 'fullAccess'.\n","warnings":[],"timestamp":1679408789}\n'
Expected behavior
restricted_ips is saved correctly. The parameter is either set by default or is customizable via PyTenable.
System Information (please complete the following information):
OS: Gentoo Linux (with python 3.10.9)
Architecture: 64bit
Version: rolling release
Memory: 32GB
Additional context
It is suspected that the problem only occurred with tenable.sc 6.0.0. Unfortunately, a test with an older version is not possible.
The text was updated successfully, but these errors were encountered:
the current workaround it to simply pass the groupAssign attribute as the error indicates. This parameter was added to later versions of the SC API. To transparently pass it, you will need to pull this additional parameter from the details page as well and pass it back into the API via the edit param.
This isn't a pytenable issue, but rather a bug in the SC API itself thats requiring that attribute be passed back.
Describe the bug
When using sc.organizations.edit to save restricted_ips, the parameter groupAssign seems to be applied incorrectly.
To Reproduce
Error
Expected behavior
restricted_ips is saved correctly. The parameter is either set by default or is customizable via PyTenable.
System Information (please complete the following information):
Additional context
It is suspected that the problem only occurred with tenable.sc 6.0.0. Unfortunately, a test with an older version is not possible.
The text was updated successfully, but these errors were encountered: