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

[EGRC-292] Update OSCAL SSP Viewer, resolve various bugs related oscal-content update #43

Merged
merged 6 commits into from
Apr 23, 2021

Conversation

zclarkEDC
Copy link
Member

Overview

EGRC-292

Render fix

Still using the variable name annotations, because props is already assigned.

If we do a PropTypes rewrite in the future, this may alleviate the issue.

404 Error fix

In OSCALSspResolver.js, changed the relative profile import path.
This fix is needed because latest oscal-content PR resolved the issue

Fix for oscal-content changing annotation to props.
This is a bit complicated because we are regularly using props, so
for the .map function we will still use the parameter annotations.
Testing is also fixed to use props.
Copy link
Contributor

@kkennedy26 kkennedy26 left a comment

Choose a reason for hiding this comment

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

Files look good. Ran OSCALViewer locally and navigated to system security plan viewer. Looks good

Copy link
Contributor

@rgauss rgauss left a comment

Choose a reason for hiding this comment

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

Minor change requested.

src/OSCALSystemCharacteristics.js Outdated Show resolved Hide resolved
@zclarkEDC
Copy link
Member Author

@rgauss @kkennedy26
The text not highlighting inside of Control Implementation is due to a change in how the NIST_SP-800-53_rev4_MODERATE-baseline_profile.json imports controls.

Old version:

"include": {
          "calls": [
            {
              "control-id": "ac-1"
            },
            {
              "control-id": "ac-2"
            },
            {
              "control-id": "ac-2.1"
            },
            {
              "control-id": "ac-2.2"
            },

New version

"include-controls": [
          {
            "with-ids": [
              "ac-1",
              "ac-2",
              "ac-2.1",
              "ac-2.2",

To fix this issue, OSCALControlImplementationReq must be changed, specifically how it imports controls:

  const control = props.controls.find(
    (control) => control.id === props.implementedRequirement["control-id"]
  );

@rgauss
Copy link
Contributor

rgauss commented Apr 16, 2021

@zclarkEDC, that looks correct to me, go for it.

@rgauss
Copy link
Contributor

rgauss commented Apr 16, 2021

@zclarkEDC, looks like the issue is actually an issue with the addition of insert: param, in the recent commit changing the catalog which will probably need changes to code such as ReplacedProseWithParameterLabel and ReplacedProseWithByComponentParameterValue.

Note that the Catalog Viewer parameter label is broken as well.

@zclarkEDC
Copy link
Member Author

zclarkEDC commented Apr 20, 2021

Note that the Catalog Viewer parameter label is broken as well.

I spent some time attempting to fix the issue if there are 2 {{insert: param, paramId}} in the same prose, but it caused load times to take minutes.

I left a comment elaborating on the issue near the old // TODO

- Change ReplacedProseWithParameterLabel and
ReplacedProseWithByComponentValue to find the parameterId, note
this is still broken because it only works if there is one parameter.
- Change annotation to prop in OSCALSystemCharacteristics
@zclarkEDC
Copy link
Member Author

@rgauss
From catalog

prose": "Review and update the current access control:",
                    "parts": [
                      {
                        "id": "ac-1_smt.c.1",
                        "name": "item",
                        "props": [
                          {
                            "name": "label",
                            "value": "1."
                          }
                        ],
                        "prose": "Policy {{ insert: param, ac-1_prm_4 }} and following {{ insert: param, ac-1_prm_5 }}; and"
                      },
                      {
                        "id": "ac-1_smt.c.2",
                        "name": "item",
                        "props": [
                          {
                            "name": "label",
                            "value": "2."
                          }
                        ],
                        "prose": "Procedures {{ insert: param, ac-1_prm_6 }} and following {{ insert: param, ac-1_prm_7 }}."
                      }

In "prose": "Policy {{ insert: param, ac-1_prm_4 }} and following {{ insert: param, ac-1_prm_5 }}; and"
Currently our code only catches the first param, and old code would break if there were 2 params.
Setting up a separate rawProse and extracting each param by using a while loop made the app take about 2 full minutes to open the Access Control tab.

@zclarkEDC zclarkEDC merged commit 3d00744 into develop Apr 23, 2021
@rgauss rgauss deleted the EGRC-292 branch May 12, 2021 14:52
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.

None yet

3 participants