-
Notifications
You must be signed in to change notification settings - Fork 201
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
Catalog Metaschema Incorrectly Restricts Guidance Children #2118
Comments
Best of luck on this, I tried to argue in #2112 to support more effective use of namespacing or relax these rules, and not much of either approach was accepted. Hopefully, you can achieve a different outcome in this request. |
@brian-ruf - thank you resurfacing this issue. I raised it long ago in a separate context and got a heavy push back from the technical director of that time. Let's discuss with you and @xee5ch (if interested) the best solution and propose it. |
OK, so where is this principle written down? How will complex data validation be supported without constraints? It seems this perspective is a change from the current status quo given the models you maintain in code, so answers to these questions seem really important.
Where are these working groups? Where is the community-at-large that is not contributing to these repositories, mailing lists, or other avenues for feeedback?
This approach is actually why I presented #2115 for #2112 to allow precision for general or specific use-cases with opt-in based on namespaces. How do we move that forward and use that to address this issue (#2118), #2112, and the intersection of other scenarios you allude to here? |
Describe the bug
In an OSCAL catalog, when attempting to create child/descendent parts to
//control/part[@name='guidance']
, the OSCAL-CLI tool is incorrectly reporting that only part names ofassessment-objective
orobjective
are allowed.NOTE: This was discovered while attempting to validate the Cloud Security Alliance's Cloud Controls Matrix (CCM) OSCAL Catalog, where they have guidance constructs as follows:
Who is the bug affecting
Catalog authors who need to break guidance down into more discrete parts than just the top-level guidance.
What is affected by this bug
Metaschema
How do we replicate this issue
//control/part[@name='guidance']
)guidance
oritem
).[ERROR] [/catalog/group[1]/control[1]/part[2]/part[1]/@name] Value 'item' doesn't match one of 'assessment-objective or objective' at path '/catalog/group[1]/control[1]/part[2]/part[1]/@name'
NOTE: The only reason I am not suggesting you test with the CCM is that they also have an invalid control property name that needs to be moved to their own namespace. The bug being reported in this issue is not discovered/reported by the OSCAL-CLI until after the property namespace issued is resolved.
Expected behavior (i.e. solution)
While it is unclear exactly what should be allowed as child/descendent parts to guidance, it should definitely not be
assessment-objective
orobjective
.Other comments
This is the metaschema code responsible:
OSCAL/src/metaschema/oscal_catalog_metaschema.xml
Lines 274 to 283 in b39789e
This requires a two-part fix:
objective
/assessment-objective
parts.Part 1
(NOTE the context is
//control
)The target here should be revised to only enforce this constraint for child parts to assessment objectives:
target="./part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('assessment-objective', 'objective')]//part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name"
Part 2
If the correct descendent part name to "guidance" parts is "item", the simplest fix is to revise the the following constraint to include "guidance":
OSCAL/src/metaschema/oscal_catalog_metaschema.xml
Lines 267 to 273 in b39789e
The target here should be revised to enforce this constraint for child parts to both statements and guidance:
target="./part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name=('statement', 'guidance')]//part[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name"
Revisions
No response
The text was updated successfully, but these errors were encountered: