From 1381cbebac07dd269086a6ad853c19d813d056a4 Mon Sep 17 00:00:00 2001
From: Gabeblis
Date: Thu, 9 Jan 2025 16:03:47 +0000
Subject: [PATCH] Add issue-1043 constraints and tests
---
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 7aced5bef..f748b172a 100644
--- a/features/fedramp_extensions.feature
+++ b/features/fedramp_extensions.feature
@@ -38,6 +38,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 |
@@ -124,6 +125,7 @@ Examples:
| interconnection-security |
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
+ | inventory-item-has-diagram-label |
| inventory-item-has-function |
| inventory-item-has-scan-type |
| inventory-item-has-valid-mac-address |
@@ -216,6 +218,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 |
@@ -388,6 +392,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-function-FAIL.yaml |
| inventory-item-has-function-PASS.yaml |
| inventory-item-has-scan-type-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 171d69de9..d7288aa0e 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
@@ -1041,6 +1041,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.
+
@@ -1102,6 +1103,7 @@ leveraged-authorization assembly:
An non-authorized service provided by the Awesome Cloud leveraged authorization.
Describe the service and what it is used for.
+
@@ -1197,6 +1199,7 @@ leveraged-authorization assembly:
An external system to which this system shares an interconnection.
+
@@ -1285,6 +1288,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.)
+
@@ -1430,6 +1434,7 @@ here.
A service provided by an external system other than the leveraged system.
Describe the service and what it is used for.
+
@@ -1521,7 +1526,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.
-
+
@@ -1598,6 +1603,7 @@ property.
None
+
@@ -1741,6 +1747,7 @@ compliance (e.g., Module in Process).
FUNCTION: Describe typical component function.
+
@@ -1762,6 +1769,7 @@ compliance (e.g., Module in Process).
FUNCTION: Describe typical component function.
+
@@ -1783,6 +1791,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.
+
@@ -1808,6 +1817,7 @@ compliance (e.g., Module in Process).
FUNCTION: Describe typical component function.
+
@@ -1830,6 +1840,7 @@ compliance (e.g., Module in Process).
None
+
@@ -1841,6 +1852,7 @@ compliance (e.g., Module in Process).
None
+
@@ -1886,6 +1898,7 @@ compliance (e.g., Module in Process).
None
+
@@ -2268,6 +2281,7 @@ approved.
Email Service
+
@@ -2310,6 +2324,7 @@ approved.
Legacy Example (No implemented-component).
+
@@ -2364,6 +2379,7 @@ approved.
Component Inventory Example
+
@@ -2407,6 +2423,7 @@ approved.
None.
+
@@ -2429,6 +2446,7 @@ approved.
None.
+
@@ -2446,6 +2464,7 @@ approved.
None.
+
@@ -2467,6 +2486,7 @@ approved.
None.
+
@@ -2492,6 +2512,7 @@ approved.
None.
+
@@ -2512,6 +2533,7 @@ approved.
None.
+
@@ -2536,6 +2558,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 af1baef6b..5e85d1bb0 100644
--- a/src/validations/constraints/fedramp-external-constraints.xml
+++ b/src/validations/constraints/fedramp-external-constraints.xml
@@ -586,11 +586,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
@@ -688,6 +694,11 @@
For HIGH-impact systems, every inventory-item MUST identify an asset-owner or administrator property either within the inventory-item itself, or within the component linked by the inventory-item.
+
+ 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 Function
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