From a14449a5b9a2c1c6c2c4702617df263bee3cea21 Mon Sep 17 00:00:00 2001
From: Gabeblis
Date: Thu, 26 Dec 2024 13:38:48 +0000
Subject: [PATCH] Add 'inventory-item-has-software-name' constraint and tests
---
features/fedramp_extensions.feature | 3 +++
.../examples/ssp/xml/fedramp-ssp-example.oscal.xml | 8 ++++++++
.../ssp-inventory-item-has-software-name-INVALID.xml | 12 ++++++++++++
.../constraints/fedramp-external-constraints.xml | 12 ++++++++++++
.../inventory-item-has-software-name-FAIL.yaml | 9 +++++++++
.../inventory-item-has-software-name-PASS.yaml | 9 +++++++++
6 files changed, 53 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 08f2f1aa6..232c46cb9 100644
--- a/features/fedramp_extensions.feature
+++ b/features/fedramp_extensions.feature
@@ -115,6 +115,7 @@ Examples:
| interconnection-direction |
| interconnection-security |
| inventory-item-allows-authenticated-scan |
+ | inventory-item-has-software-name |
| inventory-item-public |
| inventory-item-virtual |
| leveraged-authorization-has-authorization-type |
@@ -354,6 +355,8 @@ Examples:
| interconnection-security-PASS.yaml |
| inventory-item-allows-authenticated-scan-FAIL.yaml |
| inventory-item-allows-authenticated-scan-PASS.yaml |
+ | inventory-item-has-software-name-FAIL.yaml |
+ | inventory-item-has-software-name-PASS.yaml |
| inventory-item-public-FAIL.yaml |
| inventory-item-public-PASS.yaml |
| inventory-item-virtual-FAIL.yaml |
diff --git a/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml b/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
index 90403e53f..096500fc6 100644
--- a/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
+++ b/src/content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
@@ -2307,6 +2307,7 @@ preferable to the link[rel='validation'] example above.
Component Inventory Example
+
@@ -2345,6 +2346,7 @@ preferable to the link[rel='validation'] example above.
None.
+
@@ -2360,6 +2362,7 @@ preferable to the link[rel='validation'] example above.
None.
+
@@ -2374,6 +2377,7 @@ preferable to the link[rel='validation'] example above.
None.
+
@@ -2388,6 +2392,7 @@ preferable to the link[rel='validation'] example above.
None.
+
@@ -2405,6 +2410,7 @@ preferable to the link[rel='validation'] example above.
None.
+
@@ -2419,6 +2425,7 @@ preferable to the link[rel='validation'] example above.
None.
+
@@ -2436,6 +2443,7 @@ preferable to the link[rel='validation'] example above.
Email-Service
+
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..454f5701a
--- /dev/null
+++ b/src/validations/constraints/content/ssp-inventory-item-has-software-name-INVALID.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ 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 d03778f96..f5ceebe9f 100644
--- a/src/validations/constraints/fedramp-external-constraints.xml
+++ b/src/validations/constraints/fedramp-external-constraints.xml
@@ -636,6 +636,18 @@
+
+
+
+
+
+ Inventory Item Has Software Name
+
+ In a FedRAMP SSP, each inventory item MUST define the software name in the inventory item itself or within the linked component.
+
+
+
+
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