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 fa461b0 commit 65a1491
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 @@ -115,6 +116,7 @@ Examples:
| interconnection-direction |
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-has-authenticated-scan |
| inventory-item-has-vendor-name |
| inventory-item-public |
| inventory-item-virtual |
Expand Down Expand Up @@ -198,6 +200,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 @@ -356,6 +360,8 @@ Examples:
| interconnection-security-PASS.yaml |
| inventory-item-allows-authenticated-scan-FAIL.yaml |
| inventory-item-allows-authenticated-scan-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="connection-security" value="tls-1.3" ns="http://fedramp.gov/ns/oscal"/>
<prop ns="http://fedramp.gov/ns/oscal" name="provider" value="self"/>
<prop ns="http://fedramp.gov/ns/oscal" name="direction" value="outgoing"/>
Expand Down Expand Up @@ -1649,6 +1650,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"/>
<status state="operational"/>
</component>

Expand Down Expand Up @@ -2355,6 +2357,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 @@ -2370,6 +2373,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 @@ -2385,6 +2389,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 @@ -2405,6 +2410,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 @@ -2418,6 +2424,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 @@ -2438,6 +2445,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 @@ -2451,6 +2459,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 @@ -637,10 +637,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 65a1491

Please sign in to comment.