Bug 2077089

Summary: [RFE] oscap to run rules based on policy reference
Product: Red Hat Enterprise Linux 8 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: 8.6CC: ekolesni, matyc, mhaicman
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
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: 2023-08-18 07:27:31 UTC Type: Story
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 2022-04-20 16:59:15 UTC
Description of problem:
The execution of compliance checks is often based on requirements of the policy, and not on the rules of the SCAP profile. When a user wants to check for particular requirement coverage, they need to parse the XML themselves.

There's expectation this is quite common step, and while it's not too hard to achieve it, there's also no point for each customer to recreate some kind of automation for that.

Having something like `oscap xccdf eval --profile stig --reference '800-53:CM-6(a)' ssg-rhel7-ds.xml` which would execute only subset of stig profile that has the reference 


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

How reproducible:
it's a new feature request

Steps to Reproduce:
1. `oscap xccdf eval --profile stig --reference '800-53:CM-6(a)' ssg-rhel7-ds.xml`
* to run the subset of profile rules that conforms the reference
2. `oscap xccdf eval --profile stig --reference 800-53:CM-6 ssg-rhel7-ds.xml`
* to run the subset of profile rules that conforms the references CM-6(a) CM-6(b) ...
3. `oscap info --profile stig--references ssg-rhel7-ds.xml
* will print list of possible references related to the profile available in the content


Actual results:
Not implemented

Expected results:
Implemented

Additional info:
This might require some update to the content as well - the references at the moment are identified in the XCCDF via URLs, which is not that cool.

Comment 2 Jan Černý 2022-04-21 13:06:09 UTC
Analysis: Add option to evaluate only rules based on reference IDs. Adding ability to filter rules based on their reference IDs requires changes in XCCDF policy processing code. We expect having to deal with xccdf:requires and xccdf:conflicts elements similar as we do at --rule and --skip-rule option.

Comment 3 RHEL Program Management 2023-08-17 14:13:10 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.