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 14, 2025
1 parent 26d8e2b commit 85e8c9b
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
3 changes: 3 additions & 0 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,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 @@ -404,6 +405,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 @@ -1525,6 +1525,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 @@ -1656,6 +1657,7 @@ property.</p>
</description>
<prop name="implementation-point" value="internal"/>
<prop name="public" value="yes"/>
<prop name="ipv4-address" value="10.10.10.100"/>
<prop ns="http://fedramp.gov/ns/oscal" name="scan-type" value="infrastructure"/>
<status state="operational"/>

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: 5 additions & 1 deletion src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,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>
<expect id="leveraged-authorization-has-authorization-type" target="leveraged-authorization" test="count(prop[@name='authorization-type'][@ns='http://fedramp.gov/ns/oscal']) = 1" level="ERROR">
<formal-name>Leveraged Authorization Has Authorization Type</formal-name>
<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/#leveraged-fedramp-authorized-services"/>
Expand Down Expand Up @@ -669,7 +674,6 @@
</constraints>
</context>


<context>
<metapath target="/system-security-plan/system-implementation/inventory-item"/>
<constraints>
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 85e8c9b

Please sign in to comment.