Skip to content

Commit

Permalink
add constraint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabeblis committed Nov 22, 2024
1 parent 595e071 commit 7ac54e5
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 0 deletions.
5 changes: 5 additions & 0 deletions features/fedramp_extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Examples:
| cia-impact-has-adjustment-justification |
| cia-impact-has-selected |
| cloud-service-model |
| component-has-authentication-method |
| component-type |
| control-implementation-status |
| data-center-alternate |
Expand Down Expand Up @@ -73,6 +74,7 @@ Examples:
| has-identity-assurance-level |
| has-incident-response-plan |
| has-information-system-contingency-plan |
| has-inventory-items |
| has-network-architecture |
| has-network-architecture-diagram |
| has-network-architecture-diagram-caption |
Expand Down Expand Up @@ -121,6 +123,7 @@ Examples:
| scan-type |
| security-level |
| security-sensitivity-level-matches-security-impact-level |
| unique-inventory-item-asset-id |
| user-has-authorized-privilege |
| user-has-privilege-level |
| user-has-role-id |
Expand Down Expand Up @@ -162,6 +165,8 @@ Examples:
| cia-impact-has-selected-PASS.yaml |
| cloud-service-model-FAIL.yaml |
| cloud-service-model-PASS.yaml |
| component-has-authentication-method-FAIL.yaml |
| component-has-authentication-method-PASS.yaml |
| component-type-FAIL.yaml |
| component-type-PASS.yaml |
| control-implementation-status-FAIL.yaml |
Expand Down
5 changes: 5 additions & 0 deletions src/validations/constraints/content/ssp-all-VALID.xml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@
</description>
<prop name="interconnection-security" value="vpn" ns="https://fedramp.gov/ns/oscal"/>
<prop name="interconnection-direction" value="in/out" ns="https://fedramp.gov/ns/oscal"/>
<prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="yes">
<remarks>
<p>Some description of the authentication method.</p>
</remarks>
</prop>
<status state="operational"/>
<responsible-role role-id="system-admin">
<party-uuid>11111111-0000-4000-9000-000000000001</party-uuid>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<system-security-plan xmlns="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://csrc.nist.gov/ns/oscal/1.0 https://github.com/usnistgov/OSCAL/releases/download/v1.1.2/oscal_ssp_schema.xsd"
uuid="12345678-1234-4321-8765-123456789012">
<system-implementation>
<component uuid="11111111-2222-4000-8000-009000100001" type="system">
<prop name="leveraged-authorization-uuid" value="11111111-2222-4000-8000-019000000001"/>
<prop name="implementation-point" value="external"/>
<prop ns="http://fedramp.gov/ns/oscal" name="nature-of-agreement" value="sla"/>
<!-- <prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="INVALID"> Missing authentication-method
<remarks>
<p>If 'yes', describe the authentication method.</p>
<p>If 'no', explain why no authentication is used.</p>
<p>If 'not-applicable', attest explain why authentication is not applicable in the remarks.</p>
</remarks>
</prop> -->
</component>
<component uuid="11111111-2222-4000-8000-009000500002" type="service">
<title>Service B</title>
<description>
<p>An non-authorized service provided by the Awesome Cloud leveraged authorization.</p>
<p>Describe the service and what it is used for.</p>
</description>
<prop name="implementation-point" value="external"/>
<prop name="direction" value="outgoing"/>
<prop ns="http://fedramp.gov/ns/oscal" name="still-supported" value="yes"/>
<!-- <prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="INVALID"> Missing authentication-method
<remarks>
<p>If 'yes', describe the authentication method.</p>
<p>If 'no', explain why no authentication is used.</p>
<p>If 'not-applicable', attest explain why authentication is not applicable in the remarks.</p>
</remarks>
</prop> -->
</component>
<component uuid="11111111-2222-4000-8000-009000200001" type="interconnection">
<prop name="direction" value="incoming"/>
<prop name="direction" value="outgoing"/>
<prop ns="http://fedramp.gov/ns/oscal" name="nature-of-agreement" value="contract"/>
<prop ns="http://fedramp.gov/ns/oscal" name="still-supported" value="yes"/>
<!-- <prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="INVALID"> Missing authentication-method
<remarks>
<p>If 'yes', describe the authentication method in the remarks.</p>
<p>If 'no', explain why no authentication is used in the remarks.</p>
<p>If 'not-applicable', attest explain why authentication is not applicable in the remarks.</p>
</remarks>
</prop> -->
</component>
<component uuid="11111111-2222-4000-8000-009000500004" type="service">
<title>Service C</title>
<description>
<p>A service provided by an external system other than the leveraged system.</p>
<p>Describe the service and what it is used for.</p>
</description>
<prop name="implementation-point" value="internal"/>
<prop name="direction" value="outgoing"/>
<!-- <prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="INVALID"> Missing authentication-method
<remarks>
<p>If 'yes', describe the authentication method in the remarks.</p>
<p>If 'no', explain why no authentication is used in the remarks.</p>
<p>If 'not-applicable', attest explain why authentication is not applicable in the remarks.</p>
</remarks>
</prop> -->
</component>
<component uuid="11111111-2222-4000-8000-009000300001" type="software">
<title>Management CLI</title>
<description>
<p>None</p>
</description>
<prop name="asset-type" value="cli"/>
<prop name="implementation-point" value="internal"/>
<prop name="direction" value="outgoing"/>
<!-- <prop ns="http://fedramp.gov/ns/oscal" name="authentication-method" value="INVALID"> Missing authentication-method
<remarks>
<p>If 'yes', describe the authentication method in the remarks.</p>
<p>If 'no', explain why no authentication is used in the remarks.</p>
<p>If 'not-applicable', attest explain why authentication is not applicable in the remarks.</p>
</remarks>
</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 @@ -81,6 +81,11 @@
<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"/>
<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='http://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"/>
<message>A FedRAMP SSP MUST include an authentication method for each leveraged system.</message>
</expect>
<expect id="has-authorization-boundary-diagram-link-href-target" target="." test="not(starts-with(system-characteristics/authorization-boundary/diagram/link/@href, '#')) or exists(//resource[@uuid eq substring-after($authorization-boundary-link, '#')])" level="ERROR">
<formal-name>Has Authorization Boundary Diagram Link Href Target</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/#authorization-boundary"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Negative Test for component-has-authentication-method
description: >-
This test case validates the behavior of constraint
component-has-authentication-method
content: ../content/ssp-component-has-authentication-method-INVALID.xml
expectations:
- constraint-id: component-has-authentication-method
result: fail
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
test-case:
name: Positive Test for component-has-authentication-method
description: >-
This test case validates the behavior of constraint
component-has-authentication-method
content: ../content/ssp-all-VALID.xml
expectations:
- constraint-id: component-has-authentication-method
result: pass

0 comments on commit 7ac54e5

Please sign in to comment.