oscal-compass / compliance-trestle

An opinionated tooling platform for managing compliance as code, using continuous integration and NIST's OSCAL standard.
https://oscal-compass.github.io/compliance-trestle
Apache License 2.0
161 stars 62 forks source link

Support to validate different / multiple conformance objectives. #54

Closed butler54 closed 3 years ago

butler54 commented 4 years ago

Issue description / feature objectives

Fedramp (as an example) have defined expected values / conformance within the OSCAL schema (see here:https://github.com/GSA/fedramp-automation/blob/master/documents/FedRAMP_OSCAL_Registry.xlsx) It would be a good feature if validation could be extended with a conformance format of some type.

Completion Criteria

butler54 commented 4 years ago

Will add more details - a placeholder for now.

butler54 commented 4 years ago

Based on discussion with Anca this is a need. The question is what language with which we express constraints. This looks promising https://github.com/amer-ali/jsontron - much like schematron would look like for xml.

butler54 commented 4 years ago

This issue is on validate an acceptable design only. I've tagged it for Sprint 2 with Shaila and Jeff both on this. I think this may be more work than we think.

shaila309 commented 4 years ago

@jeffdmgit Here is the jsontron tutorial as discussed: https://amer-ali.github.io/jsontron/Jsontron-tutorial-v1.pdf

shaila309 commented 3 years ago

Related issues open in usnistgov/metaschema

Summary (need-to-be-verified)

Code

The integration branch https://github.com/david-waltermire-nist/OSCAL/tree/metaschema-m4-integration has a working version of this.

shaila309 commented 3 years ago

Data validation using jsontron https://github.com/amer-ali/jsontron - Example

Starting Semantic Validation ......... Parsing Pattern: observation_properties 1 Pattern(s) Requested. 1 Pattern(s) Processed. 0 Pattern(s) Ignored. THIS INSTANCE IS SEMANTICALLY VALID Completed Semantic Validation ......... Total Errors Found: 0 Total Warnings Found: 1 Total Validations: 3 Total Failed Assertions: 0 Full Validation Report :

Report {
  errors: [],
  warnings: [
    {
      schInstance: [Object [global]],
      schema: [Object],
      attribute: 'Phase',
      message: 'Parsing Warning. No phase found ',
      detail: "This schema doesn't have any phase defined . All Patterns will be processed."
    }
  ],
  validations: [
    {
      schRule: [Object],
      ruleContext: [Array],
      assertionid: 'assertid1',
      assertionTest: "jp.query(contextNode, '$..ns') == 'IBM'",
      message: 'successful',
      assertionValid: true
    },
    {
      schRule: [Object],
      ruleContext: [Array],
      assertionid: 'assertid1',
      assertionTest: "jp.query(contextNode, '$..ns') == 'IBM'",
      message: 'successful',
      assertionValid: true
    },
    {
      schRule: [Object],
      ruleContext: [Array],
      assertionid: 'assertid1',
      assertionTest: "jp.query(contextNode, '$..ns') == 'IBM'",
      message: 'successful',
      assertionValid: true
    }
  ],
  finalValidationReport: [],
  valid: true
}
shaila309 commented 3 years ago

Oct 21: Discussion

butler54 commented 3 years ago
validate-discussion

Attachched image based on latest discussion.

shaila309 commented 3 years ago

Oct 26: Discussion

From validation perspective, the expected scenario is:

To be discussed:

shaila309 commented 3 years ago

@butler54 @jeffdmgit Here is the response from the OSCAL team on the issue of Validating extra-schema constraints over JSON: https://github.com/usnistgov/OSCAL/issues/726

butler54 commented 3 years ago

@vikas-agarwal76 - based on the exchange protocol requirements we should revisit this as an issue.