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 readonly user cannot read statistics #7001

Merged
merged 19 commits into from
Sep 20, 2024

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Sep 19, 2024

Description

This PR fixes a bug where the readonly users could not access the statistics dashboard

Issues Resolved

#6988

Evidence

image

Test

Preconditions

  1. Create a readonly user following https://documentation.wazuh.com/4.9/user-manual/user-administration/rbac.html#creating-and-setting-a-wazuh-read-only-user
  2. Ensure there indices related to wazuh-statistics-* and the index pattern is created

Steps to reproduce

  1. Login with the readonly user and go to Statistics application.
  2. Verify that no errors are shown and the dashboards are visible

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

@Tostti Tostti self-assigned this Sep 19, 2024
@Tostti Tostti linked an issue Sep 19, 2024 that may be closed by this pull request
@asteriscos asteriscos self-requested a review September 20, 2024 15:31
guidomodarelli
guidomodarelli previously approved these changes Sep 20, 2024
@guidomodarelli guidomodarelli self-requested a review September 20, 2024 15:43
@guidomodarelli guidomodarelli dismissed their stale review September 20, 2024 15:44

Missing Tests

guidomodarelli
guidomodarelli previously approved these changes Sep 20, 2024
Copy link
Contributor

@guidomodarelli guidomodarelli 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 🟢

Peek.2024-09-20.12-54.mp4

image

Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 46.02% ( 400 / 869 )
Branches 41.97% ( 157 / 374 )
Functions 44.01% ( 136 / 309 )
Lines 46.22% ( 398 / 861 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

@guidomodarelli guidomodarelli 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 🟢

Peek.2024-09-20.13-31.mp4

Copy link
Member

@asteriscos asteriscos 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: 🟢

image

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 13.91% ( 4122 / 29621 )
Branches 9.13% ( 1761 / 19288 )
Functions 13.64% ( 973 / 7129 )
Lines 14.1% ( 4022 / 28507 )

@Tostti Tostti merged commit 36fb41d into 4.10.0 Sep 20, 2024
5 checks passed
@Tostti Tostti deleted the bug/6988-readonly-user-cannot-read-statistics branch September 20, 2024 16:35
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.

Readonly users can not see wazuh-statistics-* indices
3 participants