tenable / pyTenable

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

cannot find tenable sc instance #471

Closed rennurb3000 closed 2 years ago

rennurb3000 commented 2 years ago

Describe the bug hi, i wanted to try the tenable sc rest client for our tenable sc server (which is hosted at some ip 123.123.123.123 (example format)) and on a different port 8** The server is running, since i can get all reports over the ui sc = TenableSC("123.123.123.123", port=8**, username="username", password="password",scheme="https") however i get GET https://123.123.123.123:8/rest/system >> None:404 {"error":"The requested file was not found."} No Tenable.sc Instance at 123.123.123.123:8 previously we used direct get requests like https://123.123.123.123:8/scans/scanid/export ... to optain the wanted data am i missing something?

To Reproduce Steps to reproduce the behavior:

  1. try example for tenable.sc servers
  2. login
  3. Error as described above

Expected behavior It would be possible to login

System Information (please complete the following information):

SteveMcGrath commented 2 years ago

any reason your not just letting it use the default port?

rennurb3000 commented 2 years ago

hi pickle rick ;) ! well the reason is, that i am not in the department, which are hosting it and they are not willing to change it. reasons can be :

also why should i not use a different port ? The docs say, that it will be deprecated in favour of a unified url parameter (so i guess something like urllib ??) however not that i cant use it greets t

SteveMcGrath commented 2 years ago

sorry I must have missed that you were running SC on a non-standard port. The updated format for 1.4.0 and later is to use the following syntax in your case:

from tenable.sc import TenableSC

sc = TenableSC(url='https://123.123.123.123:8443', access_key='', secret_key='')
rennurb3000 commented 2 years ago

Ok thanks!, but still no success -.- [404: POST] https://***.***.***.***:8***/rest/token body=b'{"error":"The requested file was not found."}' we are using nessus professional 10.0.0 (#283) WINDOWS sry i am not that deep into the subject, since i recently got the job to polish some older scripts where requests where directly used. so i thought it would be a great opportunity to use the official client. greetings, t

SteveMcGrath commented 2 years ago

Nessus != Tenable.sc. Currently there isn't a package for Nessus yet.

rennurb3000 commented 2 years ago

Ah ok sry, i got it explained like this (that those are tenable.sc instances) , thx