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

HTML Reports based on filter data #5595

Merged
merged 23 commits into from
Mar 21, 2024
Merged

HTML Reports based on filter data #5595

merged 23 commits into from
Mar 21, 2024

Conversation

georgedias
Copy link
Contributor

@georgedias georgedias commented Mar 1, 2024

Fixes issue #5541

Signed-off-by: George M Dias <gdias@mitre.org>
Copy link
Contributor

mergify bot commented Mar 1, 2024

This pull request has a conflict. Could you fix it @georgedias?

Signed-off-by: George M Dias <gdias@mitre.org>
@georgedias georgedias added enhancement New feature or request heimdall-frontend Issue is related to the Heimdall-Lite frontend labels Mar 1, 2024
Signed-off-by: George M Dias <gdias@mitre.org>
@georgedias georgedias requested a review from em-c-rod March 1, 2024 19:53
@georgedias georgedias requested a review from Amndeep7 March 1, 2024 21:12
Signed-off-by: Emily Rodriguez <ecrodriguez@mitre.org>
libs/hdf-converters/package.json Outdated Show resolved Hide resolved
certs/ssl_certificate.crt Outdated Show resolved Hide resolved
…different cause

Signed-off-by: Emily Rodriguez <ecrodriguez@mitre.org>
…ack that need not be changed

Signed-off-by: Emily Rodriguez <ecrodriguez@mitre.org>
@@ -29,12 +29,14 @@ type InputData = {
data: ContextualizedEvaluation | string;
fileName: string;
fileID: string;
filteredControls: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this optional? i don't think we expose filtered stuff in the saf cli so it'd be annoying to have to modify it to accept this new parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no problems making this optional, but I don't think this is used by the SAF CLI! Well at least, I was not under that impression.

Copy link
Contributor

Choose a reason for hiding this comment

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

mitre/saf#1689

work has stalled but the PR exists

* ".contains" it returns ann results where the file.evaluations
* returns the filtered controls.
*/
let filteredControls: string[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

the way that this is implemented will not satisfy the issue where it was stated that we should be able to handle any of the filters that the user specifies. this will only filter on pass/fail/whatever.

const controls = FilteredDataModule.controls({

use this example for how to get all the filter-passing controls. it should also mean that we don't need basically all of what're currently lines 122-123 and 150-164 since it'll just be a simple assignment directly onto 'filteredControls' (which can also then be made const).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely unequivocally disagree that the implementations does not satisfy the requirements. It works on all possible filtered permutations, did you even tried, apparently not if you're making this statement.
"the way that this is implemented will not satisfy the issue where it was stated that we should be able to handle any of the filters that the user specifies. this will only filter on pass/fail/whatever."

Regarding the second opinion, the code that is being referenced (from the ExportCaat.vue) will not work. If you take a look at the reverse-html-mapper.ts it uses the file.data, which is the file.evaluation being set in ExportHTMLModule.vue and you are comparing to this code in the ExportCaat,vue const data = file?.evaluation ?? ''; now how does that filters the proper evaluations? it doesn't. The code on both are accomplishing different tasks.

Copy link
Contributor

Choose a reason for hiding this comment

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

image

image

Here I've filtered it down to a single control using the nist filters. The html export does not only include that single control. Consequently, it does not meet the requirement of the original ticket according to my reading of it. Like I said elsewhere, we should get @em-c-rod or @ejaronne's opinions on which of our interpretations is correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

w/r to your second paragraph, I'm only talking about extracting out the set of controls that pass the filtering. You can use the store to get that set I'm hoping.

Copy link
Contributor

Choose a reason for hiding this comment

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

This may be a use case, but the ask for this is just to be able to show only the failed controls (aka filter on status). If this becomes an additional ask, we can make another PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I do think it is relevant to consider severity filters here. Looking at severity filters as well was not explicitly the ask, but seems like it is paired in the same use case.

Copy link
Contributor Author

@georgedias georgedias left a comment

Choose a reason for hiding this comment

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

To be fair, the UC was to show report based on filtering data aka, Passed, Failure, etc. not filtered on NIST controls, there is, we’re just filtering on STIG control status.
For future implementation for the HTML Export process I proposed the format provided in issue #5596

@Amndeep7
Copy link
Contributor

Amndeep7 commented Mar 5, 2024

"I want to export reports of only the failures in a set of results, for example, or whatever I have filtered in the results view."

I read this as supporting any/all filtering, but I could be wrong.

@em-c-rod can you please provide input? You saying that you want to match the behavior of the other exports is unfortunately not usable input since there is unfortunately a wide variety of behaviors that occur.

@Amndeep7
Copy link
Contributor

Amndeep7 commented Mar 5, 2024

I'm not gonna make it a blocker, but it would be nice if we could actually do the filtering process for an execjson within the store so that we don't need to pass around a set of controls at all. This'll make both the mappers easier to implement due to them not needing to understand any filtering concepts at all and heimdall integrations with these mappers easier to write and overall less duplicative due to just needing to call the one store function instead of each mapper needing to implement filtering in its own special way.

@aaronlippold
Copy link
Member

Adding methods or computed properties into the store - from the docs - seems to be the intended implemntation in the Vuex world. https://v3-migration.vuejs.org/breaking-changes/filters.html

Given that we will eventually move to https://pinia.vuejs.org/core-concepts/getters.html moving the processing to the backend / middleware seems a good way to be able to reuse it with other parts of the GUI.

aaronlippold and others added 3 commits March 10, 2024 16:58
Signed-off-by: George M Dias <gdias@mitre.org>
Signed-off-by: George M Dias <gdias@mitre.org>
Signed-off-by: Emily Rodriguez <ecrodriguez@mitre.org>
Copy link

sonarcloud bot commented Mar 21, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@em-c-rod em-c-rod merged commit 0103c18 into master Mar 21, 2024
17 checks passed
@em-c-rod em-c-rod deleted the htmlFilteredReports branch March 21, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request heimdall-frontend Issue is related to the Heimdall-Lite frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants