API for foreman/openscap?


I would like to get a list of available ARF reports for a given host or group of hosts, and download one, via a script. I’m trying to find an API for openscap like the foreman v2 API. The openscap test harness references API calls but when I call them on the proxy via curl it reports they’re not there. Is there something I need to do to enable the openscap API, or is it there and I’m just not doing it right?

Expected outcome:

API calls work

Foreman and Proxy versions:


Foreman and Proxy plugin versions:


Other relevant data:

You can find all the available API endpoints by going to your foreman instance, under https://$(hostname)/apidoc.html. To list and download specific reports via curl, the following should do the trick:

curl -H "Accept: application/json" -H "Content-Type: application/json" -k -X GET -u admin:changeme https://$(hostname)/api/v2/compliance/arf_reports -d '{"search": "host = some-host.example.com"}'| json_reformat

curl -H "Accept: application/json" -H "Content-Type: application/json" -k -X GET -u admin:changeme https://$(hostname)/api/v2/compliance/arf_reports/$report_id/download_html | json_reformat

or you can use hammer commands:

hammer arf-report list --search "host = some-host.example.com"
hammer arf-report download-html --id $report_id --path .

This worked! Thank you.