Skip to content

Commit

Permalink
Add 'inventory-item-has-software-version' constraint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis committed Dec 26, 2024
1 parent b79ec53 commit fdd39f0
Show file tree
Hide file tree
Showing 6 changed files with 54 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 @@ -115,6 +115,7 @@ Examples:
| interconnection-direction |
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-has-software-version |
| inventory-item-public |
| inventory-item-virtual |
| leveraged-authorization-has-authorization-type |
Expand Down Expand Up @@ -354,6 +355,8 @@ Examples:
| interconnection-security-PASS.yaml |
| inventory-item-allows-authenticated-scan-FAIL.yaml |
| inventory-item-allows-authenticated-scan-PASS.yaml |
| inventory-item-has-software-version-FAIL.yaml |
| inventory-item-has-software-version-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 @@ -2248,6 +2248,7 @@ approved.</p>
<p>Legacy Example (No implemented-component).</p>
</description>
<!--<prop name="asset-id" value="unique-asset-ID-01"/>-->
<prop name="software-version" value="software-version"/>
<prop name="ipv4-address" value="10.1.1.1"/>
<prop name="ipv6-address" value="2001:db8:3333:4444:5555:6666:7777:8888"/>
<prop name="virtual" value="no"/>
Expand Down Expand Up @@ -2307,6 +2308,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>Component Inventory Example</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-02"/>
<prop name="ipv4-address" value="10.2.2.2"/>
<prop name="ipv6-address" value="0000:0000:0000:0000:0000:ffff:0a02:0202"/>
Expand Down Expand Up @@ -2345,6 +2347,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>None.</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-03"/>
<prop name="asset-type" value="web-server"/>
<prop name="virtual" value="yes"/>
Expand All @@ -2360,6 +2363,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>None.</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-04"/>
<prop name="asset-type" value="appliance"/>
<prop name="virtual" value="yes"/>
Expand All @@ -2374,6 +2378,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>None.</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-05"/>
<prop name="asset-type" value="firewall"/>
<prop name="ipv4-address" value="10.5.5.5"/>
Expand All @@ -2388,6 +2393,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>None.</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-06"/>
<prop name="ipv4-address" value="10.6.6.6"/>
<prop name="ipv6-address" value="0000:0000:0000:0000:0000:ffff:0a06:0606"/>
Expand All @@ -2405,6 +2411,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>None.</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-07"/>
<prop name="asset-type" value="switch"/>
<prop name="ipv4-address" value="10.7.7.7"/>
Expand All @@ -2419,6 +2426,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>None.</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-08"/>
<prop name="asset-type" value="web-server"/>
<prop name="ipv4-address" value="10.8.8.8"/>
Expand All @@ -2436,6 +2444,7 @@ preferable to the link[rel='validation'] example above.</p>
<description>
<p>Email-Service</p>
</description>
<prop name="software-version" value="software-version"/>
<prop name="asset-id" value="unique-asset-ID-09"/>
<prop name="asset-type" value="email-server"/>
<prop name="ipv4-address" value="10.10.10.100"/>
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-009000000007" type="process-procedure">
<!-- <prop name="software-version" value="software-version"/> Missing software-version in linked component-->
</component>
<inventory-item uuid="11111111-2222-4000-8000-011000000001">
<!-- <prop name="software-version" value="software-version"/> Missing software-version in inventory-item.-->
<implemented-component component-uuid="11111111-2222-4000-8000-009000000007">
</implemented-component>
</inventory-item>
</system-implementation>
</system-security-plan>
12 changes: 12 additions & 0 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,18 @@
</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-software-version" target="." 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/4-ssp-template-to-oscal-mapping/#tbd"/>
<message>In a FedRAMP SSP, each inventory item MUST define the software version in the inventory item itself or within the linked component.</message>
</expect>
</constraints>
</context>

<context>
<metapath target="/(assessment-plan|assessment-results|plan-of-action-and-milestones|system-security-plan)/metadata"/>
<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-has-software-version
description: >-
This test case validates the behavior of constraint
inventory-item-has-software-version
content: ../content/ssp-inventory-item-has-software-version-INVALID.xml
expectations:
- constraint-id: inventory-item-has-software-version
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-software-version
description: >-
This test case validates the behavior of constraint
inventory-item-has-software-version
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: inventory-item-has-software-version
result: pass

0 comments on commit fdd39f0

Please sign in to comment.