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

Fix filtering of not applicable SCA checks using result filter #5031

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Dec 22, 2022

Description

This PR:

  • Change the filter of not applicable SCA checks to use result filter instead of status
  • Remove the status filter suggestion of the SCA checks search bar
  • Sort the filters displayed in the search bar.
  • Unify the SCA check result label in:
    • Module/Security configuration asssessment/Inventory policies table
    • Module/Security configuration asssessment/Inventory visualization legend
    • Module/Security configuration asssessment/Inventory/Policy checks table
    • Agents/:agent/overview SCA policies table

Issues Resolved

Closes #5027

Evidence

Unify SCA check result label name
image
image
image

Filter in the search bar
image

Suggestions in the search bar
image

Test

⚠️ Some tests require to mock the SCA check or using a Wazuh manager that has implemented the unification of status and result properties.

Patch for imposter:
wazuh-kibana-app-pr-5031-imposter.txt

The scenarios could use a Wazuh manger built from the [dev-sca-policy-checks-result](https:/wazuh/wazuh/tree/dev-sca-policy-checks-result) branch.

Scenario 1 The Not applicable kpi filters by result: not applicable in the SCA checks
Given a SCA policy with not applicable checks
When the user clicks on the Not applicable stat
Then a result: not applicable filter is added to the search bar
And the table should fetch the data whose SCA checks are not applicable and display them

Scenario 2 The SCA checks suggestions should not display the status filter key
When the user clicks on the search bar
Then the status filter should not be displayed

Scenario 3 The SCA checks filter keys should be sorted alphabetically
When the user clicks on the search bar
Then the filter keys should be sorted alphabetically

Scenario 4 The kpis in the SCA checks are labeled
When the user navigates to the SCA checks
Then the kpi that displays the checks that passed is labeled as Passed
And the kpi that displays the checks that failed is labeled as Failed
And the kpi that displays the checks that are not applicable is labeled as Not applicable

Scenario 5 The result for the checks displayed in the SCA checks table are labeled
When the user navigates to the SCA checks table
Then the check that passed is labeled as Passed
And the check that failed is labeled as Failed
And the check that didn't apply is labeled as Not applicable

Scenario 6 The result for the checks displayed in the SCA policies table are labeled
When the user navigates to the SCA policies table
Then the checks count that passed are labeled as Passed
And the checks count that failed are labeled as Failed
And the checks count that didn't apply are labeled as Not applicable

Scenario 7 The results for the checks displayed in the SCA policies visualization are labeled
When the user navigates to the SCA policies and sees the visualizations
Then the checks count that passed are labeled as Passed
And the checks count that failed are labeled as Failed
And the checks count that didn't apply are labeled as Not applicable

Scenario 8 The results for the checks displayed in the SCA policies table in the agent overview are labeled
When the user navigates to the agent overview and sees the SCA policies table
Then the checks count that passed are labeled as Passed
And the checks count that failed are labeled as Failed
And the checks count that didn't apply are labeled as Not applicable

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@Desvelao Desvelao requested a review from a team as a code owner December 22, 2022 11:19
@Desvelao Desvelao self-assigned this Dec 22, 2022
@Desvelao Desvelao linked an issue Dec 22, 2022 that may be closed by this pull request
2 tasks
yenienserrano
yenienserrano previously approved these changes Dec 22, 2022
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM

Scenario 1 🟢

image

Scenario 2 🟢

image

Scenario 3 🟢

image

Scenario 4 🟢

image

Scenario 5 🟢

image

Scenario 6 🟢

image

Scenario 7 🟢

image

Scenario 8 🟢

image

yenienserrano
yenienserrano previously approved these changes Dec 22, 2022
yenienserrano
yenienserrano previously approved these changes Jan 2, 2023
chantal-kelm
chantal-kelm previously approved these changes Jan 5, 2023
Copy link
Member

@chantal-kelm chantal-kelm left a comment

Choose a reason for hiding this comment

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

CR: ✅
TEST: ✅

@yenienserrano yenienserrano dismissed stale reviews from chantal-kelm and themself via bf7fbb4 January 6, 2023 14:50
@chantal-kelm chantal-kelm self-requested a review January 6, 2023 14:50
Copy link
Member

@chantal-kelm chantal-kelm left a comment

Choose a reason for hiding this comment

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

CR: ✅
TEST: ✅

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

