Skip to content

Commit

Permalink
fix constraint test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis committed Nov 29, 2024
1 parent 2230f27 commit 273eec9
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 29 deletions.
4 changes: 2 additions & 2 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ Examples:
| leveraged-authorization-has-system-identifier-PASS.yaml |
| leveraged-authorization-nature-of-agreement-FAIL.yaml |
| leveraged-authorization-nature-of-agreement-PASS.yaml |
| leveraged-authorization-matches-impact-level-FAIL.yaml |
| leveraged-authorization-matches-impact-level-PASS.yaml |
| leveraged-authorization-has-valid-impact-level-FAIL.yaml |
| leveraged-authorization-has-valid-impact-level-PASS.yaml |
| marking-FAIL.yaml |
| marking-PASS.yaml |
| missing-response-components-FAIL.yaml |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</system-characteristics>
<system-implementation>
<leveraged-authorization uuid="5a9c98ab-8e5e-433d-a7bd-515c07cd1497">
<prop ns="http://fedramp.gov/ns/oscal" name="impact-level" value="high"/>
<prop ns="http://fedramp.gov/ns/oscal" name="impact-level" value="fips-199-high"/>
</leveraged-authorization>
</system-implementation>
</system-security-plan>
11 changes: 3 additions & 8 deletions src/validations/constraints/fedramp-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,7 @@
<let var="network-architecture-link" expression="system-characteristics/network-architecture/diagram/link/@href"/>
<let var="import-profile-href" expression="import-profile/@href"/>
<let var="resolved-import-profile-href" expression="if (starts-with($import-profile-href, '#')) then back-matter/resource[@uuid = substring($import-profile-href, 2)]/rlink/@href else $import-profile-href"/>
<let var="impact-level" expression=
"if (//security-impact-level//* = 'fips-199-high')
then ('high')
else if (//security-impact-level//* = 'fips-199-moderate')
then ('moderate')
else ('low')"/>
<let var="sensitivity-level" expression="system-characteristics/security-sensitivity-level"/>
<expect id="component-has-authentication-method" 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[@ns='https://fedramp.gov/ns/oscal' and @name='authentication-method']) >= 1" level="ERROR">
<formal-name>Component Has Authentication Method</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"/>
Expand Down Expand Up @@ -120,8 +115,8 @@
<p>A FedRAMP SSP MUST use a valid FedRAMP catalog to reference security controls. It MUST NOT reference controls from a non-FedRAMP catalog.</p>
</remarks>
</expect>
<expect id="leveraged-authorization-matches-impact-level" target="//leveraged-authorization/prop[@name='impact-level'][@ns='http://fedramp.gov/ns/oscal']/@value" test=". = $impact-level">
<formal-name>Leveraged Authorization Has Allowed Impact Level</formal-name>
<expect id="leveraged-authorization-has-valid-impact-level" target="//leveraged-authorization/prop[@name='impact-level'][@ns='http://fedramp.gov/ns/oscal']/@value" test=". = $sensitivity-level">
<formal-name>Leveraged Authorization Has Valid Impact Level</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>A FedRAMP SSP MUST define the appropriate FIPS-199 impact level (low, moderate, or high) for each leveraged authorization.</message>
</expect>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for leveraged-authorization-has-valid-impact-level
description: >-
This test case validates the behavior of constraint
leveraged-authorization-matches-impact-level
content: ../content/ssp-leveraged-authorization-has-valid-impact-level-INVALID.xml
expectations:
- constraint-id: leveraged-authorization-has-valid-impact-level
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for leveraged-authorization-has-valid-impact-level
description: >-
This test case validates the behavior of constraint
leveraged-authorization-has-valid-impact-level
content: ../content/ssp-all-VALID.xml
expectations:
- constraint-id: leveraged-authorization-has-valid-impact-level
result: pass

This file was deleted.

This file was deleted.

0 comments on commit 273eec9

Please sign in to comment.