-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Add rules model and refs into component-definition model.
- Loading branch information
1 parent
bfd262a
commit 2242e65
Showing
2 changed files
with
207 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-model href="../../build/metaschema/schema/xml/metaschema.xsd" ?> | ||
<METASCHEMA xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0" abstract="yes"> | ||
<schema-name>OSCAL Rules -- Common Modules</schema-name> | ||
<schema-version>1.2.0</schema-version> | ||
<short-name>oscal-rules-common</short-name> | ||
<namespace>http://csrc.nist.gov/ns/oscal/1.0</namespace> | ||
<json-base-uri>http://csrc.nist.gov/ns/oscal</json-base-uri> | ||
<remarks> | ||
<p>TODO</p> | ||
</remarks> | ||
<import href="oscal_metadata_metaschema.xml"/> | ||
<define-assembly name="rule-definition"> | ||
<formal-name>Rule Definition</formal-name> | ||
<description>TODO</description> | ||
<define-flag name="uuid" required="yes" as-type="uuid"> | ||
<formal-name>Rule Definition Universally Unique Identifier</formal-name> | ||
<description>TODO</description> | ||
</define-flag> | ||
<model> | ||
<define-field name="title" as-type="markup-line" min-occurs="1"> | ||
<formal-name>Rule Title</formal-name> | ||
<description>A name given to the rule, which may be used by a tool for display and navigation.</description> | ||
</define-field> | ||
<define-field name="description" as-type="markup-multiline" min-occurs="1" in-xml="WITH_WRAPPER"> | ||
<formal-name>Rule Description</formal-name> | ||
<description>A summary of the rule, including the requirement(s) to be met when evaluating the rule against a target that the rule applies to.</description> | ||
</define-field> | ||
<assembly ref="property" max-occurs="unbounded"> | ||
<group-as name="props" in-json="ARRAY"/> | ||
</assembly> | ||
<assembly ref="link" max-occurs="unbounded"> | ||
<group-as name="links" in-json="ARRAY"/> | ||
</assembly> | ||
</model> | ||
<constraint> | ||
<allowed-values target="prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name"> | ||
<enum value="version">A string that identifies the revision of the rule.</enum> | ||
</allowed-values> | ||
<allowed-values target="link/@rel"> | ||
<enum value="source">A pointer to the resource that this rule is derived from.</enum> | ||
</allowed-values> | ||
</constraint> | ||
</define-assembly> | ||
<define-assembly name="test-definition"> | ||
<formal-name>Test Definition</formal-name> | ||
<description>TODO</description> | ||
<define-flag name="uuid" required="yes" as-type="uuid"> | ||
<formal-name>Test Definition Universally Unique Identifier</formal-name> | ||
<description>TODO</description> | ||
</define-flag> | ||
<model> | ||
<define-field name="title" as-type="markup-line" min-occurs="0" max-occurs="1"> | ||
<formal-name>Test Title</formal-name> | ||
<description>A name given to the test, which may be used by a tool for display and navigation.</description> | ||
</define-field> | ||
<define-field name="description" as-type="markup-multiline" in-xml="WITH_WRAPPER"> | ||
<formal-name>Test Description</formal-name> | ||
<description>A summary of the test, including implementation details of how its use examines an aspect or trait of a system.</description> | ||
</define-field> | ||
<assembly ref="property" max-occurs="unbounded"> | ||
<group-as name="props" in-json="ARRAY"/> | ||
</assembly> | ||
<assembly ref="link" max-occurs="unbounded"> | ||
<group-as name="links" in-json="ARRAY"/> | ||
</assembly> | ||
<!-- TODO: address activities and actions --> | ||
</model> | ||
<constraint> | ||
<allowed-values target="prop[has-oscal-namespace('http://csrc.nist.gov/ns/oscal')]/@name"> | ||
<enum value="version">A string that identifies the revision of the test.</enum> | ||
</allowed-values> | ||
<allowed-values target="link/@rel"> | ||
<enum value="source">A pointer to the resource that this test is derived from.</enum> | ||
</allowed-values> | ||
</constraint> | ||
</define-assembly> | ||
<define-assembly name="test-reference"> | ||
<formal-name>Test Reference</formal-name> | ||
<description>A reference to a test defined in this or an imported instance.</description> | ||
<define-flag name="test-uuid" required="yes" as-type="uuid"> | ||
<formal-name>Test Definition Universally Unique Identifier Reference</formal-name> | ||
<description>A reference to a test definition.</description> | ||
</define-flag> | ||
</define-assembly> | ||
<define-field name="testing-scenario-uuid" as-type="uuid"> | ||
<formal-name>Testing Scenario Universally Unique Identifier Reference</formal-name> | ||
<description>A reference to a testing scenario.</description> | ||
</define-field> | ||
<define-assembly name="rule-condition"> | ||
<formal-name>Rule Condition</formal-name> | ||
<description>A rule implementation condition</description> | ||
<define-flag name="negate" as-type="boolean" default="false"> | ||
<formal-name>Condition Negation</formal-name> | ||
<description>Determines if the result of evaluating the condition should be negated.</description> | ||
<remarks> | ||
<p>A condition can be negated using the following truth table.</p> | ||
<table> | ||
<tr><th>Result Value</th><th>Negation Value</th></tr> | ||
<tr><td>true</td><td>false</td></tr> | ||
<tr><td>false</td><td>true</td></tr> | ||
<tr><td>error</td><td>error</td></tr> | ||
<tr><td>not-applicable</td><td>not-applicable</td></tr> | ||
</table> | ||
</remarks> | ||
</define-flag> | ||
<define-flag name="operator" required="yes" as-type="token" default="and"> | ||
<formal-name>Rule Condition Operator</formal-name> | ||
<description>TODO</description> | ||
<constraint> | ||
<allowed-values allow-other="no"> | ||
<enum value="and">and</enum> | ||
<enum value="or">or</enum> | ||
</allowed-values> | ||
</constraint> | ||
</define-flag> | ||
<model> | ||
<assembly ref="rule-condition"> | ||
<use-name>pre-requisite</use-name> | ||
</assembly> | ||
<choice> | ||
<assembly ref="rule-condition" min-occurs="1" max-occurs="unbounded"> | ||
<use-name>condition</use-name> | ||
</assembly> | ||
<assembly ref="test-reference" min-occurs="1" max-occurs="unbounded"/> | ||
<field ref="testing-scenario-uuid" min-occurs="1" max-occurs="unbounded"/> | ||
</choice> | ||
</model> | ||
</define-assembly> | ||
<define-assembly name="testing-scenario"> | ||
<formal-name>Rule Testing Scenario</formal-name> | ||
<description>A rule testing scenario</description> | ||
<define-flag name="uuid" as-type="uuid" required="yes"> | ||
<formal-name>Testing Scenario Universally Unique Identifier</formal-name> | ||
<description>TODO</description> | ||
</define-flag> | ||
<define-flag name="rule-uuid" as-type="uuid" required="yes"> | ||
<formal-name>Rule Universally Unique Identifier Reference</formal-name> | ||
<description>A reference to a rule definition.</description> | ||
</define-flag> | ||
<model> | ||
<choice> | ||
<assembly ref="rule-condition" min-occurs="1"> | ||
<use-name>condition</use-name> | ||
</assembly> | ||
<assembly ref="test-reference" min-occurs="1" max-occurs="unbounded"/> | ||
</choice> | ||
</model> | ||
</define-assembly> | ||
<define-assembly name="rule-implementation"> | ||
<formal-name>Rule Implementation</formal-name> | ||
<description>TODO</description> | ||
<define-flag name="uuid" required="yes" as-type="uuid"> | ||
<formal-name>Rule Implementation Universally Unique Identifier</formal-name> | ||
<description>TODO</description> | ||
</define-flag> | ||
<define-flag name="test-scenario-uuid" as-type="uuid" required="yes"> | ||
<formal-name>Rule Universally Unique Identifier Reference</formal-name> | ||
<description>A rule UUID reference</description> | ||
</define-flag> | ||
<model> | ||
<define-field name="description" as-type="markup-multiline" in-xml="WITH_WRAPPER"> | ||
<formal-name>Rule Implementation Description</formal-name> | ||
<description>A summary of why the referenced test scenario is applicable in this context.</description> | ||
</define-field> | ||
<assembly ref="property" max-occurs="unbounded"> | ||
<group-as name="props" in-json="ARRAY"/> | ||
</assembly> | ||
<assembly ref="link" max-occurs="unbounded"> | ||
<group-as name="links" in-json="ARRAY"/> | ||
</assembly> | ||
</model> | ||
</define-assembly> | ||
</METASCHEMA> |