For example, I can retrieve all tasks with gvm-cli socket --xml "<get_tasks ignore_pagination=\"1\"/> but gmp.get_tasks does not provide a ignore_pagination option?
I can confirm that while this code fetches all the tasks for me, as you mentioned it does not fetch any reports attached to those tasks. Even using the default filter from the code you linked to:
reports = gmp.get_reports(
filter_string="task_id={task_id} and status=Done "
"sort-reverse=date"
).xpath("report")
However, the default filter works when used from the web-interface.
It fetches only the first ten, which are shown on the web interface before you have to scroll to the next page.
The same behavior as the xml version without ignore_pagination.
If it matters, I am using the unix socket from the docker container.
I don’t have any custom filters set on Kali native installation but my tasks page is not limited to 10 items - seems the GB Docker containers are different. The solution is to create a custom filter_string and submit it with the get_tasks() function. Maybe the ignore_pagination field can be submitted with the filter_string, or else use the filter string rows=-1.
A quick tour through the community forum could produce some potential solutions.
I see what you mean. Without having actually tried this script myself, I would start by enabling better error reporting using Python’s traceback module and print a full traceback since it seems custom error in the try catch seems limited and doesn’t provide full traceback.