Skip to content

Commit

Permalink
Add inventory-item-and-component-has-public constraint and tests (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis authored Dec 30, 2024
1 parent d8965c1 commit 0e2ce18
Show file tree
Hide file tree
Showing 6 changed files with 39 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 @@ -117,6 +117,7 @@ Examples:
| interconnection-direction |
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
| inventory-item-has-vendor-name |
| inventory-item-public |
| inventory-item-virtual |
Expand Down Expand Up @@ -362,6 +363,8 @@ Examples:
| interconnection-security-PASS.yaml |
| inventory-item-allows-authenticated-scan-FAIL.yaml |
| 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-vendor-name-FAIL.yaml |
| inventory-item-has-vendor-name-PASS.yaml |
| inventory-item-public-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,7 @@ leveraged-authorization assembly:</p>
</description>

<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 ns="http://fedramp.gov/ns/oscal" name="provider" value="self"/>
<prop ns="http://fedramp.gov/ns/oscal" name="direction" value="outgoing"/>
Expand Down Expand Up @@ -1649,6 +1650,7 @@ property.</p>
<p>Describe the service and what it is used for.</p>
</description>
<prop name="implementation-point" value="internal"/>
<prop name="public" value="yes"/>
<status state="operational"/>
</component>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<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="public" value="no"/> Missing public prop. -->
</component>
<inventory-item uuid="11111111-2222-4000-8000-011000000002">
<!-- <prop name="public" value="no"/> Missing public prop. -->
</inventory-item>
</system-implementation>
</system-security-plan>
5 changes: 5 additions & 0 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@
<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"/>
<message>In a FedRAMP SSP, each information type property in a component MUST categorize the class of data flow as incoming to the system, outgoing from the system, or both.</message>
</expect>
<expect id="inventory-item-and-component-has-public" target="(inventory-item | component[@type='service' and prop[@name='implementation-point' and @value='internal']])" test="count(prop[@name='public']) = 1" level="ERROR">
<formal-name>Inventory Item and Component Has Public</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 MUST state if they are public-facing.</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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for inventory-item-and-component-has-public
description: >-
This test case validates the behavior of constraint
inventory-item-and-component-has-public
content: ../content/ssp-inventory-item-and-component-has-public-INVALID.xml
expectations:
- constraint-id: inventory-item-and-component-has-public
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for inventory-item-and-component-has-public
description: >-
This test case validates the behavior of constraint
inventory-item-and-component-has-public
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
expectations:
- constraint-id: inventory-item-and-component-has-public
result: pass

0 comments on commit 0e2ce18

Please sign in to comment.