Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inventory-item-has-software-version constraint #1039

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Examples:
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
| inventory-item-has-software-version |
| inventory-item-has-valid-mac-address |
| inventory-item-has-vendor-name |
| inventory-item-or-component-has-asset-id |
Expand Down Expand Up @@ -373,6 +374,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-software-version-FAIL.yaml |
| inventory-item-has-software-version-PASS.yaml |
| inventory-item-has-valid-mac-address-FAIL.yaml |
| inventory-item-has-valid-mac-address-PASS.yaml |
| inventory-item-has-vendor-name-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2294,6 +2294,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
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<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="software">
<!-- <prop name="software-version" value="software-version"/> Missing software-version in linked component-->
</component>
<inventory-item uuid="11111111-2222-4000-8000-011000000001">
<prop name="asset-type" value="operating-system"/>
<!-- <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>
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,11 @@
<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=".[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"/>
<message>In a FedRAMP SSP, each inventory item MUST include the software version in the inventory item itself or within the linked component.</message>
</expect>
<expect id="inventory-item-has-valid-mac-address" target=".[prop[@name='mac-address']]/prop[@name='mac-address']" test="matches(@value, '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9a-fA-F]{4}\\.[0-9a-fA-F]{4}\\.[0-9a-fA-F]{4})$')" level="ERROR">
<formal-name>Inventory Item Has Valid Mac Address</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-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
Loading