diff --git a/features/fedramp_extensions.feature b/features/fedramp_extensions.feature index 38fd678af..7aced5bef 100644 --- a/features/fedramp_extensions.feature +++ b/features/fedramp_extensions.feature @@ -119,6 +119,7 @@ Examples: | information-type-has-confidentiality-impact | | information-type-has-integrity-impact | | information-type-system | + | inter-boundary-component-has-information-type | | interconnection-direction | | interconnection-security | | inventory-item-allows-authenticated-scan | @@ -377,6 +378,8 @@ Examples: | information-type-id-PASS.yaml | | information-type-system-FAIL.yaml | | information-type-system-PASS.yaml | + | inter-boundary-component-has-information-type-FAIL.yaml | + | inter-boundary-component-has-information-type-PASS.yaml | | interconnection-direction-FAIL.yaml | | interconnection-direction-PASS.yaml | | interconnection-security-FAIL.yaml | diff --git a/features/steps/fedramp_extensions_steps.ts b/features/steps/fedramp_extensions_steps.ts index 44b2435df..601f7b8af 100644 --- a/features/steps/fedramp_extensions_steps.ts +++ b/features/steps/fedramp_extensions_steps.ts @@ -1,23 +1,22 @@ -import { BeforeAll, BeforeStep, Given, Then, When, setDefaultTimeout, world } from "@cucumber/cucumber"; +import { BeforeAll, Given, Then, When, setDefaultTimeout } from "@cucumber/cucumber"; import { expect } from "chai"; import { + existsSync, + mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync, - mkdirSync, - existsSync, } from "fs"; import { load } from "js-yaml"; -import { executeOscalCliCommand, resolveProfile, resolveProfileDocument, validateDocument} from "oscal"; -import {checkServerStatus} from 'oscal/dist/server.js' -import { dirname, join,parse, resolve } from "path"; -import { Exception, Log, Result } from "sarif"; +import { JSDOM } from 'jsdom'; +import { executeOscalCliCommand, formatSarifOutput, resolveProfileDocument, validateDocument } from "oscal"; +import { checkServerStatus } from 'oscal/dist/server.js'; +import { dirname, join, parse, resolve } from "path"; +import { Log } from "sarif"; import { fileURLToPath } from "url"; -import { parseString } from "xml2js"; -import {JSDOM} from 'jsdom' import { promisify } from "util"; -import {formatSarifOutput} from 'oscal' +import { parseString } from "xml2js"; 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' @@ -686,6 +685,7 @@ Then('I should have valid results {string}', async function (fileToValidate) { Then('I should verify that all constraints follow the style guide constraint', async function () { const baseDir = join(__dirname, '..', '..'); + const styleGuidePath = join(baseDir, 'src', 'validations', 'styleguides', 'fedramp-constraint-style.xml'); const constraintDir = join(baseDir, 'src', 'validations', 'constraints'); const constraintFiles = readdirSync(constraintDir).filter(file => file.startsWith('fedramp') && file.endsWith('.xml') @@ -701,7 +701,15 @@ Then('I should verify that all constraints follow the style guide constraint', a const fileContent = readFileSync(filePath, 'utf8'); const dom = new JSDOM(fileContent, { contentType: 'text/xml' }); const document = dom.window.document; - + const {isValid,log} = await validateDocument(filePath,{flags:['disable-schema'],quiet,extensions:[styleGuidePath],module:"http://csrc.nist.gov/ns/oscal/metaschema/1.0"},executor) + writeFileSync( + join( + __dirname, + "../../sarif/", + fileName.split(".xml").join("").toString()+".sarif" + ),JSON.stringify(log, null,"\t")) + const formattedErrors = (formatSarifOutput(log)); + formattedErrors&&errors.push(formattedErrors) // Process each 'constraints' block separately document.querySelectorAll('constraints').forEach(constraintsNode => { // Get direct child elements with IDs within this constraints block diff --git a/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml b/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml index 710ba036c..769cc3a18 100644 --- a/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml +++ b/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml @@ -1200,6 +1200,10 @@ leveraged-authorization assembly:
If 'yes', describe the authentication method.
@@ -2264,6 +2272,10 @@ approved.If 'yes', describe the authentication method.
diff --git a/src/validations/constraints/content/ssp-inter-boundary-component-has-information-type-INVALID.xml b/src/validations/constraints/content/ssp-inter-boundary-component-has-information-type-INVALID.xml new file mode 100644 index 000000000..5b248eef3 --- /dev/null +++ b/src/validations/constraints/content/ssp-inter-boundary-component-has-information-type-INVALID.xml @@ -0,0 +1,36 @@ + + +An non-authorized service provided by the Awesome Cloud leveraged authorization.
+Describe the service and what it is used for.
+If 'yes', describe the authentication method.
+If 'no', explain why no authentication is used.
+If 'not-applicable', attest explain why authentication is not applicable in the remarks.
+Each non-authorized leveraged service must be expressed as a "service" component.
+