Skip to content

Commit

Permalink
[WIP] Add rules model and refs into component-definition model.
Browse files Browse the repository at this point in the history
  • Loading branch information
aj-stein-nist committed Aug 17, 2022
1 parent 4faaba2 commit 290b497
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/metaschema/oscal_component_metaschema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
</remarks>

<import href="oscal_implementation-common_metaschema.xml"/>
<import href="oscal_rules-common_metaschema.xml"/>

<define-assembly name="component-definition">
<formal-name>Component Definition</formal-name>
Expand All @@ -41,6 +42,17 @@
<assembly ref="import-component-definition" max-occurs="unbounded">
<group-as name="import-component-definitions" in-json="ARRAY"/>
</assembly>
<assembly ref="rule-definition" max-occurs="unbounded">
<use-name>rule</use-name>
<group-as name="rules" in-json="ARRAY"/>
</assembly>
<assembly ref="test-definition" max-occurs="unbounded">
<use-name>test</use-name>
<group-as name="tests" in-json="ARRAY"/>
</assembly>
<assembly ref="testing-scenario" max-occurs="unbounded">
<group-as name="testing-scenarios" in-json="ARRAY"/>
</assembly>
<assembly ref="defined-component" max-occurs="unbounded">
<use-name>component</use-name>
<group-as name="components" in-json="ARRAY"/>
Expand Down Expand Up @@ -118,6 +130,7 @@
<assembly ref="control-implementation" max-occurs="unbounded">
<group-as name="control-implementations" in-json="ARRAY"/>
</assembly>

<!--
<assembly ref="configuration" max-occurs="unbounded">
<group-as name="configurations" in-json="BY_KEY" />
Expand Down Expand Up @@ -375,6 +388,9 @@
<assembly ref="statement" max-occurs="unbounded">
<group-as name="statements" in-json="ARRAY"/>
</assembly>
<assembly ref="rule-condition">
<use-name>condition</use-name>
</assembly>
<field ref="remarks" in-xml="WITH_WRAPPER"/>
</model>
<constraint>
Expand Down Expand Up @@ -429,6 +445,9 @@
<assembly ref="responsible-role" max-occurs="unbounded">
<group-as name="responsible-roles" in-json="ARRAY"/>
</assembly>
<assembly ref="rule-implementation" max-occurs="unbounded">
<group-as name="rule-implementations" in-json="ARRAY"/>
</assembly>
<field ref="remarks" in-xml="WITH_WRAPPER"/>
</model>
<constraint>
Expand Down
105 changes: 105 additions & 0 deletions src/metaschema/oscal_rules-common_metaschema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>
</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>
</define-assembly>
<define-assembly name="testing-scenario">
<formal-name>Rule Testing Scenario</formal-name>
<description>A rule testing scenario</description>
<use-name>scenario</use-name>
<define-flag name="uuid" required="yes" as-type="uuid">
<formal-name>Testing Scenario Universally Unique Identifier</formal-name>
<description>TODO</description>
</define-flag>
<model>
<assembly ref="rule-condition" min-occurs="1">
<use-name>condition</use-name>
</assembly>
</model>
</define-assembly>
<define-assembly name="rule-condition">
<formal-name>Rule Condition</formal-name>
<description>A rule implementation condition</description>
<define-flag name="operator" required="yes" as-type="token">
<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>
<enum value="not">not</enum>
</allowed-values>
</constraint>
</define-flag>
<model>
<assembly ref="rule-condition">
<use-name>pre-condition</use-name>
</assembly>
<choice>
<assembly ref="rule-condition">
<use-name>condition</use-name>
</assembly>
<define-assembly name="test-reference" min-occurs="1" max-occurs="unbounded">
<formal-name>Test Reference</formal-name>
<description>TODO</description>
<define-flag name="uuid" required="yes" as-type="uuid">
<formal-name>Test Reference Universally Unique Identifier</formal-name>
<description>TODO</description>
</define-flag>
<define-flag name="test-uuid" required="yes" as-type="uuid">
<formal-name>Test Universally Unique Identifier Reference</formal-name>
<description>A test UUID reference</description>
</define-flag>
</define-assembly>
</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>
<model>
<define-assembly name="testing-scenario-reference">
<formal-name>Testing Scenario Reference</formal-name>
<description>A reference to a testing scenario.</description>
<define-flag name="uuid" required="yes" as-type="uuid">
<formal-name>Rule Reference Universally Unique Identifier</formal-name>
<description>TODO</description>
</define-flag>
<define-flag name="rule-uuid" required="yes" as-type="uuid">
<formal-name>Rule Universally Unique Identifier Reference</formal-name>
<description>A rule UUID reference</description>
</define-flag>
<define-flag name="test-scenario-uuid" required="yes" as-type="uuid">
<formal-name>Rule Universally Unique Identifier Reference</formal-name>
<description>A rule UUID reference</description>
</define-flag>
</define-assembly>
</model>
</define-assembly>
</METASCHEMA>

0 comments on commit 290b497

Please sign in to comment.