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 Jan 10, 2025
1 parent 60ba7f7 commit 8e5f6c9
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 1 deletion.
6 changes: 6 additions & 0 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,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 @@ -124,6 +125,7 @@ Examples:
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
| inventory-item-has-authenticated-scan |
| inventory-item-has-function |
| inventory-item-has-scan-type |
| inventory-item-has-valid-mac-address |
Expand Down Expand Up @@ -214,6 +216,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 @@ -388,6 +392,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-function-FAIL.yaml |
| inventory-item-has-function-PASS.yaml |
| inventory-item-has-scan-type-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,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 @@ -1655,6 +1656,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"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<status state="operational"/>
Expand Down Expand Up @@ -2415,6 +2417,7 @@ approved.</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"/>

Expand All @@ -2436,6 +2439,7 @@ approved.</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="other">
<remarks><p>a different kind of scan</p></remarks>
Expand All @@ -2453,6 +2457,7 @@ approved.</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"/>

Expand All @@ -2479,6 +2484,7 @@ approved.</p>
<p>Asset wasn't running at time of scan.</p>
</remarks>
</prop>
<prop name="allows-authenticated-scan" value="yes"/>
<prop name="function" value="Required brief, text-based description.">
<remarks>
<p>Required, longer, formatted description.</p>
Expand All @@ -2499,6 +2505,7 @@ approved.</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"/>
<prop name="function" value="Required brief, text-based description.">
Expand All @@ -2524,6 +2531,7 @@ approved.</p>
<p>Asset wasn't running at time of scan.</p>
</remarks>
</prop>
<prop name="allows-authenticated-scan" value="yes"/>
<prop name="function" value="Required brief, text-based description.">
<remarks>
<p>Optional, longer, formatted description.</p>
Expand All @@ -2543,6 +2551,7 @@ approved.</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"/>
<prop name='function' value='virtual'><remarks><p>virtual function</p></remarks></prop>
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: 15 additions & 1 deletion src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -665,10 +665,19 @@
<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/#ports-protocols-and-services"/>
<message>A FedRAMP SSP's component MUST reference the existing component(s) that use it via network communication. However, component "{../@uuid}" references a nonexistent component "{@href}".</message>
</expect>

</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"/>
Expand All @@ -688,6 +697,11 @@
<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>For HIGH-impact systems, every inventory-item MUST identify an asset-owner or administrator property either within the inventory-item itself, or within the component linked by the inventory-item.</message>
</expect>
<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-function" target="." test="exists(prop[@name='function']/remarks) or exists($implemented-component/prop[@name='function']/remarks)" level="ERROR">
<formal-name>Inventory Item Has Function</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 8e5f6c9

Please sign in to comment.