Get_reports returning old hosts vulnerabilities too

Hi
I have used openvas and scanned 3 ips on July. Now I scanned another set of 4 new ips. However when i try to generate the xml report for the latest scan of 4 ips, using task id,

I am getting the results of the old ips (those 3 ips) which i scan on july. Why is that happening?

You will have to explain your process in more detail to set support. It seems like you are using python-gvm and executing the get_report() function, but that function does not accept a task_id, it accepts a report_id. So, I guess somewhere in your code you have an error, or else, I’m wrong about your method.

Hi I am using xml and gvm cli to get the reports.

I found out the mistake that i was using below xml:

--xml  "<get_results task_id='{task_id}'  filter='notes=1 overrides=1 levels=hml min_qod=70 first=1 rows=250 sort-reverse=severity ignore_pagination=1'/>"

But the task_id must be inside the filter as

--xml  \"<get_results filter='task_id=\"{task_id}\" notes=1 overrides=1 levels=hml min_qod=70 first=1 rows=250 sort-reverse=severity ignore_pagination=1'/>\""

I think the problem is because you are using the get_reports() function which will return all reports instead of the get_report() singular without an “s” function which will accept a task_id and only return the report from a single task. You should compare both function argument descriptors from the links provided above.

The task_id='{task_id}' kwarg that you are submitting is being ignored and all results are being returned.