From 228b33153ce31bda81f7bf9e3aa5ab55b91a9c03 Mon Sep 17 00:00:00 2001
From: Gabeblis
Date: Thu, 26 Dec 2024 16:19:43 +0000
Subject: [PATCH] Add 'inventory-item-has-vendor-name' constraint and tests
---
features/fedramp_extensions.feature | 3 +++
.../examples/ssp/xml/fedramp-ssp-example.oscal.xml | 9 +++++++++
.../ssp-inventory-item-has-vendor-name-INVALID.xml | 12 ++++++++++++
.../constraints/fedramp-external-constraints.xml | 12 ++++++++++++
.../inventory-item-has-vendor-name-FAIL.yaml | 9 +++++++++
.../inventory-item-has-vendor-name-PASS.yaml | 9 +++++++++
6 files changed, 54 insertions(+)
create mode 100644 src/validations/constraints/content/ssp-inventory-item-has-vendor-name-INVALID.xml
create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-vendor-name-FAIL.yaml
create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-vendor-name-PASS.yaml
diff --git a/features/fedramp_extensions.feature b/features/fedramp_extensions.feature
index 08f2f1aa6..e3120df4e 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-vendor-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-vendor-name-FAIL.yaml |
+ | inventory-item-has-vendor-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..1ef73dc01 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
@@ -2267,6 +2267,7 @@ approved.
+
@@ -2322,6 +2323,7 @@ preferable to the link[rel='validation'] example above.
+
If no, explain why. If yes, omit remark.
@@ -2353,6 +2355,7 @@ preferable to the link[rel='validation'] example above.
+
@@ -2367,6 +2370,7 @@ preferable to the link[rel='validation'] example above.
+
@@ -2381,6 +2385,7 @@ preferable to the link[rel='validation'] example above.
+
@@ -2394,6 +2399,7 @@ preferable to the link[rel='validation'] example above.
+
Asset wasn't running at time of scan.
@@ -2412,6 +2418,7 @@ preferable to the link[rel='validation'] example above.
+
@@ -2425,6 +2432,7 @@ preferable to the link[rel='validation'] example above.
+
Asset wasn't running at time of scan.
@@ -2443,6 +2451,7 @@ preferable to the link[rel='validation'] example above.
+
diff --git a/src/validations/constraints/content/ssp-inventory-item-has-vendor-name-INVALID.xml b/src/validations/constraints/content/ssp-inventory-item-has-vendor-name-INVALID.xml
new file mode 100644
index 000000000..ad14faa3e
--- /dev/null
+++ b/src/validations/constraints/content/ssp-inventory-item-has-vendor-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..910921746 100644
--- a/src/validations/constraints/fedramp-external-constraints.xml
+++ b/src/validations/constraints/fedramp-external-constraints.xml
@@ -636,6 +636,18 @@
+
+
+
+
+
+ Inventory Item Has Vendor Name
+
+ In a FedRAMP SSP, each inventory item MUST include the vendor name in the inventory item itself or within the linked component.
+
+
+
+
diff --git a/src/validations/constraints/unit-tests/inventory-item-has-vendor-name-FAIL.yaml b/src/validations/constraints/unit-tests/inventory-item-has-vendor-name-FAIL.yaml
new file mode 100644
index 000000000..148128fec
--- /dev/null
+++ b/src/validations/constraints/unit-tests/inventory-item-has-vendor-name-FAIL.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Negative Test for inventory-item-has-vendor-name
+ description: >-
+ This test case validates the behavior of constraint
+ inventory-item-has-vendor-name
+ content: ../content/ssp-inventory-item-has-vendor-name-INVALID.xml
+ expectations:
+ - constraint-id: inventory-item-has-vendor-name
+ result: fail
diff --git a/src/validations/constraints/unit-tests/inventory-item-has-vendor-name-PASS.yaml b/src/validations/constraints/unit-tests/inventory-item-has-vendor-name-PASS.yaml
new file mode 100644
index 000000000..42e5ec41a
--- /dev/null
+++ b/src/validations/constraints/unit-tests/inventory-item-has-vendor-name-PASS.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Positive Test for inventory-item-has-vendor-name
+ description: >-
+ This test case validates the behavior of constraint
+ inventory-item-has-vendor-name
+ content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
+ expectations:
+ - constraint-id: inventory-item-has-vendor-name
+ result: pass