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

OSCAL-CLI system-implementation/inventory/implemented-component (Cardinality) #184

Open
Telos-sa opened this issue Aug 25, 2023 · 8 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Telos-sa
Copy link

Describe the bug

Getting a cardinality error for implemented component:

[ERROR] [/system-security-plan/system-implementation[1]/inventory-item[1]/implemented-component[1]] The cardinality '0' is below the required minimum '1' for items matching the expression 'prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal') and @name='asset-id']'.

Which seems to conflict with the requirement in the model:
image

Please review, and let us know if we need to adjust. Attached is the SSP to review for evidence:

FedRAMP---Major-System-Boundary_OSCAL-export_20230823.zip

Who is the bug affecting

Resources that associate components with asset inventory.

What is affected by this bug

Tooling & API

How do we replicate this issue

Validate the OSCAL SSP provided using the OSCAL-CLI tool.

Expected behavior (i.e. solution)

Based on the model, there should not be any requirements for this, except to ensure the uuid of the component is included if the implemented-component is included.

Other comments

No response

Revisions

No response

@Telos-sa Telos-sa added the bug Something isn't working label Aug 25, 2023
@aj-stein-nist aj-stein-nist self-assigned this Aug 25, 2023
@aj-stein-nist
Copy link
Collaborator

@Telos-sa, I'll take a look. Just to confirm, reply with oscal-cli --version and tell me what version of the CLI and models you're using?

@aj-stein-nist
Copy link
Collaborator

Also, I did not notice this in the OSCAL repository. As this is a report about processing of data instances with the CLI, I will transfer this to the oscal-cli repository. Thanks for your report.

@aj-stein-nist aj-stein-nist transferred this issue from usnistgov/OSCAL Aug 25, 2023
@Telos-sa
Copy link
Author

[ec2-user@ip-172-31-4-212 FedRAMP---Major-System-Boundary_OSCAL-export_20230823]$ oscal-cli --version
oscal-cli 1.0.1 built at 2023-08-21 14:11 from branch main (6014c6d) at https://github.com/usnistgov/oscal-cli.git
liboscal-java v3.0.0 built at 2023-08-16 15:55 from branch 8eb8c5891f63b2540ca121aee32b4c8831ae08d7 (8eb8c58) at https://github.com/usnistgov/liboscal-java
oscal v1.0.5 built at 2023-08-16 15:55 from branch d19aedf7d0e0fba3b780d56c080312379127d7a4 (d19aedf) at https://github.com/usnistgov/OSCAL.git
metaschema-java 0.12.1 built at 2023-08-15T20:52:16+0000 from branch cb4b3fb31a1403dcdc5397bc8da07bac6d23cde8 (cb4b3fb) at https://github.com/usnistgov/metaschema-java
metaschema v0.9.0 built at 2023-08-15T20:52:16+0000 from branch a36f579e1e30abb2263895242cdbd2cf4bd29513 (a36f579) at https://github.com/usnistgov/metaschema

A little out of step, I cant test on the newest CLI if needed.

@aj-stein-nist
Copy link
Collaborator

So I have looked at this preliminarily and it seems in 1.0.2 (the oscal-version of the supplied document, thanks for this!) and in 1.1.0 (which is what oscal-cli 1.0.1 implements by virtue of the commit, not tag; I picked up that issue late), this appears to be correct behavior.

https://github.com/usnistgov/OSCAL/blob/v1.0.2/src/metaschema/oscal_implementation-common_metaschema.xml#L514

https://github.com/usnistgov/OSCAL/blob/v1.1.0/src/metaschema/oscal_implementation-common_metaschema.xml#L530

The XML/JSON schema constraints are designed to support zero or more props, but super-schema Metaschema-based constraints that the context of this particular implemented-component element requires the asset-id prop there. The CLI is working as intended.

That said, this highlights maybe a bug in the docs or some edge cases in the OSCAL schema docs and how they can be rendered. I cannot deny that, especially once I wrote the above paragraph. I will open a related issue today or later in the week.

@Telos-sa
Copy link
Author

Here is an example of what we are posting. Tying to figure out what the structure should be:
Outline:
Component is defined with Type
Inventory is defined with Asset-id prop (requirement for FedRAMP)
Component is associated to inventory leveraging the "implemented-component" tag

Wouldn't the asset-id for the component tie to the asset-id of the inventory?
Is this what is required: each unique piece of software that is installed on an inventory item must have an asset-id that distinguishes it as an instance of the component.

Didnt the presence of the implemented component do that by default? Attached two images that show the link between software and inventory.

image

image

@Telos-sa
Copy link
Author

Telos-sa commented Sep 6, 2023

Hey @aj-stein-nist did you get a chance to look at the additional notes? Do we need to have an asset-id within the component when the asset id it tied to the inventory item? Want to confirm where the asset-id prop should be located within the model.

@Telos-sa
Copy link
Author

FedRAMP---Major-System-Boundary_FedRAMP_SSP.xml.zip

@aj-stein-nist aj-stein-nist moved this from Todo to Further Analysis Needed in NIST OSCAL Work Board Sep 21, 2023
@aj-stein-nist aj-stein-nist added this to the Future milestone Feb 1, 2024
@aj-stein-nist
Copy link
Collaborator

Hi @Telos-sa, re #184 (comment), it seems there has not been any change to the upstream models. I will try to coordinate that request and open in issue, but until then this issue is blocked. Sorry for the delayed update.

@aj-stein-nist aj-stein-nist moved this from Further Analysis Needed to Blocked in NIST OSCAL Work Board Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Blocked
Development

No branches or pull requests

2 participants