Bug 2185176 - Failed to locate a datastream with ID matching 'scap_org.open-scap_datastream_from_xccdf_ssg-rhel8-xccdf-1.2.xml' ID
Summary: Failed to locate a datastream with ID matching 'scap_org.open-scap_datastream...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: scap-security-guide
Version: 8.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Černý
QA Contact: BaseOS QE Security Team
Mirek Jahoda
URL:
Whiteboard:
Depends On:
Blocks: 2223967 2190172 2223647 2223966
TreeView+ depends on / blocked
 
Reported: 2023-04-07 10:25 UTC by Masahiro Matsuya
Modified: 2023-08-09 11:11 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Known Issue
Doc Text:
Cause: A z-stream update of the scap-security-guide package resulted in different version of the hardening content on installation media, and Red Hat repositories. This breaks the hardening part of the GUI installation when the Red Hat CDN is used as an installation source together with an installation medium or image. Consequence: A non-fatal installation error message is shown at the end of the installation, informing the user that hardening was not successful. Workaround (if any): Either of - Use the full install medium, and don't register with the Red Hat CDN at installation-time. - Don't harden the system at the installation time, perform the hardening of the system after it is installed. - Perform a kickstart installation without the GUI.
Clone Of:
: 2190172 2223647 2223966 2223967 (view as bug list)
Environment:
Last Closed: 2023-07-19 15:00:46 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-154232 0 None None None 2023-04-07 10:27:03 UTC
Red Hat Knowledge Base (Solution) 7009522 0 None None None 2023-05-02 07:55:51 UTC

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.


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