Skip to content

Commit

Permalink
Add 'inventory-item-asset-types' constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis committed Feb 5, 2025
1 parent 11930be commit 31e28db
Show file tree
Hide file tree
Showing 6 changed files with 39 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 @@ -127,6 +127,7 @@ Examples:
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
| inventory-item-asset-types |
| inventory-item-has-asset-type |
| inventory-item-has-diagram-label |
| inventory-item-has-function |
Expand Down Expand Up @@ -402,6 +403,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-asset-types-FAIL.yaml |
| inventory-item-asset-types-PASS.yaml |
| inventory-item-has-asset-type-FAIL.yaml |
| inventory-item-has-asset-type-PASS.yaml |
| inventory-item-has-diagram-label-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ approved.</p>
</description>
<prop name='diagram-label' ns='http://fedramp.gov/ns/oscal' value='label'/>
<prop name="asset-id" value="unique-asset-ID-04"/>
<prop name="asset-type" value="appliance"/>
<prop name="asset-type" value="hardware"/>
<prop name="virtual" value="yes"/>
<prop name="public" value="no"/>
<prop name="ipv4-address" value="10.4.4.4"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0" uuid="11111111-2222-4000-8000-000000000000">
<system-implementation>
<inventory-item uuid="77777777-0000-4000-9000-000000000007">
<prop name="asset-type" value="hardware"/>
</inventory-item>
</system-implementation>
</system-security-plan>
10 changes: 10 additions & 0 deletions src/validations/constraints/fedramp-external-allowed-values.xml
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,16 @@
<enum value="no">No</enum>
</allowed-values>

<allowed-values id="inventory-item-asset-types" target="//inventory-item/prop[@name='asset-type']/@value" allow-other="yes" level="ERROR">
<formal-name>Inventory Item Asset Types</formal-name>
<description>Identifies the inventory item asset types recognized by FedRAMP.</description>
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/validation/catalog/?constraint-id=inventory-item-asset-types"/>
<enum value="hardware">Hardware</enum>
<enum value="infrastructure">Infrastructure</enum>
<enum value="network">Network</enum>
<enum value="software">Software</enum>
</allowed-values>

<allowed-values id="inventory-item-public" target="(//inventory-item | //component)/prop[@name='public']/@value" allow-other="no" level="ERROR">
<formal-name>Public</formal-name>
<description>Indicates if the asset is exposed to the public Internet.</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for inventory-item-asset-types
description: >-
This test case validates the behavior of constraint
inventory-item-asset-types
content: ../content/ssp-inventory-item-asset-types-INVALID.xml
expectations:
- constraint-id: inventory-item-asset-types
fail_count: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for inventory-item-asset-types
description: >-
This test case validates the behavior of constraint
inventory-item-asset-types
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: inventory-item-asset-types
result: pass

0 comments on commit 31e28db

Please sign in to comment.