From b9ca17a5d323c5a2cd19cdd35f807495e476d70e Mon Sep 17 00:00:00 2001 From: Gabeblis Date: Tue, 7 Jan 2025 13:12:47 -0500 Subject: [PATCH] Add 'inventory-item-has-software-name' constraint and tests (#1038) --- ...ssp-inventory-item-has-software-name-INVALID.xml | 13 +++++++++++++ .../constraints/fedramp-external-constraints.xml | 4 ++++ .../inventory-item-has-software-name-FAIL.yaml | 9 +++++++++ .../inventory-item-has-software-name-PASS.yaml | 9 +++++++++ 4 files changed, 35 insertions(+) create mode 100644 src/validations/constraints/content/ssp-inventory-item-has-software-name-INVALID.xml create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-software-name-FAIL.yaml create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-software-name-PASS.yaml diff --git a/src/validations/constraints/content/ssp-inventory-item-has-software-name-INVALID.xml b/src/validations/constraints/content/ssp-inventory-item-has-software-name-INVALID.xml new file mode 100644 index 000000000..d0b88a64a --- /dev/null +++ b/src/validations/constraints/content/ssp-inventory-item-has-software-name-INVALID.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/validations/constraints/fedramp-external-constraints.xml b/src/validations/constraints/fedramp-external-constraints.xml index 6b0f283b5..441aecd5f 100644 --- a/src/validations/constraints/fedramp-external-constraints.xml +++ b/src/validations/constraints/fedramp-external-constraints.xml @@ -677,6 +677,10 @@ + + Inventory Item Has Software Name + + In a FedRAMP SSP, each inventory item MUST include the software name in the inventory item itself or within the linked component. Authenticated Scan No Has Remarks diff --git a/src/validations/constraints/unit-tests/inventory-item-has-software-name-FAIL.yaml b/src/validations/constraints/unit-tests/inventory-item-has-software-name-FAIL.yaml new file mode 100644 index 000000000..3d5b358bc --- /dev/null +++ b/src/validations/constraints/unit-tests/inventory-item-has-software-name-FAIL.yaml @@ -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 diff --git a/src/validations/constraints/unit-tests/inventory-item-has-software-name-PASS.yaml b/src/validations/constraints/unit-tests/inventory-item-has-software-name-PASS.yaml new file mode 100644 index 000000000..8dd3278bc --- /dev/null +++ b/src/validations/constraints/unit-tests/inventory-item-has-software-name-PASS.yaml @@ -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