Closed gig3r closed 3 years ago
based on the API documentation, seems like if you are an administrator
the /asset/{id} API requires an org_id query param that is not supported in PyTenable.
https://docs.tenable.com/tenablesc/api/Asset.htm
Parameters must be passed in as query string (as opposed to JSON) in the format of: /asset/{id}?orgID={orgID}
@mvalliammal - can you please add this to our backlog to fix?
@gig3r,
Please verify
@mvalliammal Hi! Great, now the script is working, thanks!
This is breaking my code now. Shouldn't orgID be an optional parameter given that it is optional if not being accessed as an administrator?
Describe the bug Hi. I have an error when i try use sc.access_lists.details()
To Reproduce
Print result: {'id': '39', 'name': 'Test', 'description': '', 'type': 'dynamic', 'status': '0'}
Print result: GET https://ip_address/rest/asset/39 >> None:403 {"type":"regular","response":"","error_code":15,"error_msg":"Valid orgID is required.\n","warnings":[],"timestamp":1617952970}
Traceback (most recent call last): File "C:/Users/admin/PycharmProjects/Lesson/Tenable/SC_test.py", line 57, in
asset_list_detail = sc.asset_lists.details(39)
File "C:\Program Files\Python38\lib\site-packages\tenable\sc\asset_lists.py", line 464, in details
return self._api.get('asset/{}'.format(self._check('id', id, int)),
File "C:\Program Files\Python38\lib\site-packages\tenable\base\v1.py", line 574, in get
return self._request('GET', path, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\tenable\base\v1.py", line 545, in _request
raise self._error_codesstatus
tenable.errors.APIError: None:403 {"type":"regular","response":"","error_code":15,"error_msg":"Valid orgID is required.\n","warnings":[],"timestamp":1617952970}
System Information (please complete the following information):
Additional context I want to download the asset details, for, example list of ips. In general i want to update the asset by new ips. maybe i do something wrong, could you help me?