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

[BUG] [MDS] No available datasources or illegal datasource crashes the plugin #1934

Closed
derek-ho opened this issue May 2, 2024 · 6 comments
Closed
Assignees
Labels
bug Something isn't working triaged

Comments

@derek-ho
Copy link
Collaborator

derek-ho commented May 2, 2024

What is the bug?
When no datasources available, or illegal option passed in via URL the plugin crashes

How can one reproduce the bug?

  • enable MDS
  • navigate to the security dashboards plugin
  • Pass in either non-existent datasource, or no datasources connected
Screenshot 2024-05-01 at 11 18 39 AM

What is the expected behavior?

Screenshot 2024-04-19 at 11 16 01 AM

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

@derek-ho derek-ho added bug Something isn't working untriaged labels May 2, 2024
@DarshitChanpura DarshitChanpura self-assigned this May 2, 2024
@stephen-crawford
Copy link
Contributor

[Triage] Hi @derek-ho thanks for filing this issue. The follow-up design you provided seems like a good way to handle this scenario and looks like you have a good start on this. Going to mark triaged.

@DarshitChanpura
Copy link
Member

A way to reproduce this issue:

  1. Log in as admin and create a user with security_rest_api_access role mapped to it (To be able to access the Security tab in left navigation pane)
  2. Create a dataSource connection to another cluster, say 9202.
  3. Now set 9202 as default dataSource.
  4. Log out as admin and login as the newly created user.
  5. Navigate to Security tab and you should see the following screen:
Screenshot 2024-05-07 at 2 30 26 PM

@DarshitChanpura
Copy link
Member

A BIG QUESTION here is if the user doesn't have access to default data-source then Switch to default data-source button is of no use since it will always bring you back to the same screen.

@stephen-crawford
Copy link
Contributor

@DarshitChanpura @derek-ho do we have the ability to fetch a list of accessible datasources based on permissions? For instance, can we know that User A definitely has access to Datasource 1?

If so, we may be able to redirect to default if is accessible by the user and otherwise the last accessed datasource they have permission for?

If not, I suggest we enforce access for a disconnected landing page all users can hit. Similar to the login screen where they are not yet auth'd we can kick them back to a landing page regardless of their permissions and then have deterministic behavior in the case where the datasource is not permitted.

@DarshitChanpura
Copy link
Member

do we have the ability to fetch a list of accessible datasources based on permissions? For instance, can we know that User A definitely has access to Datasource 1?

No we do not. DataSources information is stored as saved object inside the kibana and tenant index. When aggregation view is enabled, the user will require read permissions to the tenant which contains that particular datasource.

If not, I suggest we enforce access for a disconnected landing page all users can hit. Similar to the login screen where they are not yet auth'd we can kick them back to a landing page regardless of their permissions and then have deterministic behavior in the case where the datasource is not permitted.

There is no way to enforce that right now, so instead we bring them to a page which allows them to switch to local cluster. This scenario will only be required when aggregation view is enabled. When it is disabled, the page auto-reloads with default datasource.

@DarshitChanpura
Copy link
Member

Corresponding PR closed. No plan to fix.

@DarshitChanpura DarshitChanpura closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triaged
Projects
None yet
3 participants