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 -Validastion is throwing an error oscal-cli version 0.3.4-SNAPSHOT #141

Closed
ThomAPenn opened this issue May 16, 2023 · 4 comments · Fixed by #150
Closed

Oscal-cli -Validastion is throwing an error oscal-cli version 0.3.4-SNAPSHOT #141

ThomAPenn opened this issue May 16, 2023 · 4 comments · Fixed by #150
Assignees
Labels
bug Something isn't working

Comments

@ThomAPenn
Copy link

Describe the bug

Validation is throwing an error. It actually appears to return values but it is probably a org.xml.sax.SAXParseException.

�[97m[�[0;91mERROR�[0;97m] �[mcvc-pattern-valid: Value '2022-12-04T16:53:07.175494800-05:00' is not facet-valid with respect to pattern '(((2000|2400|2800|(19|20-9))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9][1-9])?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))?' for type 'oscal-metadata-last-modified-FIELD'. [file:///home/AwesomeCloudSSP2.xml{8,75}]
org.xml.sax.SAXParseException: cvc-pattern-valid: Value '2022-12-04T16:53:07.175494800-05:00' is not facet-valid with respect to pattern '(((2000|2400|2800|(19|20-9))-02-29)|(((19|2[0-9])[0-9]{2})-02-(0[1-9]|1[0-9]|2[0-8]))|(((19|2[0-9])[0-9]{2})-(0[13578]|10|12)-(0[1-9]|[12][0-9]|3[01]))|(((19|2[0-9])[0-9]{2})-(0[469]|11)-(0[1-9]|[12][0-9]|30)))T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(.[0-9]
[1-9])?(Z|(-((0[0-9]|1[0-2]):00|0[39]:30)|+((0[0-9]|1[0-4]):00|(0[34569]|10):30|(0[58]|12):45)))?' for type 'oscal-metadata-last-modified-FIELD'.

Who is the bug affecting?

oscal-cli version 0.3.4-SNAPSHOT built on 2023-05-15 13:09 on commit a39d0b0
OSCAL version @oscal-git.closest.tag.name@ on commit @oscal-git.commit.id.abbrev@

What is affected by this bug?

Oscal-cli Validations

How do we replicate the issue?

oscal-cli ssp validate –as xml AwesomeCloudSSP2.xml

If applicable, add screenshots to help explain your problem.

Expected behavior (i.e. solution)

To show validation from the cli to of SSP

Other Comments

@ThomAPenn ThomAPenn added the bug Something isn't working label May 16, 2023
@GaryGapinski
Copy link

@ThomAPenn : usnistgov/OSCAL#1774 is worth a look. The regex you have cited in this issue is flawed (the (.[0-9][1-9])?fractional seconds portion is not correct).

@aj-stein-nist
Copy link
Collaborator

@ThomAPenn : usnistgov/OSCAL#1774 is worth a look. The regex you have cited in this issue is flawed (the (.[0-9][1-9])?fractional seconds portion is not correct).

I was looking at the sample sent via email and it has a very long last-modified timestamp: 2022-12-04T16:53:07.175494800-05:00.
I had to work through some additional warnings and errors that were unrelated to get to a clean validation.

That said, to work around it, you can avoid this for by now providing fractional seconds, right? Try something like 2022-12-04T21:53:07Z, as recommended in usnistgov/OSCAL#1774 (comment) by Gary?

In any event, this is sourced from errata in an OSCAL pre-release already reported. That must be fixed and bumped in the submodule of liboscal-java for a next release to resolve this, so I will move this to liboscal-java. Thanks for reporting!

@aj-stein-nist aj-stein-nist transferred this issue from usnistgov/oscal-cli May 16, 2023
david-waltermire added a commit to david-waltermire/metaschema that referenced this issue Jun 8, 2023
david-waltermire added a commit to david-waltermire/metaschema that referenced this issue Jun 8, 2023
david-waltermire added a commit to usnistgov/metaschema that referenced this issue Jun 26, 2023
* Allow proceeding zeros in factional sections. usnistgov/liboscal-java#141
* Corrected time examples and added examples of fractional seconds with trailing zeros.
@aj-stein-nist aj-stein-nist linked a pull request Jul 3, 2023 that will close this issue
8 tasks
@aj-stein-nist aj-stein-nist added this to the v1.0.6 Release milestone Jul 3, 2023
@david-waltermire
Copy link
Collaborator

The updated test for this is in metaschema-java. It includes fractional seconds with trailing zeros, proving this issue is fixed.

@aj-stein-nist
Copy link
Collaborator

This should now be resolved in the 2.0.0 release from this evening and a pending oscal-cli update. Closing.

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

Successfully merging a pull request may close this issue.

4 participants