may this question is answerd fast from you, but i am new to Python and having some struggle.
i want to call a function or a class in python.
i have the following example from here: https://www.tenable.com/blog/tips-on-using-the-tenable-python-sdk-how-to-run-internal-scans-scan-imports-and-exports-and
from tenable_io.client import TenableIOClient
client = TenableIOClient(access_key='{YOUR ACCESS KEY}', secret_key='{YOUR SECRET KEY}')
scans = {scan.name: scan.id for scan in client.scans_api.list().scans}
scan = client.scan_helper.id(scans['{YOUR SCAN NAME}'])
scan.download('{YOUR SCAN NAME}.pdf')
This is working fine and i get the export as pdf. But now i want to get the scan as CSV and there is a hint in the document:
Optionally, you can also pass in additional parameters from “ScanExportRequest” to export the report in a different format such as CSV or HTML.
https://github.com/tenable/Tenable.io-SDK-for-Python/blob/master/tenable_io/api/scans.py#L257
the question now is: how do i process with this to get the output as CSV?
class ScanExportRequest(BaseRequest):
CHAPTER_CUSTOM_VULN_BY_HOST = u'vuln_by_host'
CHAPTER_CUSTOM_VULN_BY_PLUGIN = u'vuln_by_plugin'
CHAPTER_EXECUTIVE_SUMMARY = u'vuln_hosts_summary'
FORMAT_CSV = u'csv'
FORMAT_DB = u'db'
FORMAT_HTML = u'html'
FORMAT_NESSUS = u'nessus'
FORMAT_PDF = u'pdf'
def __init__(
self,
format,
password=None,
chapters=None,
):