Code coverage (Jest) % values
Statements 8.72% ( 3225 / 36950 )
Branches 4.55% ( 1306 / 28685 )
Functions 7.62% ( 698 / 9160 )
Lines 8.79% ( 3110 / 35381 )

@yenienserrano yenienserrano merged commit dd81bc6 into 4.4-2.4-wzd Jan 6, 2023
@yenienserrano yenienserrano deleted the fix/5027-filter-not-applicable-sca-checks-using-result-property branch January 6, 2023 14:55
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

The backport to 4.4-7.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.4-7.16 4.4-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.4-7.16
# Create a new branch
git switch --create backport-5031-to-4.4-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dd81bc669e6d2748a7b17a41b104557da339f327
# Push it to GitHub
git push --set-upstream origin backport-5031-to-4.4-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.4-7.16

Then, create a pull request where the base branch is 4.4-7.16 and the compare/head branch is backport-5031-to-4.4-7.16.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

The backport to 4.4-7.10 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.4-7.10 4.4-7.10
# Navigate to the new working tree
cd .worktrees/backport-4.4-7.10
# Create a new branch
git switch --create backport-5031-to-4.4-7.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 dd81bc669e6d2748a7b17a41b104557da339f327
# Push it to GitHub
git push --set-upstream origin backport-5031-to-4.4-7.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.4-7.10

Then, create a pull request where the base branch is 4.4-7.10 and the compare/head branch is backport-5031-to-4.4-7.10.

yenienserrano pushed a commit that referenced this pull request Jan 6, 2023
…5031)

* fix(sca): change the filter of not applicable SCA checks to use result and remove the `status` filter in the search bar

* fix(sca): sort the filters keys in the suggestions of the SCA checks search bar

* changelog: add the pull request entry

* fix(sca): remove hardcoded `Not applicable` string when the SCA check result was falsy. Now it uses the result value.

* fix: unify the SCA check result label name

* changelog: add pull request entry

* fix: update the API data (endpoints and security actions)

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Chantal Belén kelm <[email protected]>
(cherry picked from commit dd81bc6)
yenienserrano pushed a commit that referenced this pull request Jan 6, 2023
…5031)

* fix(sca): change the filter of not applicable SCA checks to use result and remove the `status` filter in the search bar

* fix(sca): sort the filters keys in the suggestions of the SCA checks search bar

* changelog: add the pull request entry

* fix(sca): remove hardcoded `Not applicable` string when the SCA check result was falsy. Now it uses the result value.

* fix: unify the SCA check result label name

* changelog: add pull request entry

* fix: update the API data (endpoints and security actions)

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Chantal Belén kelm <[email protected]>
(cherry picked from commit dd81bc6)
yenienserrano pushed a commit that referenced this pull request Jan 6, 2023
… `result` filter (#5083)

Fix filtering of `not applicable` SCA checks using `result` filter (#5031)

* fix(sca): change the filter of not applicable SCA checks to use result and remove the `status` filter in the search bar

* fix(sca): sort the filters keys in the suggestions of the SCA checks search bar

* changelog: add the pull request entry

* fix(sca): remove hardcoded `Not applicable` string when the SCA check result was falsy. Now it uses the result value.

* fix: unify the SCA check result label name

* changelog: add pull request entry

* fix: update the API data (endpoints and security actions)

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Chantal Belén kelm <[email protected]>
(cherry picked from commit dd81bc6)

Co-authored-by: Antonio <[email protected]>
yenienserrano pushed a commit that referenced this pull request Jan 6, 2023
…g `result` filter (#5082)

Fix filtering of `not applicable` SCA checks using `result` filter (#5031)

* fix(sca): change the filter of not applicable SCA checks to use result and remove the `status` filter in the search bar

* fix(sca): sort the filters keys in the suggestions of the SCA checks search bar

* changelog: add the pull request entry

* fix(sca): remove hardcoded `Not applicable` string when the SCA check result was falsy. Now it uses the result value.

* fix: unify the SCA check result label name

* changelog: add pull request entry

* fix: update the API data (endpoints and security actions)

Co-authored-by: Ian Yenien Serrano <[email protected]>
Co-authored-by: Chantal Belén kelm <[email protected]>
(cherry picked from commit dd81bc6)

Co-authored-by: Antonio <[email protected]>
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.

Not applicable SCA checks should be filtered by result
3 participants