From 4404ef51197c1de25b3c43f25907450c8fb410e4 Mon Sep 17 00:00:00 2001
From: Gabeblis
Date: Thu, 9 Jan 2025 15:58:26 +0000
Subject: [PATCH] Add issue-1043 Constraints
---
features/fedramp_extensions.feature | 6 +++++
.../ssp/xml/fedramp-ssp-example.oscal.xml | 25 ++++++++++++++++++-
...sp-component-has-diagram-label-INVALID.xml | 10 ++++++++
...ventory-item-has-diagram-label-INVALID.xml | 10 ++++++++
.../fedramp-external-constraints.xml | 11 ++++++++
.../component-has-diagram-label-FAIL.yaml | 9 +++++++
.../component-has-diagram-label-PASS.yaml | 9 +++++++
...inventory-item-has-diagram-label-FAIL.yaml | 9 +++++++
...inventory-item-has-diagram-label-PASS.yaml | 9 +++++++
9 files changed, 97 insertions(+), 1 deletion(-)
create mode 100644 src/validations/constraints/content/ssp-component-has-diagram-label-INVALID.xml
create mode 100644 src/validations/constraints/content/ssp-inventory-item-has-diagram-label-INVALID.xml
create mode 100644 src/validations/constraints/unit-tests/component-has-diagram-label-FAIL.yaml
create mode 100644 src/validations/constraints/unit-tests/component-has-diagram-label-PASS.yaml
create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-diagram-label-FAIL.yaml
create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-diagram-label-PASS.yaml
diff --git a/features/fedramp_extensions.feature b/features/fedramp_extensions.feature
index 45e828a81..34f75356a 100644
--- a/features/fedramp_extensions.feature
+++ b/features/fedramp_extensions.feature
@@ -37,6 +37,7 @@ Examples:
| cia-impact-has-selected |
| cloud-service-model |
| component-has-authentication-method |
+ | component-has-diagram-label |
| component-has-non-provider-responsible-role |
| component-has-provider-responsible-role |
| component-has-used-by-link |
@@ -121,6 +122,7 @@ Examples:
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
+ | inventory-item-has-diagram-label |
| inventory-item-has-valid-mac-address |
| inventory-item-has-vendor-name |
| inventory-item-or-component-has-asset-id |
@@ -208,6 +210,8 @@ Examples:
| cloud-service-model-PASS.yaml |
| component-has-authentication-method-FAIL.yaml |
| component-has-authentication-method-PASS.yaml |
+ | component-has-diagram-label-FAIL.yaml |
+ | component-has-diagram-label-PASS.yaml |
| component-has-non-provider-responsible-role-FAIL.yaml |
| component-has-non-provider-responsible-role-PASS.yaml |
| component-has-used-by-link-FAIL.yaml |
@@ -376,6 +380,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-diagram-label-FAIL.yaml |
+ | inventory-item-has-diagram-label-PASS.yaml |
| inventory-item-has-valid-mac-address-FAIL.yaml |
| inventory-item-has-valid-mac-address-PASS.yaml |
| inventory-item-has-vendor-name-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 e70c03786..04fd85487 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
@@ -1040,6 +1040,7 @@ these datails are derived from other content in this SSP.
An authorized service provided by the Awesome Cloud leveraged authorization.
Describe the service and what it is used for.
+
@@ -1101,6 +1102,7 @@ leveraged-authorization assembly:
An non-authorized service provided by the Awesome Cloud leveraged authorization.
Describe the service and what it is used for.
+
@@ -1196,6 +1198,7 @@ leveraged-authorization assembly:
An external system to which this system shares an interconnection.
+
@@ -1284,6 +1287,7 @@ and "system-poc-technical"
Describe the purpose of the external system/service; specifically, provide reasons
for connectivity (e.g., system monitoring, system alerting, download updates, etc.)
+
@@ -1429,6 +1433,7 @@ here.
A service provided by an external system other than the leveraged system.
Describe the service and what it is used for.
+
@@ -1520,7 +1525,7 @@ leveraged-authorization assembly:
A service provided by an external system other than the leveraged system.
Describe the service and what it is used for.
-
+
@@ -1597,6 +1602,7 @@ property.
None
+
@@ -1736,6 +1742,7 @@ compliance (e.g., Module in Process).
FUNCTION: Describe typical component function.
+
@@ -1757,6 +1764,7 @@ compliance (e.g., Module in Process).
FUNCTION: Describe typical component function.
+
@@ -1778,6 +1786,7 @@ compliance (e.g., Module in Process).
FUNCTION: This container image is the base operating system used in the example. A notional CSP, like Awesome Cloud, would update and customize this image for business, reliability, and security needs.
+
@@ -1803,6 +1812,7 @@ compliance (e.g., Module in Process).
FUNCTION: Describe typical component function.
+
@@ -1825,6 +1835,7 @@ compliance (e.g., Module in Process).
None
+
@@ -1836,6 +1847,7 @@ compliance (e.g., Module in Process).
None
+
@@ -1881,6 +1893,7 @@ compliance (e.g., Module in Process).
None
+
@@ -2263,6 +2276,7 @@ approved.
Email Service
+
@@ -2305,6 +2319,7 @@ approved.
Legacy Example (No implemented-component).
+
@@ -2359,6 +2374,7 @@ approved.
Component Inventory Example
+
@@ -2398,6 +2414,7 @@ approved.
None.
+
@@ -2414,6 +2431,7 @@ approved.
None.
+
@@ -2429,6 +2447,7 @@ approved.
None.
+
@@ -2444,6 +2463,7 @@ approved.
None.
+
@@ -2462,6 +2482,7 @@ approved.
None.
+
@@ -2477,6 +2498,7 @@ approved.
None.
+
@@ -2495,6 +2517,7 @@ approved.
Email-Service
+
diff --git a/src/validations/constraints/content/ssp-component-has-diagram-label-INVALID.xml b/src/validations/constraints/content/ssp-component-has-diagram-label-INVALID.xml
new file mode 100644
index 000000000..e520c8ddd
--- /dev/null
+++ b/src/validations/constraints/content/ssp-component-has-diagram-label-INVALID.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/validations/constraints/content/ssp-inventory-item-has-diagram-label-INVALID.xml b/src/validations/constraints/content/ssp-inventory-item-has-diagram-label-INVALID.xml
new file mode 100644
index 000000000..0c145ab13
--- /dev/null
+++ b/src/validations/constraints/content/ssp-inventory-item-has-diagram-label-INVALID.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ 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 f24d6cc41..fb749da18 100644
--- a/src/validations/constraints/fedramp-external-constraints.xml
+++ b/src/validations/constraints/fedramp-external-constraints.xml
@@ -575,11 +575,17 @@
+
+
+ Component Has Diagram Label
+
+ In a FedRAMP SSP, each hardware, software, service, and interconnection component MUST include the diagram label.
+
Component Has Used-By Link
@@ -663,6 +669,11 @@
+
+ Inventory Item Has Diagram Label
+
+ In a FedRAMP SSP, each inventory item MUST include the diagram label either in the inventory item itself or within the linked component.
+
Inventory Item Has Valid Mac Address
diff --git a/src/validations/constraints/unit-tests/component-has-diagram-label-FAIL.yaml b/src/validations/constraints/unit-tests/component-has-diagram-label-FAIL.yaml
new file mode 100644
index 000000000..22e0e083d
--- /dev/null
+++ b/src/validations/constraints/unit-tests/component-has-diagram-label-FAIL.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Negative Test for component-has-diagram-label
+ description: >-
+ This test case validates the behavior of constraint
+ component-has-diagram-label
+ content: ../content/ssp-component-has-diagram-label-INVALID.xml
+ expectations:
+ - constraint-id: component-has-diagram-label
+ result: fail
diff --git a/src/validations/constraints/unit-tests/component-has-diagram-label-PASS.yaml b/src/validations/constraints/unit-tests/component-has-diagram-label-PASS.yaml
new file mode 100644
index 000000000..1304aaf79
--- /dev/null
+++ b/src/validations/constraints/unit-tests/component-has-diagram-label-PASS.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Positive Test for component-has-diagram-label
+ description: >-
+ This test case validates the behavior of constraint
+ component-has-diagram-label
+ content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
+ expectations:
+ - constraint-id: component-has-diagram-label
+ result: pass
diff --git a/src/validations/constraints/unit-tests/inventory-item-has-diagram-label-FAIL.yaml b/src/validations/constraints/unit-tests/inventory-item-has-diagram-label-FAIL.yaml
new file mode 100644
index 000000000..76254972d
--- /dev/null
+++ b/src/validations/constraints/unit-tests/inventory-item-has-diagram-label-FAIL.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Negative Test for inventory-item-has-diagram-label
+ description: >-
+ This test case validates the behavior of constraint
+ inventory-item-has-diagram-label
+ content: ../content/ssp-inventory-item-has-diagram-label-INVALID.xml
+ expectations:
+ - constraint-id: inventory-item-has-diagram-label
+ result: fail
diff --git a/src/validations/constraints/unit-tests/inventory-item-has-diagram-label-PASS.yaml b/src/validations/constraints/unit-tests/inventory-item-has-diagram-label-PASS.yaml
new file mode 100644
index 000000000..f79ec3287
--- /dev/null
+++ b/src/validations/constraints/unit-tests/inventory-item-has-diagram-label-PASS.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Positive Test for inventory-item-has-diagram-label
+ description: >-
+ This test case validates the behavior of constraint
+ inventory-item-has-diagram-label
+ content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
+ expectations:
+ - constraint-id: inventory-item-has-diagram-label
+ result: pass