From b5bc9f761510555671d4229f6d16ccf0884fc595 Mon Sep 17 00:00:00 2001
From: Gabeblis
Date: Fri, 10 Jan 2025 18:46:34 +0000
Subject: [PATCH] Add issue-1032 constraints and tests
---
features/fedramp_extensions.feature | 6 ++++++
.../ssp/xml/fedramp-ssp-example.oscal.xml | 9 +++++++++
...-component-has-authenticated-scan-INVALID.xml | 8 ++++++++
...ntory-item-has-authenticated-scan-INVALID.xml | 12 ++++++++++++
.../constraints/fedramp-external-constraints.xml | 16 +++++++++++++++-
.../component-has-authenticated-scan-FAIL.yaml | 9 +++++++++
.../component-has-authenticated-scan-PASS.yaml | 9 +++++++++
...ventory-item-has-authenticated-scan-FAIL.yaml | 9 +++++++++
...ventory-item-has-authenticated-scan-PASS.yaml | 9 +++++++++
9 files changed, 86 insertions(+), 1 deletion(-)
create mode 100644 src/validations/constraints/content/ssp-component-has-authenticated-scan-INVALID.xml
create mode 100644 src/validations/constraints/content/ssp-inventory-item-has-authenticated-scan-INVALID.xml
create mode 100644 src/validations/constraints/unit-tests/component-has-authenticated-scan-FAIL.yaml
create mode 100644 src/validations/constraints/unit-tests/component-has-authenticated-scan-PASS.yaml
create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-FAIL.yaml
create mode 100644 src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-PASS.yaml
diff --git a/features/fedramp_extensions.feature b/features/fedramp_extensions.feature
index a0622b610..abeffc8e9 100644
--- a/features/fedramp_extensions.feature
+++ b/features/fedramp_extensions.feature
@@ -37,6 +37,7 @@ Examples:
| cia-impact-has-adjustment-justification |
| cia-impact-has-selected |
| cloud-service-model |
+ | component-has-authenticated-scan |
| component-has-authentication-method |
| component-has-diagram-label |
| component-has-non-provider-responsible-role |
@@ -126,6 +127,7 @@ Examples:
| inventory-item-allows-authenticated-scan |
| inventory-item-and-component-has-public |
| inventory-item-has-asset-type |
+ | inventory-item-has-authenticated-scan |
| inventory-item-has-diagram-label |
| inventory-item-has-function |
| inventory-item-has-is-scanned |
@@ -219,6 +221,8 @@ Examples:
| cia-impact-has-selected-PASS.yaml |
| cloud-service-model-FAIL.yaml |
| cloud-service-model-PASS.yaml |
+ | component-has-authenticated-scan-FAIL.yaml |
+ | component-has-authenticated-scan-PASS.yaml |
| component-has-authentication-method-FAIL.yaml |
| component-has-authentication-method-PASS.yaml |
| component-has-diagram-label-FAIL.yaml |
@@ -397,6 +401,8 @@ Examples:
| inventory-item-and-component-has-public-PASS.yaml |
| inventory-item-has-asset-type-FAIL.yaml |
| inventory-item-has-asset-type-PASS.yaml |
+ | inventory-item-has-authenticated-scan-FAIL.yaml |
+ | inventory-item-has-authenticated-scan-PASS.yaml |
| inventory-item-has-diagram-label-FAIL.yaml |
| inventory-item-has-diagram-label-PASS.yaml |
| inventory-item-has-function-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 aa1e61687..027213a38 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
@@ -1528,6 +1528,7 @@ leveraged-authorization assembly:
+
@@ -1661,6 +1662,7 @@ property.
Describe the service and what it is used for.
+
@@ -2433,6 +2435,7 @@ approved.
+
@@ -2455,6 +2458,7 @@ approved.
+
a different kind of scan
@@ -2473,6 +2477,7 @@ approved.
+
@@ -2500,6 +2505,7 @@ approved.
Asset wasn't running at time of scan.
+
Required, longer, formatted description.
@@ -2521,6 +2527,7 @@ approved.
+
@@ -2547,6 +2554,7 @@ approved.
Asset wasn't running at time of scan.
+
Optional, longer, formatted description.
@@ -2567,6 +2575,7 @@ approved.
+
virtual function
diff --git a/src/validations/constraints/content/ssp-component-has-authenticated-scan-INVALID.xml b/src/validations/constraints/content/ssp-component-has-authenticated-scan-INVALID.xml
new file mode 100644
index 000000000..d831bef9c
--- /dev/null
+++ b/src/validations/constraints/content/ssp-component-has-authenticated-scan-INVALID.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/validations/constraints/content/ssp-inventory-item-has-authenticated-scan-INVALID.xml b/src/validations/constraints/content/ssp-inventory-item-has-authenticated-scan-INVALID.xml
new file mode 100644
index 000000000..8f5a1b05c
--- /dev/null
+++ b/src/validations/constraints/content/ssp-inventory-item-has-authenticated-scan-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 3b5cb2d20..e8ca0398e 100644
--- a/src/validations/constraints/fedramp-external-constraints.xml
+++ b/src/validations/constraints/fedramp-external-constraints.xml
@@ -671,10 +671,19 @@
A FedRAMP SSP's component MUST reference the existing component(s) that use it via network communication. However, component "{../@uuid}" references a nonexistent component "{@href}".
-
+
+
+
+
+ Component Has Authenticated Scan
+
+ In a FedRAMP SSP, each internal service component MUST state whether it allows authenticated scans.
+
+
+
@@ -699,6 +708,11 @@
In a FedRAMP SSP, each inventory item MUST define the asset type either in the inventory item itself or within the linked component.
+
+ Inventory Item Has Authenticated Scan
+
+ In a FedRAMP SSP, each inventory item MUST state whether it allows authenticated scans in the inventory item itself or within the linked component.
+
Inventory Item Has Diagram Label
diff --git a/src/validations/constraints/unit-tests/component-has-authenticated-scan-FAIL.yaml b/src/validations/constraints/unit-tests/component-has-authenticated-scan-FAIL.yaml
new file mode 100644
index 000000000..9640ee3c6
--- /dev/null
+++ b/src/validations/constraints/unit-tests/component-has-authenticated-scan-FAIL.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Negative Test for component-has-authenticated-scan
+ description: >-
+ This test case validates the behavior of constraint
+ component-has-authenticated-scan
+ content: ../content/ssp-component-has-authenticated-scan-INVALID.xml
+ expectations:
+ - constraint-id: component-has-authenticated-scan
+ result: fail
diff --git a/src/validations/constraints/unit-tests/component-has-authenticated-scan-PASS.yaml b/src/validations/constraints/unit-tests/component-has-authenticated-scan-PASS.yaml
new file mode 100644
index 000000000..489f96149
--- /dev/null
+++ b/src/validations/constraints/unit-tests/component-has-authenticated-scan-PASS.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Positive Test for component-has-authenticated-scan
+ description: >-
+ This test case validates the behavior of constraint
+ component-has-authenticated-scan
+ content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
+ expectations:
+ - constraint-id: component-has-authenticated-scan
+ result: pass
diff --git a/src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-FAIL.yaml b/src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-FAIL.yaml
new file mode 100644
index 000000000..218802efc
--- /dev/null
+++ b/src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-FAIL.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Negative Test for inventory-item-has-authenticated-scan
+ description: >-
+ This test case validates the behavior of constraint
+ inventory-item-has-authenticated-scan
+ content: ../content/ssp-inventory-item-has-authenticated-scan-INVALID.xml
+ expectations:
+ - constraint-id: inventory-item-has-authenticated-scan
+ result: fail
diff --git a/src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-PASS.yaml b/src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-PASS.yaml
new file mode 100644
index 000000000..13a912a94
--- /dev/null
+++ b/src/validations/constraints/unit-tests/inventory-item-has-authenticated-scan-PASS.yaml
@@ -0,0 +1,9 @@
+test-case:
+ name: Positive Test for inventory-item-has-authenticated-scan
+ description: >-
+ This test case validates the behavior of constraint
+ inventory-item-has-authenticated-scan
+ content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml
+ expectations:
+ - constraint-id: inventory-item-has-authenticated-scan
+ result: pass