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

introduce oscal cli validation and remove legacy example projects #601

Conversation

wandmagic
Copy link
Collaborator

Committer Notes

{Please provide a description of what this PR accomplishes. Be sure to reference any issues addressed. If the PR is a work-in-progress submitted for early review, please submit the PR as a draft PR using the "Draft pull request" dropdown.}

All Submissions:

By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.

@wandmagic wandmagic requested a review from a team as a code owner June 17, 2024 19:20
introduce oscal-cli validation + remove non-functional examples
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
Copy link
Member

Choose a reason for hiding this comment

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

This should be setup to run on pull requests.

Copy link
Collaborator Author

@wandmagic wandmagic Jun 20, 2024

Choose a reason for hiding this comment

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

updated to run on pull requests

Comment on lines 69 to 76
.PHONY: validate-xml-by-cli
validate-xml-by-cli: $(OSCAL_CLI_PATH) ## Validate XML files by directory using OSCAL CLI Tool
@find $(SRC_DIR)/content/*/baselines -mindepth 1 -maxdepth 1 -type d | while read example_dir; do \
find "$$example_dir" -name '*.xml' | while read xml_file; do \
example_type=$$(echo "$$(basename $$xml_file)" | awk -F'[_.]' '{print $$(NF-1)}'); \
echo "Processing content type: $$example_type"; \
echo "Validating $$xml_file with OSCAL CLI as $$example_type"; \
$(OSCAL_CLI_PATH)/bin/oscal-cli "$$example_type" validate "$$xml_file"; \
Copy link
Member

Choose a reason for hiding this comment

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

OSCAL CLI can be used to validate JSON and YAML content as well. Should this be extended to support validating all file types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added support for the other types from the dist folder but there are ALOT of errors, i think we should fix those errors and then introduce them. i have them commented out for now, but accessable from the makefile

Copy link
Member

Choose a reason for hiding this comment

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

Are the errors comming from the oscal-cli? If so, a newer build will likely fix them. If you want, we can schedule some time on Friday to work through these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the errors are coming from non-compliant constraints in the content, yes lets spend some time today to work through them

Comment on lines 29 to 31
- name: Run OSCAL CLI Validation
run: |
make validate-xml-by-cli
Copy link
Member

Choose a reason for hiding this comment

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

Should the setup-java action be used to bootstrap a Java runtime?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, the latest commit i just tested using a local version and I was able to grab it with the dirname command

Copy link

@xee5ch xee5ch left a comment

Choose a reason for hiding this comment

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

Hello, FedRAMP friends, helpful community member here. 👋

I am not sure this would help and if you want to duplicate or find a way to modularize the logic with a Makefile approach and GHA approach, but I had created oscal-cli-action for the latter for this very kind of use case. I have not done much with it due to limited community feedback, but PRs welcome. I am no sure I handle the "check for local install at path and if found just run approach," but I am more than happy to integrate that. You could probably do that with some changes to that action, and I am more than willing to accommodate with issues and PRs. Let me know.

xee5ch added a commit to oscal-club/oscal-cli-action that referenced this pull request Jun 19, 2024
Ensure this works to consider tentative new work per comment in GSA/fedramp-automation#601 (review).
@xee5ch
Copy link

xee5ch commented Jun 20, 2024

Following up on #601 (review), I added oscal-club/oscal-cli-action#10 to make how to run shell commands work, it is already supported. Let me know if you have other questions or interest in pivoting to the use of the oscal-cli action.

david-waltermire and others added 29 commits June 27, 2024 13:38
…atibility breaking changes introduced in the 1.2.1 oscal content release. This approach uses a local catalog that contains these fixes.
Adding the March 7 Data Bites presentation
Uploading April's Data Bites presentation
Uploading the most recent Data Bites presentation
@wandmagic wandmagic closed this Jul 23, 2024
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.

6 participants