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

833 oscal version constraint #884

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

kyhu65867
Copy link

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.

@kyhu65867 kyhu65867 force-pushed the 833-oscal-version branch 2 times, most recently from 03ec0e4 to 6f2ead3 Compare November 8, 2024 21:43
@aj-stein-gsa
Copy link
Contributor

@kyhu65867 I beefed it up and think it works before I mark it anymore complicated. Let me know what you think, especially the tests. I may have to abstain from review, but hope our colleagues roast me and show you that no one is sacred during review. 😄

@aj-stein-gsa aj-stein-gsa marked this pull request as ready for review November 8, 2024 23:59
@aj-stein-gsa aj-stein-gsa requested a review from a team as a code owner November 8, 2024 23:59
@aj-stein-gsa aj-stein-gsa self-assigned this Nov 8, 2024
@aj-stein-gsa
Copy link
Contributor

I add myself not just because I contributed but I want honest feedback and review from others since I did my fair share on this one, I should have to defend it with Kylie.

@aj-stein-gsa aj-stein-gsa linked an issue Nov 15, 2024 that may be closed by this pull request
14 tasks
Copy link
Contributor

@Gabeblis Gabeblis left a comment

Choose a reason for hiding this comment

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

I think this is a good start. My biggest issue with this is the FedRAMP versions. Right now we have only 1 version with its minimum required OSCAL version hardcoded. Are there different versions? If not, we could simplify this constraint a lot. Simply changing the FedRAMP version at all breaks this constraint.

Comment on lines 28 to 54
expression="if (empty($doc-fedramp-version/@value))
then map:get($fedramp-minimum-oscal-versions, $preferred-version)
Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a constraint that checks and requires the existence of the fedramp-version prop. I am not sure adding a default value in the case of the missing prop is what we want to do here.

Copy link
Contributor

@aj-stein-gsa aj-stein-gsa Nov 18, 2024

Choose a reason for hiding this comment

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

If not you will get null pointer exceptions when you dereference other elements, so I was curious how others would consider appropriate for the balancing act. I appreciate the feedback.

Copy link
Contributor

Choose a reason for hiding this comment

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

The first thing that comes to mind is creating a let expression that checks for the existence of the prop. If it doesn't exist, assign some null value. Add that check as part of the other let expressions: if (true) then do something... else null value. Then in the constraint test just check that the value isn't null and all the other conditions are still truthy

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I can keep that in mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

One more thing about the current implementation is that in the case that no FedRAMP version is included, it incorrectly results in a pass because of the way it defaults to a certain value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I moved it back to in progress because I was not done addressing your other feedback, sir. I did not forget!

Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies. It just hit me that I forgot to mention that yesterday is all 🤕

@Gabeblis Gabeblis requested a review from a team November 18, 2024 19:49
@aj-stein-gsa aj-stein-gsa force-pushed the 833-oscal-version branch 3 times, most recently from f13dd5c to cf00d2b Compare November 19, 2024 06:28
wandmagic
wandmagic previously approved these changes Nov 19, 2024
Comment on lines 28 to 54
expression="if (empty($doc-fedramp-version/@value))
then map:get($fedramp-minimum-oscal-versions, $preferred-version)
Copy link
Contributor

Choose a reason for hiding this comment

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

One more thing about the current implementation is that in the case that no FedRAMP version is included, it incorrectly results in a pass because of the way it defaults to a certain value.

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.

Check oscal-version against fedramp-version in digital authorization package
4 participants