Bug 2213816

Summary: blueprint generated with oscap polish
Product: Red Hat Enterprise Linux 9 Reporter: Marek Haicman <mhaicman>
Component: openscapAssignee: Jan Černý <jcerny>
Status: CLOSED MIGRATED QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.2CC: ekolesni, matyc, mhaicman, mmarhefk
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-18 07:27:31 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 Marek Haicman 2023-06-09 13:36:10 UTC
Description of problem:
When blueprint is generated, I see two places for improvement.

First one is mostly just confusing - the comment when blueprint is generated states among other:

``
# This Blueprint is generated from an OpenSCAP profile without preliminary evaluation.
# It attempts to fix every selected rule, even if the system is already compliant.
``
while technically correct,I don't thing there's any point in generating blueprints that is based on evaluation. Not having the comment there might actually be better.

Second one is practical and impactful - Image Builder supports following directive to execute "post install" hardening.

``
[customizations.openscap]
datastream = "/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml"
profile_id = "xccdf_org.ssgproject.content_profile_cis"
``

This is NOT part of the generated blueprint, which requires user to actually know about it and add it later. This is a bug in usability.


Version-Release number of selected component (if applicable):
openscap-1.3.7-1.el9.x86_64

How reproducible:
reliable

Steps to Reproduce:
1. oscap xccdf generate fix --fix-type blueprint --profile cis /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
2. read the output
3.

Actual results:
Comment from the description is present. Directive [customization.openscap] from description is NOT present.

Expected results:
Comment is not there. Directive is there. Ideally in a way that the output is directly usable without alteration in the image builder.

Additional info:

Comment 1 Evgeny Kolesnikov 2023-06-12 14:09:14 UTC
This section depends on the presence of of SSG package, it's actual name/path and profiles shipped. We can't really be sure about all that during the generation phase.

Comment 2 Evgeny Kolesnikov 2023-06-12 14:12:33 UTC
Also, without this section the blueprint is self-contained and does not require openscap and SSG packages to be present in the image. Which might be preferable in some cases.

Comment 3 RHEL Program Management 2023-08-17 14:27:13 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 4 RHEL Program Management 2023-08-18 07:27:31 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues.