05-17-2019 04:53 AM
Hi,
I am working a bit with the Python module openVulnQuery and I am not getting the filtering to work.
The code is as per below:
query_client = query_client.OpenVulnQueryClient(client_id="1234", client_secret="5678") query_filter = query_client.TemporalFilter(query_client.PUBLISHED_LAST, '2019-01-01', '2019-05-17') query = query_client.get_by_product("default", args.platform, a_filter=query_filter) for x in range(len(query)): print('Advisory ID: ', query[x].advisory_id)
And I am receiving the below error:
AttributeError: 'OpenVulnQueryClient' object has no attribute 'TemporalFilter'
I do understand that the attribute does not seem to exist, but it should do according to the GitHub.
Did anyone get this working properly?
Is there any better documentation in regards of the Python module besides the GitHub?
Cheers!
05-17-2019 12:30 PM
After researching the source code it looks like it is not supported to filter dates when fetching by "product".
05-20-2019 12:08 AM
Hi there,
It looks like you are getting your variables mixed up with class names. You are creating a new OpenVulnQueryClient object from query_client and assigning it to the variable query_client. You then try to create a TemporalFilter object from query_client object which is now a OpenVulnQueryClient.
Try this:
query_c = query_client.OpenVulnQueryClient(client_id="1234", client_secret="5678") query_f = query_client.TemporalFilter(query_client.PUBLISHED_LAST, '2019-01-01', '2019-05-17') query = query_c.get_by_product("default", args.platform, a_filter=query_f) for x in range(len(query)): print('Advisory ID: ', query[x].advisory_id)
The GitHub repo is your only documentation as far as I know!
cheers,
Seb.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide