-
Notifications
You must be signed in to change notification settings - Fork 714
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
Adds utilities for OSCAL Component Definitions from policies #11292
Adds utilities for OSCAL Component Definitions from policies #11292
Conversation
Hi @jpower432. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
5ebf9f7
to
9edbd80
Compare
9edbd80
to
4f1ba16
Compare
This creates a single component definition and component for a product and fills control responses based on the input policy. Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
…figuration Updates to gate.yml were made to support installing compliance-trestle and CMakeLists.txt was updated to keep the oscal utilties unit tests from running when the python version is lower than 3.8 and the required modules are not installed. Signed-off-by: Jennifer Power <[email protected]>
Based on status, the control notes are moved to remarks for status justification. Signed-off-by: Jennifer Power <[email protected]>
Some imports do not comply with mypy requirements. This adds "skip" to follow-imports for utils/oscal to localize the testing to just those scripts. Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
The ControlSelector abstract class would allow the ComponentDefinitionGenerator to be reused with various methods of deriving control response information. Signed-off-by: Jennifer Power <[email protected]>
…ented requirement The status is declared in the control policy at the control level, so updating `handle_response` to always add the implementation status to the implemented requirement. Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
…d requests Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
4f1ba16
to
2e538d7
Compare
/packit build |
/packit build |
There was a problem hiding this 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. I do have a few comments.
Co-authored-by: Matthew Burket <[email protected]>
Signed-off-by: Jennifer Power <[email protected]>
2cb66ac
to
4c8fa7d
Compare
Code Climate has analyzed commit 4c8fa7d 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 58.5% (0.0% change). View more on Code Climate. |
/packit rebuild-failed |
Waving Automatus tests as the test rules don't need tests. |
/packit retest-failed |
Thanks for your hard work on this PR! |
Description:
This PR adds utilities under the
utils
directory to create OSCAL component definitions using the files under thecontrols
directory to populate the implemented requirements and mapping to the rules.What was added?
utils/oscal
test/unit/utils/oscal
Rationale:
The policy was used to initially fill in the control responses because it contains all the required information for a component definition (status, description, rule mapping). However, the class
ComponentDefinitionGenerator
takes aControlSelector
class in order to allow how control response information is selected and constructed separate from the generation logic.I tried to follow the guidance of one-step one commit to keep the options open for breaking this down into smaller PRs. However, all the changes would be needed to get an OSCAL component definition that would be compatible with
compliance-trestle
.Review Hints:
This is PR is part two to #11286 so please see that PR to review the first two commits. Merged
Important Notes
To support installing
compliance-trestle
during CI job execution for testing, changes were made to the workflow files in the following commits:9fea72d
5fa74a9
It performs a mapping from SSG status to OSCAL implementation status in the
OscalStatus
classThe script uses the "Section letter:" convention in the control notes to create statements under the implemented requirements.
The script maps parameter to rules uses the
xccdf_variable
field undertemplate.vars
To determine what responses will mapped to the controls in the OSCAL profile the control id and label property from the resolved catalog is searched.
How to test
An example of how to execute the script:
Example of how to verify compatibility with
compliance-trestle