Skip to content

Commit

Permalink
Add constraint 'authentication-method-has-remarks' and tests (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis authored Nov 27, 2024
1 parent 80eb99c commit 0e5f9c0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 1 deletion.
4 changes: 3 additions & 1 deletion features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Examples:
#BEGIN_DYNAMIC_CONSTRAINT_IDS
| address-type |
| attachment-type |
| authentication-method-has-remarks |
| authorization-type |
| categorization-has-correct-system-attribute |
| categorization-has-information-type-id |
Expand Down Expand Up @@ -130,7 +131,6 @@ Examples:
| security-level |
| security-sensitivity-level-matches-security-impact-level |
| unique-inventory-item-asset-id |
| unique-inventory-item-asset-id |
| user-authentication |
| user-has-authorized-privilege |
| user-has-privilege-level |
Expand Down Expand Up @@ -161,6 +161,8 @@ Examples:
| address-type-PASS.yaml |
| attachment-type-FAIL.yaml |
| attachment-type-PASS.yaml |
| authentication-method-has-remarks-FAIL.yaml |
| authentication-method-has-remarks-PASS.yaml |
| authorization-type-FAIL.yaml |
| authorization-type-PASS.yaml |
| categorization-has-correct-system-attribute-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" uuid="12345678-1234-4321-8765-123456789012">
<system-implementation>
<component uuid="66666666-0000-4000-9000-000000000006" type="interconnection">
<prop ns="https://fedramp.gov/ns/oscal" name="authentication-method" value="yes">
<!-- <remarks>
<p>Some description of the authentication method.</p>
</remarks> Missing remarks field. Authentication method count = 1 and remarks count = 0.-->
</prop>
</component>
</system-implementation>
</system-security-plan>
5 changes: 5 additions & 0 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,11 @@
<context>
<metapath target="/system-security-plan/system-implementation"/>
<constraints>
<expect id="authentication-method-has-remarks" target="//component[(@type='system' and ./prop[@name='leveraged-authorization-uuid']) or (@type='service' and not(./prop[@name='leveraged-authorization-uuid']) and ./prop[@name='implementation-point' and @value='external']) or (@type='interconnection') or (@type='service' and ./prop[@name='implementation-point' and @value='internal'] and ./prop[@name='direction']) or (@type='software' and ./prop[@name='asset-type' and @value='cli'] and ./prop[@name='direction'])]" test="count(./prop[@name='authentication-method' and @ns='https://fedramp.gov/ns/oscal']) = count(./prop[@name='authentication-method' and @ns='https://fedramp.gov/ns/oscal']/remarks)" level="ERROR">
<formal-name>Authentication Method Has Remarks</formal-name>
<prop namespace="https://docs.oasis-open.org/sarif/sarif/v2.1.0" name="help-url" value="https://automate.fedramp.gov/documentation/ssp/4-ssp-template-to-oscal-mapping/#leveraged-fedramp-authorized-services"/>
<message>Each authentication method in a FedRAMP SSP MUST have a remarks field.</message>
</expect>
<is-unique id="unique-inventory-item-asset-id" target="inventory-item/prop[@name='asset-id']">
<formal-name>Unique Asset Identifier</formal-name>
<description>Ensure each inventory item has a unique asset-id property.</description>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for authentication-method-has-remarks
description: >-
This test case validates the behavior of constraint
authentication-method-has-remarks
content: ../content/ssp-authentication-method-has-remarks-INVALID.xml
expectations:
- constraint-id: authentication-method-has-remarks
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for authentication-method-has-remarks
description: >-
This test case validates the behavior of constraint
authentication-method-has-remarks
content: ../content/ssp-all-VALID.xml
expectations:
- constraint-id: authentication-method-has-remarks
result: pass

0 comments on commit 0e5f9c0

Please sign in to comment.