Auto Delete Reports Option for a Task via GMP

Hey everyone,

This community has been epic in helping me! Thank you. I hope I can get another assist.

I have read through the documentation, played with my GMP scripting but am still unable to get the option set in a task for it to automatically delete old reports via GMP Scripting. I would like to set it up so there are only 2 reports on the device at any time.

Is there an undocumented way to do this or am I missing it?

Thanks!

Hi,

I recently wrote some code in order to automate stuff on our GSM-CENO-Appliance. Defining the amount of old reports to be kept was one thing I struggled to achieve, too. :slight_smile:

While using python-gvm, I was able to solve it like this:

response = gmp.create_task(name=current_task_name,
                                       config_id=scan_config_id,
                                       target_id=target.id,
                                       scanner_id=scanner_config_id,
                                       alterable=True,
                                       preferences={
                                           "auto_delete": "keep",
                                           "auto_delete_data": 3,
                                       }
                                       )

It would be nice, if the documentation would be clearer regarding such details, e.g. I wasn’t able to find a list of valid key value pairs for the preferences parameter, so I had to look them up via exported task XML files.

HTH

All the best,

Jonas

2 Likes