Gmp.get_reports() not getting all the results

Hello everyone :slight_smile: I am new to this community and I decided to join because I have a little problem that I can’t solve:

I am using the API to do scans and print the results of those scans to the terminal, and I am writing scripts in python that allow me to do this.

Everything works correctly, but when I run the following part of the script:

reports = gmp.get_reports( details = True )

when I go to examine the report that I am interested in, I notice that there are not all the results indicated but only a few, I tried as well to apply the filter in the following way:

reports = gmp.get_reports( details = True , filter_string = "apply_overrides=0 levels=hml rows=100 min_qod=70 first=1 sort-reverse=severity")

But it doesn’t seem to be taken into account at all, so it doesn’t change anything in the answer obtained. Finally, I also tried using the ignore_pagination = True option in the following way:

reports = gmp.get_reports( details = True , ignore_pagination = True )

And actually more results are shown that way, but still they are not all :frowning:

Do you happen to know how to display all the results in the correct way?
P.S: I use GMP version 22.4

Hi,

you need to combine all three things, details=True, ignore_pagination=True and setting a filter_string to get all results of a single report. For example

reportx = gmp.get_report(report_id, details=True, ignore_pagination=True, filter_string="levels=hmlg")

For the desired filter_string you can always take a look at the web UI. The applied filter string is shown at the bottom.

If you want to query all reports you need to change the rows of the filter string. Please be aware that the maximum for rows is 1000.

reports = gmp.get_reports(details=True, filter_string="rows=1000")
2 Likes

thank you very much, I figured out where the problem was, which was that by Default the report was filtered such that it only showed me vulnerabilities where the QOD was at least 70, I tried changing the filter by putting a lower QOD and with 0 it shows me all of them.

Now actually String_filter would seem to work correctly, probably not taking this into account it seemed not to work.