From 239ee45d63f3e891909074025bb8b57527fd55a2 Mon Sep 17 00:00:00 2001 From: Gabeblis Date: Fri, 27 Dec 2024 22:34:00 +0000 Subject: [PATCH] Add 'inventory-item-has-software-name' constraint and tests --- features/fedramp_extensions.feature | 3 +++ ...ssp-inventory-item-has-software-name-INVALID.xml | 13 +++++++++++++ .../constraints/fedramp-external-constraints.xml | 5 +++++ .../inventory-item-has-software-name-FAIL.yaml | 9 +++++++++ .../inventory-item-has-software-name-PASS.yaml | 9 +++++++++ 5 files changed, 39 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/features/fedramp_extensions.feature b/features/fedramp_extensions.feature index 18edb73fb..2caefac3e 100644 --- a/features/fedramp_extensions.feature +++ b/features/fedramp_extensions.feature @@ -118,6 +118,7 @@ Examples: | interconnection-security | | inventory-item-allows-authenticated-scan | | inventory-item-and-component-has-public | + | inventory-item-has-software-name | | inventory-item-has-vendor-name | | inventory-item-public | | inventory-item-virtual | @@ -365,6 +366,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-has-software-name-FAIL.yaml | + | inventory-item-has-software-name-PASS.yaml | | inventory-item-has-vendor-name-FAIL.yaml | | inventory-item-has-vendor-name-PASS.yaml | | inventory-item-public-FAIL.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 e4fe24729..3a97b83fd 100644 --- a/src/validations/constraints/fedramp-external-constraints.xml +++ b/src/validations/constraints/fedramp-external-constraints.xml @@ -646,6 +646,11 @@ + + 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. + Inventory Item Has Vendor Name 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