PDF report contents missing when fetched usin gvm-cli

Hi,

I’m using Greenbone Community Containers with the recommended docker-compose setup. I have used gvm-tools container to run gvm-cli commands and managed to run some scans.
I can see results and download PDF reports through UI, but when trying to get the same report using gvm-cli’s <get_reports> command, the resulted pdf-file’s only real contents is the first paragraph under Summary. Rest of the two paged document is empty and only shows boilerplate texts and empty result -table under Result Overview and Result per Host topics. All actual results are missing.
This only happens with the gvm-cli, reports downloaded through UI are fine.

Docs talk about “lean” attribute that requests a reduced report, but it doesn’t seem to change the PDF report output.
https://docs.greenbone.net/API/GMP/gmp-22.6.html#command_get_reports

Am I missing something obvious here?

$ gvm-cli --gmp-username $USER --gmp-password $PASS socket --xml '<get_version/>'
<get_version_response status="200" status_text="OK"><version>22.6</version></get_version_response>

$ gvm-cli --gmp-username $USER --gmp-password $PASS socket --xml '<get_reports report_id="UUIDHERE" format_id="c402cc3e-b531-11e1-9163-406186ea4fc5"/>'
<get_reports_response status="200" status_text="OK">...LONG_XML_FILE_INCLUDING_BASE64_ENCODED_REPORT_CONTENTS...</get_reports_response>

Hi,

did you take a look at gvm-tools/scripts/export-pdf-report.gmp.py at main · greenbone/gvm-tools · GitHub already?

1 Like

Thanks for pointers! I hadn’t tested any python based scripts.

Looks like this issue is related to how reports are filtered by default.

I tested export-pdf-report.gmp.py and got a full report including Log -level results.
When using export-pdf-report.gmp.py with details=False, I got the same empty report that was returned by gvm-cli earlier.

Filters were the thing I was missing. I need to read the docs a bit more, but looks like if I just configure those, the pdf reports start to look like what I was expecting.

As a feedback: current documentation example seems to produce empty reports where all threat levels are filtered out. This is quite confusing
https://docs.greenbone.net/API/GMP/gmp-22.6.html#command_get_reports

1 Like

Hi,

I’m returning to this topic after some experimenting with filters. The issue persists: PDF-reports created using gvm-cli are missing all results.

Report’s Result Overview correctly describes the filter I use, but gvm-cli -created version has this weird “NaN” results -line. Where could this come from?

# gvm-cli
This report contains results to NaN of the 14 results selected by the filtering described above.
Before filtering there were 720 results.

# Same report downloaded through UI
This report contains all 14 results selected by the filtering described above.
Before filtering there were 720 results.

This topic was automatically closed after 90 days. New replies are no longer allowed.