Bug 2185176

Summary: Failed to locate a datastream with ID matching 'scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml' ID
Product: Red Hat Enterprise Linux 8 Reporter: Masahiro Matsuya <mmatsuya>
Component: scap-security-guideAssignee: Jan Černý <jcerny>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact: Jan Fiala <jafiala>
Priority: medium    
Version: 8.7CC: ggasparb, jcerny, mhaicman, mlysonek, rdulhani, wsato
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2190172 2223647 2223966 2223967 (view as bug list) Environment:
Last Closed: 2023-07-19 15:00:46 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:
Bug Depends On:    
Bug Blocks: 2190172, 2223647, 2223966, 2223967    

Description Masahiro Matsuya 2023-04-07 10:25:21 UTC
Description of problem:

RHEL8.7 installation with CDN repository outputs the following error in pop-up dialog window.

Something went wrong during the final hardening: Content evaluation and remediation with the oscap tool failed: OpenSCAP Error: Failed to locate a datastream with ID matching 'scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml' ID and checklist inside matching 'scap_org.open-scap_cref_ssg-rhel8-xccdf-1.2.xml' ID. [/builddir/build/BUILD/openscap-1.3.6/src/DS/ds_sds_session.c:223]


This is caused by the datastream id changed in the latest scap-security-guide package.

With scap-security-guide-0.1.63-4.el8.noarch (in 8.7GA):

# grep datastream /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
  <ds:data-stream id="scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml" scap-version="1.3" use-case="OTHER">


With scap-security-guide-0.1.66-2.el8_7.noarch.rpm:

# grep datastream /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
  <ds:data-stream id="scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf.xml" scap-version="1.3" use-case="OTHER">


In shorts, "-1.2" was removed from datastream id in the latest scap-security-guide package. 


The datastream id is taken from /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml in the stage2 image, when GUI spoke for security profile finishes.

But, the remediate is executed in the chroot environment after latest package installation. So, the saved datastream id doesn't match with the one in the latest package, and the error is output.

Maybe, it's required to pick up the datastream id again from the latest package just before remediate is executed.


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux 

How reproducible:
Always

Steps to Reproduce:
1. Start GUI installation of RHEL8.7
2. Select any security profile like stig
3. Register the host into Customer Portal (CDN)
4. Set CDN as the package repository
5. Start the installation

Actual results:

The following error is output, and installation stops. (it can be resumed by pressing button)

Something went wrong during the final hardening: Content evaluation and remediation with the oscap tool failed: OpenSCAP Error: Failed to locate a datastream with ID matching 'scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml' ID and checklist inside matching 'scap_org.open-scap_cref_ssg-rhel8-xccdf-1.2.xml' ID.


Expected results:

Any error is not output. The installation completes without stopping in any popup dialog window.

Additional info:

Comment 2 Matěj Týč 2023-04-26 16:09:41 UTC
Kudos to Masahiro for the great analysis,
this issue is caused by unexpected interaction between the scap-security-guide content project's build system that determines the datastream ID, recent z-stream content updates across many RHEL releases, and by a way how the addon works in the GUI installation mode.

The issue can't be fixed easily for existing RHELs, as the addon is already on those affected installation images, and changing the datastream ID again would cause problems elsewhere.
I can advise to use workarounds that we will draft, or to wait for the next minor version that won't suffer from this issue.

Comment 5 Jan Černý 2023-07-18 08:33:52 UTC
This problem has been triggered by a change in the scap-security-guide package. The fix will be implemented in the scap-security-guide package, we won't change the oscap-anaconda-addon component when fixing this bug. Therefore, I'm switching the bug to scap-security-guide component.

Comment 11 Jan Černý 2023-07-19 15:00:46 UTC
This bug isn't reproducible in RHEL 8.9, because the `scap-security-guide` RPM package shipped in RHEL 8.9 installation image already contains the data stream ID without the `-1.2.` suffix, so there is no difference between the IDs in the content in the installation image and the content in the repository, so the bug can't happen.

For the resolution on RHEL 8.6 z-stream, please track the 8.6.z clone: https://bugzilla.redhat.com/show_bug.cgi?id=2223967.