Skip to content

Commit

Permalink
818 fix data center (GSA#819)
Browse files Browse the repository at this point in the history
* fixed data center property arguments in ssp-all-VALID

* changed data-center constraints to point to name = type, value = data-center

* made unit tests much more specific to their file name, AKA only one error occurs in each file

* Update src/validations/constraints/content/ssp-data-center-US-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/content/ssp-data-center-alternate-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/content/ssp-data-center-country-code-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/content/ssp-data-center-primary-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/content/ssp-data-center-primary-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/content/ssp-data-center-US-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/fedramp-external-constraints.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/fedramp-external-constraints.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/fedramp-external-constraints.xml

Co-authored-by: A.J. Stein <[email protected]>

* Update src/validations/constraints/content/ssp-data-center-count-INVALID.xml

Co-authored-by: A.J. Stein <[email protected]>

---------

Co-authored-by: A.J. Stein <[email protected]>
  • Loading branch information
2 people authored and brian-ruf committed Nov 8, 2024
1 parent 9e9b001 commit 3113fac
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/validations/constraints/content/ssp-all-VALID.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
<address >
<country>US</country>
</address>
<prop name='data-center' value='dc-zone-1' class='primary'/>
<prop name="type" value="data-center" class="primary"/>
</location>
<location uuid="11111112-0000-4000-9000-000000000003">
<address >
<country>US</country>
</address>
<prop name='data-center' value='aws-us-west-1' class='alternate'/>
<prop name="type" value="data-center" class="alternate"/>
</location>
<party uuid="11111111-0000-4000-9000-000000000001" type="organization">
<name>Example Organization</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
<address >
<country>WRONG</country>
</address>
<prop name='data-center' value='dc-zone-1' class='tertiary'/>
<prop name="type" value="data-center" class="primary" />
</location>
<location uuid="11291112-0070-4000-9001-000890000009">
<address >
<country>WRONG</country>
</address>
<prop name="type" value="data-center" class="alternate" />
</location>
</metadata>
</system-security-plan>
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/1.0 https://github.com/usnistgov/OSCAL/releases/download/v1.1.2/oscal_ssp_schema.xsd"
uuid="12345678-1234-4321-8765-123456789012">
<metadata>
<location uuid="11155112-0340-4000-9001-000006500009">
<address >
<country>US</country>
</address>
<prop name='type' value='data-center' class='primary'/>
</location>
<location uuid="11111112-0000-4000-9001-000000000009">
<address >
<country>WRONG</country>
<country>US</country>
</address>
<prop name='data-center' value='dc-zone-1' class='tertiary'/>
<prop name="type" value="data-center" class="tertiary" />
</location>
</metadata>
</system-security-plan>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
uuid="12345678-1234-4321-8765-123456789012">
<metadata>
<location uuid="11111112-0000-4000-9001-000000000009">
<address >
<country>WRONG</country>
<address>
<country>US</country>
</address>
<prop name='data-center' value='dc-zone-1' class='tertiary'/>
<prop name="type" value="data-center" class="tertiary" />
</location>
</metadata>
</system-security-plan>
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
uuid="12345678-1234-4321-8765-123456789012">
<metadata>
<location uuid="11111112-0000-4000-9001-000000000009">
<address >
<address>
</address>
<prop name='data-center' value='dc-zone-1' class='tertiary'/>
<prop name='type' value='data-center' class='primary'/>
</location>
<location uuid="11117112-0080-4000-9001-001230000009">
<address>
</address>
<prop name="type" value="data-center" class="alternate" />
</location>
</metadata>
</system-security-plan>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
<metadata>
<location uuid="11111112-0000-4000-9001-000000000009">
<address >
<country>WRONG</country>
<country>US</country>
</address>
<prop name='data-center' value='dc-zone-1' class='tertiary'/>
<prop name="type" value="data-center" class="tertiary" />
</location>
<location uuid="11143112-0000-4320-9001-000066700009">
<address >
<country>US</country>
</address>
<prop name="type" value="data-center" class="alternate'"/>
</location>
</metadata>
</system-security-plan>
9 changes: 6 additions & 3 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,16 @@
<context>
<metapath target="/system-security-plan/metadata"/>
<constraints>
<expect id="data-center-count" target="." test="count(/location/prop[@name eq 'data-center']) &gt; 1">
<expect id="data-center-count" target="." test="count(/location/prop[@name eq 'type'][@value eq 'data-center']) &gt; 1">
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/4-ssp-template-to-oscal-mapping/#data-centers" />
<message>There must be at least two (2) data centers listed.</message>
</expect>
<expect id="data-center-primary" target="." test="count(/location/prop[@name eq 'data-center'][@class eq 'primary']) = 1">
<expect id="data-center-primary" target="." test="count(/location/prop[@name eq 'type'][@value eq 'data-center'][@class eq 'primary']) = 1">
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/4-ssp-template-to-oscal-mapping/#data-centers" />
<message>There must be a single primary data center.</message>
</expect>
<expect id="data-center-alternate" target="." test="count(/location/prop[@name eq 'data-center'][@class eq 'alternate']) &gt; 0">
<expect id="data-center-alternate" target="." test="count(/location/prop[@name eq 'type'][@value eq 'data-center'][@class eq 'alternate']) &gt; 0">
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/4-ssp-template-to-oscal-mapping/#data-centers" />
<message>There must be one or more alternate data center(s).</message>
</expect>
<expect id="role-defined-system-owner" target="." test="role[@id eq 'system-owner']" level="ERROR">
Expand Down

0 comments on commit 3113fac

Please sign in to comment.