Skip to content

Commit

Permalink
Add 'inventory-item-or-component-has-network' constraint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis committed Jan 9, 2025
1 parent 719cf2c commit 1765b26
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ Examples:
| inventory-item-has-valid-mac-address |
| inventory-item-has-vendor-name |
| inventory-item-or-component-has-asset-id |
| inventory-item-or-component-has-network |
| inventory-item-public |
| inventory-item-virtual |
| last-accessed-is-datetime |
Expand Down Expand Up @@ -385,6 +386,8 @@ Examples:
| inventory-item-has-vendor-name-PASS.yaml |
| inventory-item-or-component-has-asset-id-FAIL.yaml |
| inventory-item-or-component-has-asset-id-PASS.yaml |
| inventory-item-or-component-has-network-FAIL.yaml |
| inventory-item-or-component-has-network-PASS.yaml |
| inventory-item-public-FAIL.yaml |
| inventory-item-public-PASS.yaml |
| inventory-item-virtual-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1520,6 +1520,7 @@ leveraged-authorization assembly:</p>
<prop name="implementation-point" value="internal"/>
<prop name="public" value="no"/>
<prop name="connection-security" value="tls-1.3" ns="http://fedramp.gov/ns/oscal"/>
<prop name="ipv4-address" value="10.10.10.100"/>
<prop ns="http://fedramp.gov/ns/oscal" name="provider" value="self"/>
<prop ns="http://fedramp.gov/ns/oscal" name="direction" value="outgoing"/>
<prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="yes">
Expand Down Expand Up @@ -1651,6 +1652,7 @@ property.</p>
</description>
<prop name="implementation-point" value="internal"/>
<prop name="public" value="yes"/>
<prop name="ipv4-address" value="10.10.10.100"/>
<status state="operational"/>
</component>

Expand Down
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 uuid="11111111-2222-4000-8000-009000500004" type="service">
<prop name="implementation-point" value="internal"/>
<!-- <prop name="ipv4-address" value="10.10.10.100"/> Missing network.-->
</component>
<inventory-item uuid="11111111-2222-4000-8000-011000000009">
<!-- <prop name="ipv4-address" value="10.10.10.100"/> Missing network.-->
<!-- <prop name="ipv6-address" value="0000:0000:0000:0000:0000:ffff:0a08:0808"/> Missing network.-->
</inventory-item>
</system-implementation>
</system-security-plan>
6 changes: 6 additions & 0 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,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>In a FedRAMP SSP, each inventory item and software image component MUST include the asset ID.</message>
</expect>
<expect id="inventory-item-or-component-has-network" target="(inventory-item)| (component[@type='service' and prop[@name='implementation-point' and @value='internal']])" test="count(prop[@name=('ipv4-address', 'ipv6-address', 'fqdn', 'uri')]) >= 1" level="WARNING">
<formal-name>Inventory Item or Component Has Network</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 and internal service component SHOULD be reachable via a network.</message>
</expect>
</constraints>
</context>

Expand All @@ -667,6 +672,7 @@
<formal-name>Inventory Item Has Software 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"/>
<message>In a FedRAMP SSP, each inventory item MUST include the software name in the inventory item itself or within the linked component.</message>
</expect>
<expect id="inventory-item-has-software-version" target=".[prop[@name='asset-type' and @value=('operating-system', 'container', 'image')] or ../component[uuid=$component-uuid and type='software']]" test="count(prop[@name=('software-version', 'os-version')]) = 1 or count(../component[@uuid=$component-uuid]/prop[@name=('software-version', 'os-version')]) = 1" level="ERROR">
<formal-name>Inventory Item Has Software Version</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 inventory-item-or-component-has-network
description: >-
This test case validates the behavior of constraint
inventory-item-or-component-has-network
content: ../content/ssp-inventory-item-or-component-has-network-INVALID.xml
expectations:
- constraint-id: inventory-item-or-component-has-network
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for inventory-item-or-component-has-network
description: >-
This test case validates the behavior of constraint
inventory-item-or-component-has-network
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: inventory-item-or-component-has-network
result: pass

0 comments on commit 1765b26

Please sign in to comment.