Skip to content

Commit

Permalink
Add issue-1032 constraints and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis committed Dec 30, 2024
1 parent 0e2ce18 commit 6a2034b
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 0 deletions.
6 changes: 6 additions & 0 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Examples:
| cia-impact-has-adjustment-justification |
| cia-impact-has-selected |
| cloud-service-model |
| component-has-authenticated-scan |
| component-has-authentication-method |
| component-has-non-provider-responsible-role |
| component-has-provider-responsible-role |
Expand Down Expand Up @@ -118,6 +119,7 @@ Examples:
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
| inventory-item-has-authenticated-scan |
| inventory-item-has-vendor-name |
| inventory-item-public |
| inventory-item-virtual |
Expand Down Expand Up @@ -201,6 +203,8 @@ Examples:
| cia-impact-has-selected-PASS.yaml |
| cloud-service-model-FAIL.yaml |
| cloud-service-model-PASS.yaml |
| component-has-authenticated-scan-FAIL.yaml |
| component-has-authenticated-scan-PASS.yaml |
| component-has-authentication-method-FAIL.yaml |
| component-has-authentication-method-PASS.yaml |
| component-has-non-provider-responsible-role-FAIL.yaml |
Expand Down Expand Up @@ -365,6 +369,8 @@ Examples:
| inventory-item-allows-authenticated-scan-PASS.yaml |
| inventory-item-and-component-has-public-FAIL.yaml |
| inventory-item-and-component-has-public-PASS.yaml |
| inventory-item-has-authenticated-scan-FAIL.yaml |
| inventory-item-has-authenticated-scan-PASS.yaml |
| inventory-item-has-vendor-name-FAIL.yaml |
| inventory-item-has-vendor-name-PASS.yaml |
| inventory-item-public-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ leveraged-authorization assembly:</p>
</description>

<prop name="implementation-point" value="internal"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop name="public" value="no"/>
<prop name="connection-security" value="tls-1.3" ns="http://fedramp.gov/ns/oscal"/>
<prop ns="http://fedramp.gov/ns/oscal" name="provider" value="self"/>
Expand Down Expand Up @@ -1650,6 +1651,7 @@ property.</p>
<p>Describe the service and what it is used for.</p>
</description>
<prop name="implementation-point" value="internal"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop name="public" value="yes"/>
<status state="operational"/>
</component>
Expand Down Expand Up @@ -2357,6 +2359,7 @@ preferable to the link[rel='validation'] example above.</p>
<!-- Todo: check why schematron validation is indicating that this is not a valid ipv4 value -->
<prop name="ipv6-address" value="0000:0000:0000:0000:0000:ffff:0a03:0303"/>
<prop name="is-scanned" value="yes"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop ns="http://fedramp.gov/ns/oscal" name="vendor-name" value="Vendor"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000008"/>
Expand All @@ -2372,6 +2375,7 @@ preferable to the link[rel='validation'] example above.</p>
<prop name="ipv4-address" value="10.4.4.4"/>
<prop name="ipv6-address" value="0000:0000:0000:0000:0000:ffff:0a04:0404"/>
<prop name="is-scanned" value="yes"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop ns="http://fedramp.gov/ns/oscal" name="vendor-name" value="Vendor"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000007"/>
Expand All @@ -2387,6 +2391,7 @@ preferable to the link[rel='validation'] example above.</p>
<prop name="virtual" value="no"/>
<prop name="public" value="yes"/>
<prop name="is-scanned" value="yes"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop ns="http://fedramp.gov/ns/oscal" name="vendor-name" value="Vendor"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000011"/>
Expand All @@ -2407,6 +2412,7 @@ preferable to the link[rel='validation'] example above.</p>
<p>Asset wasn't running at time of scan.</p>
</remarks>
</prop>
<prop name="allows-authenticated-scan" value="yes"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000007"/>
</inventory-item>
<inventory-item uuid="11111111-2222-4000-8000-011000000007">
Expand All @@ -2420,6 +2426,7 @@ preferable to the link[rel='validation'] example above.</p>
<prop name="virtual" value="no"/>
<prop name="public" value="no"/>
<prop name="is-scanned" value="yes"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop ns="http://fedramp.gov/ns/oscal" name="vendor-name" value="Vendor"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000008"/>
Expand All @@ -2440,6 +2447,7 @@ preferable to the link[rel='validation'] example above.</p>
<p>Asset wasn't running at time of scan.</p>
</remarks>
</prop>
<prop name="allows-authenticated-scan" value="yes"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000007"/>
</inventory-item>
<inventory-item uuid="11111111-2222-4000-8000-011000000009">
Expand All @@ -2453,6 +2461,7 @@ preferable to the link[rel='validation'] example above.</p>
<prop name="virtual" value="yes"/>
<prop name="public" value="no"/>
<prop name="is-scanned" value="yes"/>
<prop name="allows-authenticated-scan" value="yes"/>
<prop ns="http://fedramp.gov/ns/oscal" name="vendor-name" value="Vendor"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<implemented-component component-uuid="11111111-2222-4000-8000-009000000018"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0" uuid="11111111-2222-4000-8000-000000000000">
<system-implementation>
<component uuid="11111111-2222-4000-8000-009000500004" type="service">
<!-- <prop name="allows-authenticated-scan" value="yes"/> Missing allows-authenticated-scan prop. -->
<prop name="implementation-point" value="internal"/>
</component>
</system-implementation>
</system-security-plan>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0" uuid="11111111-2222-4000-8000-000000000000">
<system-implementation>
<component type="service" uuid="11111111-2222-4000-8000-009000000007">
<!-- <prop name="allows-authenticated-scan" value="yes"/> Missing allows-authenticated-scan prop. -->
</component>
<inventory-item uuid="11111111-2222-4000-8000-011000000001">
<!-- <prop name="allows-authenticated-scan" value="yes"/> Missing allows-authenticated-scan prop. -->
<implemented-component component-uuid="11111111-2222-4000-8000-009000000007">
</implemented-component>
</inventory-item>
</system-implementation>
</system-security-plan>
16 changes: 16 additions & 0 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,26 @@
</constraints>
</context>

