usnistgov / oscal-cli

A simple open source command line tool to support common operations over OSCAL content.
Other
42 stars 19 forks source link

Profile resolution subcommand returns no error with invalid JSON and YAML profiles #216

Closed aj-stein-nist closed 5 months ago

aj-stein-nist commented 1 year ago

Describe the bug

When using a recent development snapshot of the oscal-cli with liboscal-java v3.0.2, writing tests for usnistgov/oscal-cli#178 uncovered that certain kinds of invalid JSON and YAML profiles can be resolved with output, but do not throw a relevant error like that of the XML profiles.

Who is the bug affecting?

Technical staff using oscal-cli to resolve JSON and YAML profiles.

What is affected by this bug?

Correct error reporting on invalid input profiles during profile resolution.

When does this occur?

Consistently under integration testing.

How do we replicate the issue?

(TBD: I will upload a modified copy of tests to demonstrate the error after finalizing the tests in the aforementioned branch.)

Expected behavior (i.e. solution)

The CLI will report an error and a relevant return code (ExitCode.PROCESSING_ERROR) like that of an invalid XML profile, caused by a ProfileResolutionException exception.

Other Comments

I will use this issue to report the problem, but it is not clear if the source of this issue is liboscal-java, oscal-cli code, or both. I will transfer accordingly once I have more details.

aj-stein-nist commented 9 months ago

This should be ready for fix once the next patch release comes through in liboscal-java and that dep gets updated here. Moving status from Needs Triage to To Do.

aj-stein-nist commented 9 months ago

I will have to add some relevant examples for unit/integration tests to work this, tentatively this week or next.