Closed Sinpoder closed 1 year ago
I see a few problems in the snippet you've shared.
jsondata
. It looks like jsondata
is a list and not a dictionary. Hence you can only access data with indices. tio.exports.vulns()
method returns an iterator. Iterating over it would the right way to extract data out of it.Hello,
Alright. I will sent more simple version of this as the writing the vulnerabilities to a file can be done later and I can get that to work.
`from tenable.io import TenableIO
tio = TenableIO()
for vuln in tio.exports.vulns(tags=[('Group Name','External Servers')]): print(vuln)`
This gives me no output, as if those tags do not exist while if I do the same thing without the tags I get a massive output of all my vulnerabilities, like I expected to get.
Can you try a tag w/o any spaces?
{'uuid': 'b0d4ae43-88a6-4bc0-a89c-5347ae108fa4', 'key': 'Group Name', 'value': 'Field', 'added_by': 'f5927ca8-1587-415e-9b58-aac6d44455b8', 'added_at': '2023-07-27T12:36:07.483Z'},
changing External Servers to Field, and I get the same response of nothing.
It appears that Vulnerability Export using Tags Doesn't appear to be working properly based on the documentation.
`from tenable.io import TenableIO import json
tio = TenableIO()
with open("assets.json", 'w+', encoding='utf-8') as outfile: for vuln in tio.exports.vulns(): vunls = tio.exports.vulns( tags=[('Group Name','External Servers')] ) print(vunls)`
Here is the error code I get `module> for d in jsondata["tags"]: