Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1342623 - [RFE] Extend the foreman API for improved compliance/openscap usage
[RFE] Extend the foreman API for improved compliance/openscap usage
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: SCAP Plugin (Show other bugs)
6.1.8
Unspecified Unspecified
unspecified Severity medium (vote)
: GA
: Unused
Assigned To: satellite6-bugs
Sebastian Gräßl
: FutureFeature, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-03 13:14 EDT by David Critch
Modified: 2018-02-21 07:35 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-21 07:35:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:0336 normal SHIPPED_LIVE Important: Satellite 6.3 security, bug fix, and enhancement update 2018-02-21 17:43:42 EST

  None (edit)
Description David Critch 2016-06-03 13:14:10 EDT
Description of problem:
We are looking at deploying the OpenSCAP plugin for Satellite 6, and use a lot of hammer/API requests. Currently, the foreman API exposes a limited amount of access to those resources:

# curl -s -k -u admin:NOTAPASSWORD https://$(hostname)/api/v2/ | jq . | grep -A2 scaptimony_policies
    "scaptimony_policies": {
      "Show a policy's SCAP content": "/api/v2/compliance/policies/:id/content"
    },


The hammer CLI appears to have no support at all:
# hammer --help | egrep -i 'compliance|policy|audit|openscap'
#

It would be great to e.g. list all policies, create or delete a policy, etc.

Version-Release number of selected component (if applicable):
ruby193-rubygem-scaptimony-0.3.0.1-1.el7sat.noarch
rubygem-smart_proxy_openscap-0.3.0.9-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Query foreman for API endpoints (above)
2. Returns just the one endpoint


Actual results:
API call returns one endpoint
hammer --help shows no ability to manage policies

Expected results:
Additional access to the resources, similar to say hostgroups:

    "hostgroups": {
      "List all host groups": "/api/hostgroups",
      "Show a host group": "/api/hostgroups/:id",
      "Create a host group": "/api/hostgroups",
      "Update a host group": "/api/hostgroups/:id",
      "Delete a host group": "/api/hostgroups/:id",
      "Clone a host group": "/api/hostgroups/:id/clone"
    },


Additional info:
Comment 1 Bryan Kearney 2016-07-26 14:56:51 EDT
Moving 6.2 bugs out to sat-backlog.
Comment 8 Sebastian Gräßl 2017-09-06 06:21:58 EDT
Verified on Satellite 6.3 snap 14.

Hammer commands are available and API has more endpoints to manage scap_content:
...
"scap_contents": {
  "List SCAP contents": "/api/compliance/scap_contents",
  "Show an SCAP content as XML": "/api/compliance/scap_contents/:id/xml",
  "Show an SCAP content": "/api/compliance/scap_contents/:id",
  "Create SCAP content": "/api/compliance/scap_contents",
  "Update an SCAP content": "/api/compliance/scap_contents/:id",
  "Deletes an SCAP content": "/api/compliance/scap_contents/:id"
},
...
Comment 11 errata-xmlrpc 2018-02-21 07:35:17 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2018:0336

Note You need to log in before you can comment on or make changes to this bug.