Skip to content

Commit

Permalink
Add 'inventory-item-has-software-name' constraint and tests (GSA#1038)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis authored and wandmagic committed Jan 10, 2025
1 parent f556138 commit b9ca17a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
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-name" value="software-name"/> Missing software-name in linked component-->
</component>
<inventory-item uuid="11111111-2222-4000-8000-011000000001">
<prop name="asset-type" value="operating-system"/>
<!-- <prop name="software-name" value="software-name"/> Missing software-name in inventory-item.-->
<implemented-component component-uuid="11111111-2222-4000-8000-009000000007">
</implemented-component>
</inventory-item>
</system-implementation>
</system-security-plan>
4 changes: 4 additions & 0 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,10 @@
<let var="moderate-sensitivity" expression="../../system-characteristics/security-sensitivity-level='fips-199-moderate'"/>

<let var ="component-uuid" expression="implemented-component/@component-uuid"/>
<expect id="inventory-item-has-software-name" target=".[prop[@name='asset-type' and @value=('operating-system', 'container', 'image')] or ../component[uuid=$component-uuid and type='software']]" test="count(prop[@name=('software-name', 'os-name')]) = 1 or count(../component[@uuid=$component-uuid]/prop[@name=('software-name', 'os-name')]) = 1" level="ERROR">
<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>
<let var ="implemented-component" expression="../component[@uuid=$component-uuid]"/>
<expect id="authenticated-scan-no-has-remarks" target="prop[@name='allows-authenticated-scan' and @value='no']" test="if ($high-sensitivity or $moderate-sensitivity) then exists(remarks) else true()" level="ERROR">
<formal-name>Authenticated Scan No Has Remarks</formal-name>
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-name
description: >-
This test case validates the behavior of constraint
inventory-item-has-software-name
content: ../content/ssp-inventory-item-has-software-name-INVALID.xml
expectations:
- constraint-id: inventory-item-has-software-name
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-name
description: >-
This test case validates the behavior of constraint
inventory-item-has-software-name
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: inventory-item-has-software-name
result: pass

0 comments on commit b9ca17a

Please sign in to comment.