-
Notifications
You must be signed in to change notification settings - Fork 96
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 iventory-item-or-component-has-virtual
Constraint
#1055
base: develop
Are you sure you want to change the base?
Conversation
@@ -651,6 +651,11 @@ | |||
<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 vendor name in the inventory item itself or within the linked component.</message> | |||
</expect> | |||
<expect id="iventory-item-or-component-has-virtual" target="." test="count(prop[@name='virtual']) = 1 or count(../component[@uuid=$component-uuid]/prop[@name='virtual']) = 1" level="ERROR"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BLOCKING: The constraint itself is fine / works as intended, but there's a minor typo in the constraint ID. Same goes for the content file, and unit tests.
<expect id="iventory-item-or-component-has-virtual" target="." test="count(prop[@name='virtual']) = 1 or count(../component[@uuid=$component-uuid]/prop[@name='virtual']) = 1" level="ERROR"> | |
<expect id="inventory-item-or-component-has-virtual" target="." test="count(prop[@name='virtual']) = 1 or count(../component[@uuid=$component-uuid]/prop[@name='virtual']) = 1" level="ERROR"> |
| iventory-item-or-component-has-virtual-FAIL.yaml | | ||
| iventory-item-or-component-has-virtual-PASS.yaml | | ||
| last-accessed-is-datetime-FAIL.yaml | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| iventory-item-or-component-has-virtual-FAIL.yaml | | |
| iventory-item-or-component-has-virtual-PASS.yaml | | |
| last-accessed-is-datetime-FAIL.yaml | | |
| inventory-item-or-component-has-virtual-FAIL.yaml | | |
| inventory-item-or-component-has-virtual-PASS.yaml | | |
| last-accessed-is-datetime-FAIL.yaml | |
@@ -0,0 +1,12 @@ | |||
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0" uuid="11111111-2222-4000-8000-000000000000"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend renaming file to "ssp-inventory-item-or-component-has-virtual-INVALID.xml"
test-case: | ||
name: Negative Test for iventory-item-or-component-has-virtual | ||
description: >- | ||
This test case validates the behavior of constraint | ||
iventory-item-or-component-has-virtual | ||
content: ../content/ssp-iventory-item-or-component-has-virtual-INVALID.xml | ||
expectations: | ||
- constraint-id: iventory-item-or-component-has-virtual | ||
result: fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recommend renaming file to "inventory-item-or-component-has-virtual-FAIL.yaml", and making the following changes:
test-case: | |
name: Negative Test for iventory-item-or-component-has-virtual | |
description: >- | |
This test case validates the behavior of constraint | |
iventory-item-or-component-has-virtual | |
content: ../content/ssp-iventory-item-or-component-has-virtual-INVALID.xml | |
expectations: | |
- constraint-id: iventory-item-or-component-has-virtual | |
result: fail | |
name: Negative Test for inventory-item-or-component-has-virtual | |
description: >- | |
This test case validates the behavior of constraint | |
inventory-item-or-component-has-virtual | |
content: ../content/ssp-inventory-item-or-component-has-virtual-INVALID.xml | |
expectations: | |
- constraint-id: inventory-item-or-component-has-virtual | |
result: fail |
test-case: | ||
name: Positive Test for iventory-item-or-component-has-virtual | ||
description: >- | ||
This test case validates the behavior of constraint | ||
iventory-item-or-component-has-virtual | ||
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml | ||
expectations: | ||
- constraint-id: iventory-item-or-component-has-virtual | ||
result: pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend renaming file to "inventory-item-or-component-has-virtual-PASS.yaml" and making the following changes:
test-case: | |
name: Positive Test for iventory-item-or-component-has-virtual | |
description: >- | |
This test case validates the behavior of constraint | |
iventory-item-or-component-has-virtual | |
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml | |
expectations: | |
- constraint-id: iventory-item-or-component-has-virtual | |
result: pass | |
test-case: | |
name: Positive Test for inventory-item-or-component-has-virtual | |
description: >- | |
This test case validates the behavior of constraint | |
inventory-item-or-component-has-virtual | |
content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml | |
expectations: | |
- constraint-id: inventory-item-or-component-has-virtual | |
result: pass |
4850875
to
be0c369
Compare
Committer Notes
Purpose
This PR aims to add the
iventory-item-or-component-has-virtual
constraint which ensures that every inventory item, or it's linked component, is virtual or not by checking for the existence and value of the "virtual" prop.Changes
Added constraint:
iventory-item-or-component-has-virtual
Added valid/invalid test content:
ssp-iventory-item-or-component-has-virtual-INVALID.xml
fedramp-ssp-example.oscal.xml
to align with constraintAdded yaml files for testing:
All Submissions:
By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.