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/component Constraint issues #186

Closed
Telos-sa opened this issue Aug 25, 2023 · 5 comments
Closed

OSCAL-CLI (system-implementation/component Constraint issues #186

Telos-sa opened this issue Aug 25, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@Telos-sa
Copy link

Describe the bug

ERROR] [/system-security-plan/system-implementation[1]/component[12]] Expect constraint 'not(exists((.)[not(@type='service')]/protocol))' did not match the data at path '/system-security-plan/system-implementation[1]/component[12]'

Cannot determine what the error means, to correct.

This is the structure that was followed:
image

However the attributes "end" and "start" are swapped, resulting in additional warnings.

[WARNING] [/system-security-plan/system-implementation[1]/component[12]/protocol[1]] It is a best practice to provide a UUID.
[WARNING] [/system-security-plan/system-implementation[1]/component[12]/protocol[1]/port-range[1]] A start port exists, but an end point does not. To define a single port, the start and end should be the same value.
[WARNING] [/system-security-plan/system-implementation[1]/component[12]/protocol[1]/port-range[1]] An end point exists, but a start port does not. To define a single port, the start and end should be the same value.
[ERROR] [/system-security-plan/system-implementation[1]/component[13]] Expect constraint 'not(exists((.)[not(@type='service')]/protocol))' did not match the data at path '/system-security-plan/system-implementation[1]/component[13]'
[WARNING] [/system-security-plan/system-implementation[1]/component[13]/protocol[1]] It is a best practice to provide a UUID.
[WARNING] [/system-security-plan/system-implementation[1]/component[13]/protocol[1]/port-range[1]] A start port exists, but an end point does not. To define a single port, the start and end should be the same value.
[WARNING] [/system-security-plan/system-implementation[1]/component[13]/protocol[1]/port-range[1]] An end point exists, but a start port does not. To define a single port, the start and end should be the same value.
[WARNING] [/system-security-plan/system-implementation[1]/component[14]/protocol[1]] It is a best practice to provide a UUID.
[WARNING] [/system-security-plan/system-implementation[1]/component[14]/protocol[1]/port-range[1]] A start port exists, but an end point does not. To define a single port, the start and end should be the same value.
[WARNING] [/system-security-plan/system-implementation[1]/component[14]/protocol[1]/port-range[1]] An end point exists, but a start port does not. To define a single port, the start and end should be the same value.
[WARNING] [/system-security-plan/system-implementation[1]/component[15]/protocol[1]] It is a best practice to provide a UUID.
[WARNING] [/system-security-plan/system-implementation[1]/component[15]/protocol[1]/port-range[1]] A start port exists, but an end point does not. To define a single port, the start and end should be the same value.
[WARNING] [/system-security-plan/system-implementation[1]/component[15]/protocol[1]/port-range[1]] An end point exists, but a start port does not. To define a single port, th
[FedRAMP---Major-System-Boundary_OSCAL-export_20230823.zip](https://github.com/usnistgov/OSCAL/files
e start and end should be the same value.

Please confirm the source of the bug, and if it is a requirement that the attributes are in specific order for the oscal-cli

Attached the SSP package for review:
FedRAMP---Major-System-Boundary_OSCAL-export_20230823.zip

Who is the bug affecting

Components with protocol tag

What is affected by this bug

Tooling & API

How do we replicate this issue

Load the SSP provided into the OSCAL CLI and validate

Expected behavior (i.e. solution)

Attributes should not be locked to a specific order to structure or validate. Confirmed when using xmllint, that the structure validates, which means it is the rules set that requires the specific format.

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
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
@aj-stein-nist
Copy link
Collaborator

Hi @Telos-sa, let's address the ambiguity in the Metaschema module, documentation string, and the tool error that you have reported.

ERROR] [/system-security-plan/system-implementation[1]/component[12]] Expect constraint 'not(exists((.)[not(@type='service')]/protocol))' did not match the data at path '/system-security-plan/system-implementation[1]/component[12]'

Cannot determine what the error means, to correct.

This refers to this Metaschema constraint, which is to say the protocol is only allowed within component definitions only of type="service" and not others. If you wish to recommend a change to this requirement, we recommend you open a separate issue for the OSCAL models in usnistgov/OSCAL. Sorry to ask this after I relocated the issue, I didn't mean to give you the run-around.

Now, let's address the other part.

However the attributes "end" and "start" are swapped, resulting in additional warnings.

First, I see this example is in XML (thanks for reporting with a full example; seriously, this is very much appreciated! I bring up XML because, with XML schema language and the Metaschema constraints expressed by them, the order is deterministic (not like JSON): you must put them in the correct order.

So in both cases, these are correct behavior and expected per the schema. If I misunderstood, feel free to reopen this issue and I will examine accordingly.

@Telos-sa
Copy link
Author

Telos-sa commented Aug 28, 2023 via email

@Telos-sa
Copy link
Author

Telos-sa commented Aug 30, 2023 via email

@aj-stein-nist
Copy link
Collaborator

aj-stein-nist commented Aug 30, 2023 via email

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
None yet
Development

No branches or pull requests

2 participants