Bug 1482548

Summary: Scap CLI policy update successful with no scap-profile
Product: Red Hat Satellite Reporter: Sanket Jagtap <sjagtap>
Component: SCAP PluginAssignee: Ondřej Pražák <oprazak>
Status: CLOSED ERRATA QA Contact: Nikhil Kathole <nkathole>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3.0CC: bbuckingham, mhulan, nkathole, oprazak
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman_openscap-0.7.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:51:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sanket Jagtap 2017-08-17 14:04:36 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
policy info --id 5
Id:                        5
Name:                      test1
Created at:                2017-08-17 13:26:59 UTC
Period:                    monthly
Weekday:                   
Cron line:                 
Scap content Id:           4
Scap Content profile Id:   23
Tailoring file Id:         1
Tailoring file profile Id: 52
Locations:                 
    Default Location
Organizations:             
    Default Organization

hammer> policy update --id 5 --scap-content-id 3
Policy updated

 policy info --id 5
Id:                        5
Name:                      test1
Created at:                2017-08-17 13:26:59 UTC
Period:                    monthly
Weekday:                   
Cron line:                 
Scap content Id:           3
Scap Content profile Id:   23
Tailoring file Id:         1
Tailoring file profile Id: 52
Locations:                 
    Default Location
Organizations:             
    Default Organization

Here, the weird part , scap-content 3 , doesn't have a profile-id 23

Actual results:
Scap policy was updated without scap-profile-id parameter

Expected results:
Scap policy update should not be updated with scap-profile parameter

Additional info:

Comment 2 Ondřej Pražák 2017-08-21 10:12:06 UTC
Created redmine issue http://projects.theforeman.org/issues/20666 from this bug

Comment 3 Satellite Program 2017-08-21 12:14:13 UTC
Upstream bug assigned to oprazak

Comment 4 Satellite Program 2017-08-21 12:14:16 UTC
Upstream bug assigned to oprazak

Comment 5 Satellite Program 2017-08-25 16:13:48 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20666 has been resolved.

Comment 6 Nikhil Kathole 2017-09-10 07:25:36 UTC
VERIFIED

Version Tested:
Satellite-6.3 Snap 15

steps:

# hammer policy info --id 1
Id:                        1
Name:                      policy1
Created at:                2017-09-09 12:34:37 UTC
Period:                    weekly
Weekday:                   thursday
Cron line:
Scap content Id:           4
Scap Content profile Id:   22
Tailoring file Id:         1
Tailoring file profile Id: 30
Locations:
    Default Location
Organizations:
    Default Organization

# hammer policy info --id 2
Id:                        2
Name:                      rhe7_policy
Created at:                2017-09-09 13:26:05 UTC
Period:                    monthly
Weekday:
Cron line:
Scap content Id:           3
Scap Content profile Id:   5
Tailoring file Id:
Tailoring file profile Id:


# hammer policy update --id 2 --scap-content-id 4
Could not update the policy:
  Scap content does not have the selected SCAP content profile

Tried to update with invalid scap-content-profile-id
# hammer policy update --id 2 --scap-content-profile-id 5 --scap-content-id 4
Could not update the policy:
  Scap content does not have the selected SCAP content profile


# hammer policy update --id 2 --scap-content-profile-id 22 --scap-content-id 4
Policy updated

# hammer policy info --id 2
Id:                        2
Name:                      rhe7_policy
Created at:                2017-09-09 13:26:05 UTC
Period:                    monthly
Weekday:
Cron line:
Scap content Id:           4
Scap Content profile Id:   22
Tailoring file Id:
Tailoring file profile Id:

Scap policy requires scap-content-profile-id to update and Successfully updated if both scap-content-profile-id and scap-content-id are valid.

Comment 7 Satellite Program 2018-02-21 16:51:07 UTC
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