Bug #18066

The schedule of an SCAP policy is not nest when added to parent host-group

Added by Marek Hulán over 1 year ago. Updated 9 days ago.

Status:Closed
Priority:Normal
Assignee:Marek Hulán
Category:-
Target version:foreman_openscap 0.6.4
Difficulty: Team Backlog:
Triaged:No Fixed in Releases:
Bugzilla link:1298903 Found in Releases:
Pull request:https://github.com/theforeman/foreman_openscap/pull/234

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1298903

  1. Description of problem:

When creating a SCAP Policy and selecting the parent hostgroup of multiple nested host-groups the 'policy:' does not apply to hosts that are members of the nested groups.

  1. Steps to Reproduce:

1.Create 3 host groups

---|-------------|------------------|------------------|---------------------------------|------
ID | NAME        | TITLE            | OPERATING SYSTEM | ENVIRONMENT                     | MODEL
---|-------------|------------------|------------------|---------------------------------|------
1  | RHEL7Server | RHEL7Server      | RedHat 7.2       | KT_Example_ORG_Library_puppet_7 |      
5  | LNX         | RHEL7Server/LNX  |                  |                                 |      
4  | PROD        | RHEL7Server/PROD |                  |                                 |      
---|-------------|------------------|------------------|---------------------------------|------

2. Create an SCAP policy.
3. Assign the SCAP policy to the RHEL7Server host-group.

  1. Actual results:

The policy does not apply correctly to a host in the nested groups LNX and PROD. The "policies:" become an unset array, instead of specifying policy ID and schedule. However the 'foreman_scap_client:' class is added.

---
classes:
  foreman_scap_client:
    policies: []
    port: '9090'
    server: sat61.lnx.example.com
parameters:
  puppetmaster: sat61.lnx.example.com
  hostgroup: RHEL7Server/LNX

  1. Expected results:

The policy should apply correctly to hosts that are part of nested host-groups.

---
classes:
  foreman_scap_client:
    policies:
    - id: 1
      profile_id: xccdf_org.ssgproject.content_profile_common
      content_path: /var/lib/openscap/content/96e3704d2909a9f0956131e7254d2d3416ca9268f2d735e3f40a4353efa3c3e9.xml
      download_path: /compliance/policies/1/content
      minute: ! '*/10'
      hour: ! '*'
      monthday: ! '*'
      month: ! '*'
      weekday: ! '*'
    port: 9090
    server: sat61.lnx.example.com
parameters:
  puppetmaster: sat61.lnx.example.com
  hostgroup: RHEL7Server/LNX

Associated revisions

Revision bf665d5d
Added by Marek Hulán over 1 year ago

Fixes #18066 - inherit policies from parent host groups

Revision eec0efd8
Added by Ondřej Pražák over 1 year ago

Merge pull request #234 from ares/fix/18066

Fixes #18066 - inherit policies from parent host groups

History

#1 Updated by Marek Hulán over 1 year ago

  • Subject changed from The schedule of an SCAP policy is not nest when added to parent host-group to The schedule of an SCAP policy is not nest when added to parent host-group
  • Status changed from New to Assigned
  • Assignee set to Marek Hulán
  • Target version set to 1.11.2

#2 Updated by The Foreman Bot over 1 year ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_openscap/pull/234 added

#3 Updated by Marek Hulán over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#4 Updated by Marek Hulán over 1 year ago

  • Legacy Backlogs Release (now unused) set to 200

Also available in: Atom PDF