Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select rules based on reference #2070

Merged
merged 3 commits into from
Jan 10, 2024
Merged

Conversation

jan-cerny
Copy link
Member

This PR introduces a new option --reference that allows users to filter rules base on rule reference. This is useful to evaluate compliance with a particular policy requirement.

This feature needs SCAP content to contain reference URI-to-title mapping within the xccdf:Benchmark element. The ComplianceAsCode content upstream project started to provide this mapping in the SCAP content recently, starting from 62513c391dc5a3fafd12741bd02565ca0e1e8db2.

To support the easier experience with this feature, also a new option --references to the oscap info module has been added, this option extends the output of the command by listing all available reference names.

Fixes: https://issues.redhat.com/browse/RHEL-1479

This PR introduces a new option `--reference` that allows users to
filter rules base on rule reference. This is useful to evaluate
compliance with a particular policy requirement.

This feature needs SCAP content to contain reference URI-to-title
mapping within the `xccdf:Benchmark` element. The ComplianceAsCode
content upstream project started to provide this mapping in the SCAP
content recently, starting from 62513c391dc5a3fafd12741bd02565ca0e1e8db2.

To support the easier experience with this feature, also a new option
`--references` to the `oscap info` module has been added, this option
extends the output of the command by listing all available reference
names.

Fixes: https://issues.redhat.com/browse/RHEL-1479
@Mab879 Mab879 self-assigned this Jan 9, 2024
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Please take a look at my comments.

utils/oscap-xccdf.c Outdated Show resolved Hide resolved
src/XCCDF_POLICY/xccdf_policy.c Show resolved Hide resolved
@jan-cerny jan-cerny added this to the 1.3.10 milestone Jan 10, 2024
Instead of a segfault we will produce an error message.
@jan-cerny
Copy link
Member Author

I have fixed the segfault. I have fixed the help text.

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Thanks.

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please review the testing farm failure?

@jan-cerny
Copy link
Member Author

It's the probe_behavior/collect_limit.sh which fails randomly from time to time

@jan-cerny
Copy link
Member Author

/packit retest-failed

Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info.

LGTM.

@Mab879 Mab879 merged commit 3222734 into OpenSCAP:maint-1.3 Jan 10, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants