Skip to content

Commit b267c6a

Browse files
Chris Comptonaj-stein-nist
authored andcommitted
Require (Warn) port start and end when protocol is specified. (#1674)
* Require (Warn) port start and end when protocol is specified. #1521 * Fix less than/equal entity in test. #1521
1 parent 13e446a commit b267c6a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/metaschema/oscal_implementation-common_metaschema.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,21 @@
304304
</allowed-values>
305305
</constraint>
306306
</define-flag>
307+
<!-- Added Contraints as Warnings -->
308+
<constraint>
309+
<expect level="WARNING" id="port-range-start-and-end-not-specified" target="." test="exists(@start) and exists(@end)">
310+
<message>If a protocol is defined, it should include a start and end port range. To define a single port, the start and end should be the same value.</message>
311+
</expect>
312+
<expect level="WARNING" id="port-range-start-specified-with-no-end" target="." test="exists(@start) and not(exists(@end))">
313+
<message>A start port exists, but an end point does not. To define a single port, the start and end should be the same value.</message>
314+
</expect>
315+
<expect level="WARNING" id="port-range-end-specified-with-no-start" target="." test="not(exists(@start)) and exists(@end)">
316+
<message>An end point exists, but a start port does not. To define a single port, the start and end should be the same value.</message>
317+
</expect>
318+
<expect level="WARNING" id="port-range-end-date-is-before-start-date" target="." test="@start &lt;= @end">
319+
<message>The port range specified has an end port that is less than the start port.</message>
320+
</expect>
321+
</constraint>
307322
<remarks>
308323
<p>To be validated as a natural number (integer &gt;= 1). A single port uses the same value for start and end. Use multiple 'port-range' entries for non-contiguous ranges.</p>
309324
</remarks>

0 commit comments

Comments
 (0)