Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter 'groupAssign' is wrong in organization ip restrictions #686

Open
KHelden123 opened this issue Mar 21, 2023 · 2 comments
Open

Parameter 'groupAssign' is wrong in organization ip restrictions #686

KHelden123 opened this issue Mar 21, 2023 · 2 comments
Labels
bug This is a bug with the pyTenable library Tenable.sc Tenable.sc Package

Comments

@KHelden123
Copy link

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.

@aseemsavio aseemsavio added bug This is a bug with the pyTenable library Tenable.sc Tenable.sc Package labels Mar 23, 2023
@KHelden123
Copy link
Author

Are there any updates on when the error will be fixed?
An idea for a workaround to use pyTenable with this is also welcome. Thank you!

@SteveMcGrath
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug with the pyTenable library Tenable.sc Tenable.sc Package
Projects
None yet
Development

No branches or pull requests

3 participants