From 85e8c9bc68e42fdfea07bdc1300d7c40970d4802 Mon Sep 17 00:00:00 2001 From: Gabeblis Date: Thu, 9 Jan 2025 17:13:45 +0000 Subject: [PATCH] Add 'inventory-item-or-component-has-network' constraint and tests --- features/fedramp_extensions.feature | 3 +++ .../examples/ssp/xml/fedramp-ssp-example.oscal.xml | 2 ++ ...ventory-item-or-component-has-network-INVALID.xml | 12 ++++++++++++ .../constraints/fedramp-external-constraints.xml | 6 +++++- ...inventory-item-or-component-has-network-FAIL.yaml | 9 +++++++++ ...inventory-item-or-component-has-network-PASS.yaml | 9 +++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 src/validations/constraints/content/ssp-inventory-item-or-component-has-network-INVALID.xml create mode 100644 src/validations/constraints/unit-tests/inventory-item-or-component-has-network-FAIL.yaml create mode 100644 src/validations/constraints/unit-tests/inventory-item-or-component-has-network-PASS.yaml diff --git a/features/fedramp_extensions.feature b/features/fedramp_extensions.feature index 9305b7aaf..0898b86c7 100644 --- a/features/fedramp_extensions.feature +++ b/features/fedramp_extensions.feature @@ -131,6 +131,7 @@ Examples: | inventory-item-has-valid-mac-address | | inventory-item-has-vendor-name | | inventory-item-or-component-has-asset-id | + | inventory-item-or-component-has-network | | inventory-item-public | | inventory-item-virtual | | last-accessed-is-datetime | @@ -404,6 +405,8 @@ Examples: | inventory-item-has-vendor-name-PASS.yaml | | inventory-item-or-component-has-asset-id-FAIL.yaml | | inventory-item-or-component-has-asset-id-PASS.yaml | + | inventory-item-or-component-has-network-FAIL.yaml | + | inventory-item-or-component-has-network-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 f1b3b3ce6..5bbb15e8c 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 @@ -1525,6 +1525,7 @@ leveraged-authorization assembly:

+ @@ -1656,6 +1657,7 @@ property.

+ diff --git a/src/validations/constraints/content/ssp-inventory-item-or-component-has-network-INVALID.xml b/src/validations/constraints/content/ssp-inventory-item-or-component-has-network-INVALID.xml new file mode 100644 index 000000000..fd66b91f1 --- /dev/null +++ b/src/validations/constraints/content/ssp-inventory-item-or-component-has-network-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 116c62800..eaf5efb58 100644 --- a/src/validations/constraints/fedramp-external-constraints.xml +++ b/src/validations/constraints/fedramp-external-constraints.xml @@ -626,6 +626,11 @@ In a FedRAMP SSP, each inventory item and software image component MUST include the asset ID. + + Inventory Item or Component Has Network + + In a FedRAMP SSP, each inventory item and internal service component SHOULD be reachable via a network. + Leveraged Authorization Has Authorization Type @@ -669,7 +674,6 @@ - diff --git a/src/validations/constraints/unit-tests/inventory-item-or-component-has-network-FAIL.yaml b/src/validations/constraints/unit-tests/inventory-item-or-component-has-network-FAIL.yaml new file mode 100644 index 000000000..9e5bffbb8 --- /dev/null +++ b/src/validations/constraints/unit-tests/inventory-item-or-component-has-network-FAIL.yaml @@ -0,0 +1,9 @@ +test-case: + name: Negative Test for inventory-item-or-component-has-network + description: >- + This test case validates the behavior of constraint + inventory-item-or-component-has-network + content: ../content/ssp-inventory-item-or-component-has-network-INVALID.xml + expectations: + - constraint-id: inventory-item-or-component-has-network + result: fail diff --git a/src/validations/constraints/unit-tests/inventory-item-or-component-has-network-PASS.yaml b/src/validations/constraints/unit-tests/inventory-item-or-component-has-network-PASS.yaml new file mode 100644 index 000000000..ea0adf929 --- /dev/null +++ b/src/validations/constraints/unit-tests/inventory-item-or-component-has-network-PASS.yaml @@ -0,0 +1,9 @@ +test-case: + name: Positive Test for inventory-item-or-component-has-network + description: >- + This test case validates the behavior of constraint + inventory-item-or-component-has-network + content: ../../../content/rev5/examples/ssp/xml/fedramp-ssp-example.oscal.xml + expectations: + - constraint-id: inventory-item-or-component-has-network + result: pass