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

export.vulns default timeout /give up #715

Open
cvjbrooks opened this issue Jul 24, 2023 · 1 comment
Open

export.vulns default timeout /give up #715

cvjbrooks opened this issue Jul 24, 2023 · 1 comment
Labels
enhancement New features/functionality Tenable.io Tenable.io Package

Comments

@cvjbrooks
Copy link

Describe the bug
export.vulns does not seem to have a reasonable timeout. Please note the timestamps between the first logging statements from pyTenable. I called all_vulns = list(tio.exports.vulns(last_found=cut_off,severity=["low","medium","high","critical"])) at 2023-07-21 21:34:32,301.301 . It took a couple days for the export vulns code to finally give up and for the script to exit uncleanly, alerting me that a restart is required. I assume this was caused by a Tenable outage over the weekend.

If i understand the docs correctly, a timeout passed when calling the export vulns method would be ignored once the export starts?

logs from pyTenable

2023-07-22 01:31:17,618.618 ERROR session - _req: Requests Library Error: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2023-07-23 19:12:07,363.363 ERROR session - _req: Requests Library Error: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2023-07-24 00:51:16,162.162 ERROR session - _req: Requests Library Error: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
2023-07-24 01:51:09,788.788 ERROR errors - __init__: [502: GET] https://cloud.tenable.com/vulns/export/b45c8cc8-1426-4470-aa4a-b70af67a4cae/status body=b'{"statusCode":502,"error":"Bad Gateway","message":"Please wait a moment and try your request again."}'
2023-07-24 01:51:10,936.936 ERROR errors - __init__: [502: GET] https://cloud.tenable.com/vulns/export/b45c8cc8-1426-4470-aa4a-b70af67a4cae/status body=b'{"statusCode":502,"error":"Bad Gateway","message":"Please wait a moment and try your request again."}'
2023-07-24 01:51:13,028.028 ERROR errors - __init__: [503: GET] https://cloud.tenable.com/vulns/export/b45c8cc8-1426-4470-aa4a-b70af67a4cae/status body=b'{"statusCode":503,"error":"Service Unavailable","message":"Please wait a moment and try your request again."}'
2023-07-24 01:51:16,129.129 ERROR errors - __init__: [503: GET] https://cloud.tenable.com/vulns/export/b45c8cc8-1426-4470-aa4a-b70af67a4cae/status body=b'{"statusCode":503,"error":"Service Unavailable","message":"Please wait a moment and try your request again."}'
2023-07-24 01:51:20,218.218 ERROR errors - __init__: [503: GET] https://cloud.tenable.com/vulns/export/b45c8cc8-1426-4470-aa4a-b70af67a4cae/status body=b'{"statusCode":503,"error":"Service Unavailable","message":"Please wait a moment and try your request again."}'
2023-07-24 01:51:25,553.553 ERROR errors - __init__: [503: GET] https://cloud.tenable.com/vulns/export/b45c8cc8-1426-4470-aa4a-b70af67a4cae/status body=b'{"statusCode":503,"error":"Service Unavailable","message":"Please wait a moment and try your request again."}'

To Reproduce
Steps to reproduce the behavior:
I can't provide steps, I believe a Tenable outage is required to reproduce.

Expected behavior
I would expect the export vulns method to timeout or raise an error sooner.

  • Version [e.g. 1.4.12]
  • Memory [e.g. 16G]
@aseemsavio aseemsavio added enhancement New features/functionality Tenable.io Tenable.io Package labels Jul 25, 2023
@aseemsavio
Copy link
Collaborator

Yes, when using the timeout property, the value will be ignored when the export job has started processing. This means that if the export takes longer than expected, the timeout won't interrupt the pyTenable process.

It's worth considering that making the timeout field un-ignorable might not be a good idea in some cases. There are situations where exports might take longer than usual (but completes regardless) due to various factors. In such scenarios, enforcing a strict timeout could lead to premature termination of the pyTenable process, preventing the user from downloading the contents of the export when it becomes available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features/functionality Tenable.io Tenable.io Package
Projects
None yet
Development

No branches or pull requests

2 participants