Bug 1567151

Summary: [RFE] Addon cannot load profile from kickstart when shortened form is used
Product: Red Hat Enterprise Linux 7 Reporter: Watson Yuuma Sato <wsato>
Component: oscap-anaconda-addonAssignee: Matěj Týč <matyc>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.5CC: mhaicman, openscap-maint, wsato
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-26 17:13:37 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 Watson Yuuma Sato 2018-04-13 13:44:14 UTC
Description of problem:

oscap-anaconda-addon cannot load profile from kickstart file when profile ID is short, e.g "ospp-rhel7".


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


How reproducible:
Always

Steps to Reproduce:
1. Use kickstart file for ospp-rhel7 to install machine
2. Addon cannot load ospp-rhel7 profile with error 
3.

Actual results:
Spoke in anaconda install shows error message:
"Error fetching and loading content"

And oscap-anaconda-addon plugin shows error message:
"Profile with ID 'ospp-rhel7' not defined in the content. Select a different profile, please"

Expected results:
Profile defined in kickstart is loaded.

Additional info:
Using full ID in kickstart file works.

Comment 2 Marek Haicman 2018-04-16 14:41:32 UTC
This is not a bug, as datastream profile is in the form 

xccdf_org.ssgproject.content_profile_stig-rhel7-disa

thus requiring full name is expected. Will track it further as a new feature.

Comment 4 Gabriel Gaspar Becker 2019-02-19 14:09:41 UTC
Additional info:

Kickstarts provided in scap-security-guide package for RHEL7 contains short version of profile name. (e.g. ospp or pci-dss)

--------------------------------------------------
$rpm -qa scap-security-guide
scap-security-guide-0.1.40-12.el7.noarch

$cat /usr/share/scap-security-guide/kickstart/ssg-rhel7-ospp-ks.cfg | grep "profile ="
        profile = ospp
--------------------------------------------------

That means OSCAP Anaconda Addon will not be able to use provided kickstart during graphical installation leading to error.

Oddly thing is if you install using Anaconda in text mode, no error will be raised because OSCAP Anaconda Addon does not provide text spokes, so profile will not be evaluated during RHEL installation, only
during %post section, where oscap (OpenSCAP) takes place and it is capable of handling short version of the profile name.

Short term solution would be to patch provided kickstart files to include full profile name.

Comment 5 Marek Haicman 2019-02-26 17:13:37 UTC
This issue was not selected to be included in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small number of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise, we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.