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

Given all in-model constraints IDs #2090

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

Conversation

aj-stein-gsa
Copy link
Contributor

@aj-stein-gsa aj-stein-gsa commented Dec 15, 2024

Committer Notes

This PR closes #2088 once reviewed, approved, and merged.

All Submissions:

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

(For reviewers: The wiki has guidance on code review and overall issue review for completeness.)

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you included examples of how to use your new feature(s)?
  • Have you updated the OSCAL website and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the OSCAL-Pages and OSCAL_Reference repositories. These changes will not be used in the document generation pipeline unless the current metaschema-xslt and oscal-xslt are adapted to generate references to the identifiers of constraints, but at this time the pipelines do not act on them and they are open flags for Metaschema definitions.

@aj-stein-gsa aj-stein-gsa changed the title [WIP] Add common assessment constraint IDs for #2088 Given all in-model constraints IDs Jan 21, 2025
@aj-stein-gsa aj-stein-gsa marked this pull request as ready for review January 21, 2025 04:11
@aj-stein-gsa aj-stein-gsa requested a review from a team as a code owner January 21, 2025 04:11
@iMichaela
Copy link
Contributor

@wendellpiez - can you please assist with this PR. Robust profile resolution testing must be part of this PR.

@aj-stein-gsa
Copy link
Contributor Author

aj-stein-gsa commented Jan 21, 2025

I saw your comment in the other PR, @iMichaela, which does not seem particularly related. What is the impact and how will we test adding constraint IDs break profile resolution? The constraints conceptually operate separate of constraints, no?

@wendellpiez
Copy link
Contributor

With @aj-stein-gsa I wonder why profile resolution is implicated here.

@aj-stein-gsa
Copy link
Contributor Author

aj-stein-gsa commented Jan 21, 2025

With @aj-stein-gsa I wonder why profile resolution is implicated here.

It came up in another comment in #2095 (comment) from @iMichaela, not I. It is why I wanted clarification.

Thank you. Will prioritize this work. Profile resolution testing is also a concern for #2090 . @wendellpiez - can you please assist with this PR?

I wanted to redirect that conversation here as it summarized possible concerns about this PR.

EDIT: Updated to include the specific context from #2095, not just the top-level PR reference.

@aj-stein-gsa
Copy link
Contributor Author

Sorry, I accidentally posted this to #2095 thinking it was this PR (#2090 if you are reading email).

We have a way of computing all the constraints and targets in liboscal-java, and weirdly just adding the constraint IDs caused some exceptions. That result is separate of the low-risk changes, but is interesting because it does mean I may have duplicated or missed something. So on that note, I will update will relevant information of that analysis.

If NIST staff or community members want more details about methodology or the use of a consisten prefix (id="oscal-...), I am more than willing to discuss that. Let me know where, when, and how you would like that information.

@iMichaela
Copy link
Contributor

iMichaela commented Jan 21, 2025

With @aj-stein-gsa I wonder why profile resolution is implicated here.

To make sure that when a profile is resolved, the IDs for constraints are carried on into the resolved profile correctly. I am not saying there is an issue, but rather wanted to make sure the profile resolver(s) oscal-cli and XSLT transformations work well, so the oscal-content can be updated and released.

During testing with metaschema-framework/{metaschema-java,liboscal-java,
oscal-cli} harness, I was able to detect that I had erroneously prefixed
a constraint ID with `oscal=`, not the intended `oscal-` prefix, and
constraint builder function utilities picked this mistake up.
@aj-stein-gsa
Copy link
Contributor Author

To make sure that when a profile is resolved, the IDs for constraints are carried on into the resolved profile correctly.

I have not touched the XSLT documentation pipeline in three to six months, but such a feature would be new and require additional development. There resulting constraint information is rendered into usnistgov/OSCAL-Reference, but not IDs.

You can evidence by the fact a small minority of constraints, such as data-flow/diagram have had their own @ids for some time (going back at least two releases) and are not generated in the extant documentation. I do not see any output generation for is-unique at all for the relevant assembly or children assemblies, fields, or flags.

https://github.com/usnistgov/OSCAL/blob/v1.1.3/src/metaschema/oscal_ssp_metaschema.xml#L517C18-L522

https://pages.nist.gov/OSCAL-Reference/models/v1.1.3/system-security-plan/xml-reference/#/system-security-plan/system-characteristics/data-flow/diagram

@wendellpiez
Copy link
Contributor

wendellpiez commented Jan 21, 2025

The affected elements (within constraint elements) are in the metaschemas, not in profiles or their sources (catalogs). Profile resolution should be unaffected.

@aj-stein-gsa
Copy link
Contributor Author

Sorry, I accidentally posted this to #2095 thinking it was this PR (#2090 if you are reading email).

We have a way of computing all the constraints and targets in liboscal-java, and weirdly just adding the constraint IDs caused some exceptions.

Re my commit message in c0eee8b, I have found the source of the error and it was accidental use of = versus - in a constraint ID. I am continuing with testing and will report further findings and if there is no further issues found on our end.

Again, @iMichaela or @wendellpiez, if you want a brief on the methodology or adhoc testing without sufficient automated testing in usnistgov/OSCAL, oscal-content, or related dependency repos, let us know. I am happy to summarize how I am doing this analysis for the benefit of you and others in the community, so others can follow suit.

@aj-stein-gsa
Copy link
Contributor Author

The affected elements (constraint elements) are in the metaschemas, not in profiles or their sources (catalogs). Profile resolution should be unaffected.

I have agreed several times, not sure how to make it more clear, but I did want to address a different but related issue I thought might be helpful to discuss. I can also test profile resolution but I am less concerned about that for that reason, @wendellpiez.

The constraint with id="oscal-system-implementation-validated-by-index"
had its corresponding index name erased in error, making this
index-has-key constraint inoperable by tools conformant with the current
version of the Metaschema spec. This change restores it back.
@aj-stein-gsa
Copy link
Contributor Author

Again, @iMichaela or @wendellpiez, if you want a brief on the methodology or adhoc testing without sufficient automated testing in usnistgov/OSCAL, oscal-content, or related dependency repos, let us know. I am happy to summarize how I am doing this analysis for the benefit of you and others in the community, so others can follow suit.

I was able to test constraint validation and profile resolution locally. I resolved profiles, both the NIST and FedRAMP profiles without issue. I cannot run the documentation generation pipeline in GitHub Actions from your org to do a full end-to-end test there, but this appears to be ready for review and possible merge.

Copy link
Contributor

@wendellpiez wendellpiez left a comment

Choose a reason for hiding this comment

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

With the qualification that I have not run the build or inspected outputs, I'm approving the PR. Having scanned it, it seems to me any problems would have been exposed and repaired, or will be exposed in CI/CD. TMK we have no resources that hardcode these ID values to point into the constraints, which would break. Almost by definition any other emergent problem would be a new bug or requirement discovery (good things). @aj-stein-gsa thanks for this!

@wandmagic
Copy link
Collaborator

I've verified that these constraint ID's cover all constraints in the repo

Test run without AJ changes
https://github.com/usnistgov/OSCAL/actions/runs/12912168473/job/36006340148

Test run with AJ changes

https://github.com/wandmagic/OSCAL/actions/runs/12912172871

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.

4 participants