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

Add XCCDF conflicts and requires #5281

Merged
merged 2 commits into from Mar 14, 2020

Conversation

redhatrises
Copy link
Contributor

Description:

  • Adds the capability of specifying <xccdf:requires/> and <xccdf:conflicts/> in benchmark writing to allow finer control over rules/groups that either depend on each other or conflict with each other.

@redhatrises redhatrises added this to the 0.1.50 milestone Mar 11, 2020
@redhatrises redhatrises force-pushed the xccdf_elems branch 2 times, most recently from 6001bc5 to ad066bc Compare March 11, 2020 23:29
@redhatrises redhatrises changed the title Add XCCDF conflicts and requires WIP: Add XCCDF conflicts and requires Mar 11, 2020
@@ -791,6 +791,10 @@ A rule itself contains these attributes:
The <tt>/tmp</tt> partition is used as temporary storage by many programs. Placing <tt>/tmp</tt> in its own partition enables the setting of more restrictive mount options, which can help protect programs which use it.
* `description`: Human-readable HTML description, which provides broader context for non-experts than the rationale. For example, description of the `partition_for_tmp` rule states that:
+
* `requires`: The `id` of another rule or group that must be selected and enabled in a profile.
Copy link
Member

Choose a reason for hiding this comment

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

What is the difference between selected and enabled in a Profile?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yuumasato trying to not use the XCCDF terms. Basically a rule has to exist in the profile and will flip the switch to selected='true' (aka enabled for processing in the benchmark/profile as selected in this case means to score and evaluate)

Copy link
Member

@yuumasato yuumasato Mar 17, 2020

Choose a reason for hiding this comment

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

I see, thanks for clarifying the language.

In the code you are not actually selecting any required rule in the build system, did I miss something?
It would be cool if the build system could auto-select rules for you, based on requires.

And actually, the scanner behavior works the other way. lt won't to select the required rule if it is not selected, it will flip the rule whose requirements are not fulfilled to false.

@redhatrises redhatrises changed the title WIP: Add XCCDF conflicts and requires Add XCCDF conflicts and requires Mar 12, 2020
Copy link
Member

@shawndwells shawndwells left a comment

Choose a reason for hiding this comment

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

Enriches the projects' overall support for the XCCDF spec, and even if existing rules & profile owners chose not to implement this, it's a move towards stewardship of full XCCDF implementation. Nice job!

@shawndwells shawndwells merged commit 62c8a61 into ComplianceAsCode:master Mar 14, 2020
@redhatrises redhatrises deleted the xccdf_elems branch March 14, 2020 00:07
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.

None yet

3 participants