Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port range constraints re-written to eliminate the error documented in #2023 and oscal-cli/#290 #2024

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

iMichaela
Copy link
Contributor

@iMichaela iMichaela commented Jun 17, 2024

Correcting the port-range constraints to properly implement the intent for the defined constraints.

Committer Notes

Current port-range constraints are generating warnings that port-range start or end must be defined even when they are.

All Submissions:

By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.

(For reviewers: The wiki has guidance on code review and overall issue review for completeness.)

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
    The following schematron file can be used. If deemed necessary, it can be uploaded to the repo. Example sip file can also be uploaded to oscal-content repo.
<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:sqf="http://www.schematron-quickfix.com/validator/process"> 
  <sch:ns prefix="o" uri="http://csrc.nist.gov/ns/oscal/1.0"/>
     
  <sch:pattern id="proposed">      
     <!-- Schema constrains to non-negative integer so we do not do that here. -->
     <sch:rule context="o:port-range">
        <sch:assert test="exists(@start)" id="start-port-does-not-exist">id port-range-has-start</sch:assert>
        <sch:assert test="exists(@end)" id="end-port-does-not-exist">id port-range-has-end</sch:assert>
        <sch:assert test="not(@start > @end)" id="start-is-before-end">id port-range-end-date-is-before-start-date</sch:assert>
     </sch:rule>         
  </sch:pattern>
 
</sch:schema>
  • Have you included examples of how to use your new feature(s)?
  • Have you updated all OSCAL website and readme documentation affected by the changes you made? Changes to the OSCAL website can be made in the docs/content directory of your branch.

@iMichaela iMichaela requested a review from a team as a code owner June 17, 2024 17:50
Copy link
Contributor

@JustKuzya JustKuzya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reasonable change for the ports

@iMichaela iMichaela merged commit 751e2d7 into develop Jul 2, 2024
2 checks passed
@brian-ruf
Copy link
Contributor

@iMichaela I have also encountered this and am glad to see it was resolved and merged to develop. Is there an ETA on merging to main?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants