Skip to content

Commit

Permalink
Merge branch 'develop' into add-inter-boundary-communication-has-dire…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
DimitriZhurkin authored Dec 4, 2024
2 parents 956f9a7 + 5f7ce81 commit cf15a77
Show file tree
Hide file tree
Showing 29 changed files with 5,218 additions and 116 deletions.
22 changes: 15 additions & 7 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ Scenario Outline: Validating OSCAL constraints with metaschema constraints

@integration
Scenario Outline: Documents that should be valid are pass
Given I have loaded all Metaschema extensions documents
Then I should have valid results "<valid_file>"
Examples:
| valid_file |
| ssp-all-VALID.xml |
| ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml |
# | ssp-all-VALID.xml |
# | ../../../content/awesome-cloud/xml/AwesomeCloudSSP1.xml |
# | ../../../content/awesome-cloud/xml/AwesomeCloudSSP2.xml |

Expand All @@ -36,6 +38,7 @@ Examples:
| cia-impact-has-selected |
| cloud-service-model |
| component-has-authentication-method |
| component-has-non-provider-responsible-role |
| component-has-provider-responsible-role |
| component-type |
| control-implementation-status |
Expand Down Expand Up @@ -114,6 +117,9 @@ Examples:
| leveraged-authorization-nature-of-agreement |
| marking |
| missing-response-components |
| network-component-has-connection-security-prop |
| network-component-has-implementation-point |
| non-provider-responsible-role-references-user |
| party-has-name |
| privilege-level |
| prop-response-point-has-cardinality-one |
Expand All @@ -136,9 +142,7 @@ Examples:
| unique-inventory-item-asset-id |
| user-authentication |
| user-has-authorized-privilege |
| user-has-privilege-level |
| user-has-role-id |
| user-has-sensitivity-level |
| user-has-user-type |
| user-privilege-level |
| user-sensitivity-level |
Expand Down Expand Up @@ -180,6 +184,8 @@ Examples:
| cloud-service-model-PASS.yaml |
| component-has-authentication-method-FAIL.yaml |
| component-has-authentication-method-PASS.yaml |
| component-has-non-provider-responsible-role-FAIL.yaml |
| component-has-non-provider-responsible-role-PASS.yaml |
| component-responsible-role-references-party-FAIL.yaml |
| component-responsible-role-references-party-PASS.yaml |
| component-type-FAIL.yaml |
Expand Down Expand Up @@ -336,6 +342,12 @@ Examples:
| marking-PASS.yaml |
| missing-response-components-FAIL.yaml |
| missing-response-components-PASS.yaml |
| network-component-has-connection-security-prop-FAIL.yaml |
| network-component-has-connection-security-prop-PASS.yaml |
| network-component-has-implementation-point-FAIL.yaml |
| network-component-has-implementation-point-PASS.yaml |
| non-provider-responsible-role-references-user-FAIL.yaml |
| non-provider-responsible-role-references-user-PASS.yaml |
| party-has-name-FAIL.yaml |
| party-has-name-PASS.yaml |
| privilege-level-FAIL.yaml |
Expand Down Expand Up @@ -380,12 +392,8 @@ Examples:
| user-authentication-PASS.yaml |
| user-has-authorized-privilege-FAIL.yaml |
| user-has-authorized-privilege-PASS.yaml |
| user-has-privilege-level-FAIL.yaml |
| user-has-privilege-level-PASS.yaml |
| user-has-role-id-FAIL.yaml |
| user-has-role-id-PASS.yaml |
| user-has-sensitivity-level-FAIL.yaml |
| user-has-sensitivity-level-PASS.yaml |
| user-has-user-type-FAIL.yaml |
| user-has-user-type-PASS.yaml |
| user-privilege-level-FAIL.yaml |
Expand Down
5 changes: 3 additions & 2 deletions features/steps/fedramp_extensions_steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Exception, Log, Result } from "sarif";
import { fileURLToPath } from "url";
import { parseString } from "xml2js";
import { promisify } from "util";
import {formatSarifOutput,fedrampValidationOptions} from 'oscal'
import {formatSarifOutput} from 'oscal'
let executor: 'oscal-cli'|'oscal-server' = process.env.OSCAL_EXECUTOR as 'oscal-cli'|'oscal-server' || 'oscal-cli'
const quiet = process.env.OSCAL_TEST_QUIET === 'true'

Expand Down Expand Up @@ -678,7 +678,8 @@ Then('I should have valid results {string}', async function (fileToValidate) {
"src",
"validations","constraints","content",fileToValidate
);
const {isValid,log}=await validateDocument(fullPath,{quiet,...fedrampValidationOptions},executor);
const {isValid,log}=await validateDocument(fullPath,{quiet,
extensions:metaschemaDocuments.flatMap((x) => resolve(x))},executor);
expect(isValid,formatSarifOutput(log)).to.be.true;
});

Expand Down
Loading

0 comments on commit cf15a77

Please sign in to comment.