<context>
<metapath target="/system-security-plan/system-implementation/component"/>
<constraints>
<expect id="component-has-authenticated-scan" target=".[@type='service' and prop[@name='implementation-point' and @value='internal']]" test="count(prop[@name='allows-authenticated-scan']) = 1" level="ERROR">
<formal-name>Component Has Authenticated Scan</formal-name>
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/5-attachments/#system-inventory-approach"/>
<message>In a FedRAMP SSP, each internal service component MUST state whether it allows authenticated scans.</message>
</expect>
</constraints>
</context>

<context>
<metapath target="/system-security-plan/system-implementation/inventory-item"/>
<constraints>
<let var ="component-uuid" expression="implemented-component/@component-uuid"/>
<expect id="inventory-item-has-authenticated-scan" target="." test="count(prop[@name='allows-authenticated-scan']) >= 1 or count(../component[@uuid=$component-uuid]/prop[@name='allows-authenticated-scan']) = 1" level="ERROR">
<formal-name>Inventory Item Has Authenticated Scan</formal-name>
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/5-attachments/#system-inventory-approach"/>
<message>In a FedRAMP SSP, each inventory item MUST state whether it allows authenticated scans in the inventory item itself or within the linked component.</message>
</expect>
<expect id="inventory-item-has-vendor-name" target="." test="count(prop[@name='vendor-name' and @ns='http://fedramp.gov/ns/oscal']) >= 1 or count(../component[@uuid=$component-uuid]/prop[@name='vendor-name' and @ns='http://fedramp.gov/ns/oscal']) >= 1" level="ERROR">
<formal-name>Inventory Item Has Vendor Name</formal-name>
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/5-attachments/#system-inventory-approach"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for component-has-authenticated-scan
description: >-
This test case validates the behavior of constraint
component-has-authenticated-scan
content: ../content/ssp-component-has-authenticated-scan-INVALID.xml
expectations:
- constraint-id: component-has-authenticated-scan
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for component-has-authenticated-scan
description: >-
This test case validates the behavior of constraint
component-has-authenticated-scan
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: component-has-authenticated-scan
result: pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for inventory-item-has-authenticated-scan
description: >-
This test case validates the behavior of constraint
inventory-item-has-authenticated-scan
content: ../content/ssp-inventory-item-has-authenticated-scan-INVALID.xml
expectations:
- constraint-id: inventory-item-has-authenticated-scan
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for inventory-item-has-authenticated-scan
description: >-
This test case validates the behavior of constraint
inventory-item-has-authenticated-scan
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: inventory-item-has-authenticated-scan
result: pass

0 comments on commit 6a2034b

Please sign in to comment.