Add xccdf status to profiles#13045
Merged
jan-cerny merged 3 commits intoFeb 15, 2025
Merged
Conversation
jan-cerny
reviewed
Feb 13, 2025
| element = ET.Element('{%s}Profile' % XCCDF12_NS) | ||
| element.set("id", OSCAP_PROFILE + self.id_) | ||
| if self.status: | ||
| add_sub_element(element, "status", XCCDF12_NS, str(self.status)) |
Collaborator
There was a problem hiding this comment.
I suggest testing this feature by a unit test.
You can extend or reuse this test:
Member
Author
There was a problem hiding this comment.
Tests addded, thank you for the review.
This allows us to identify a profile as deprecated, can also be used in other elements, as xccdf:Rule andxccdf:Value. More info in XCCDF standard item 6.2.8.
Test that it loads and dumps the status correctly. Test that invalid statuses raise exception during build.
They are newwer versions available.
47c7a53 to
2696c29
Compare
|
Code Climate has analyzed commit 2696c29 and detected 2 issues on this pull request. Here's the issue category breakdown:
The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 62.0% (0.1% change). View more on Code Climate. |
jan-cerny
approved these changes
Feb 14, 2025
Collaborator
jan-cerny
left a comment
There was a problem hiding this comment.
I have built the ocp4 product and I have checked in the built data stream that the cis-1-4 and cis-node-1-4 profiles contain <xccdf-1.2:status> element with deprecated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
xccdf:status: element toxccdf:Profile`.Rationale:
Review Hints: