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

[Stack Monitoring] Verify remote cluster client role when CCS is enabled #140738

Merged
merged 3 commits into from Sep 15, 2022

Conversation

miltonhultgren
Copy link
Contributor

@miltonhultgren miltonhultgren commented Sep 14, 2022

Fixes #129546

Summary

When visiting the Stack Monitoring app, the overview page first tries to load the clusters but if any permissions are missing you get a 403 on that request which causes the app to redirect you to the access denied page.

On this page we now display a helper text stating that you might be missing the remote_cluster_client role in your "local" cluster.

Screenshot 2022-09-14 at 16 32 08

The access denied page also tries to check with the API what might be missing and if it's been resolved every 5 seconds.
Before this PR, that API check said everything was fine so it would try to return to the overview page again only to bounce back to the access denied page.

In this PR I made the API report a 403 if the remote cluster client role is missing so there is a bit less network traffic until it's resolved.

Screenshot 2022-09-14 at 16 32 49

I've also made this a specific error in the Kibana error log to make it easier to catch.

Screenshot 2022-09-14 at 16 33 31

How to test

Get the changes: git fetch git@github.com:miltonhultgren/kibana.git 129546-sm-ccs-roles:129546-sm-ccs-roles && git switch 129546-sm-ccs-roles

  1. Locally setup two clusters to configure for CCR, following the steps in here
  2. Edit the elasticsearch.yml of the cluster which the "local" and add this line: node.roles: [master, data, data_content, data_hot, data_warm, data_cold, data_frozen, ingest, ml, transform] (note that the role remote_cluster_client is missing from this list)
  3. Ingest some Stack Monitoring data into the "remote" cluster
  4. Visit the stack monitoring app and verify the above changes

@miltonhultgren miltonhultgren added release_note:skip Skip the PR/issue when compiling release notes Feature:Stack Monitoring backport:all-open Backport to all branches that could still receive a release labels Sep 14, 2022
@miltonhultgren miltonhultgren requested a review from a team as a code owner September 14, 2022 14:45
@matschaffer
Copy link
Contributor

@elasticmachine merge upstream

Copy link
Contributor

@matschaffer matschaffer left a comment

Choose a reason for hiding this comment

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

Small comment, but overall an improvement. The test failure looked unrelated so I kicked off a main merge to see if that helps.

<p>
<FormattedMessage
id="xpack.monitoring.accessDenied.noRemoteClusterClientDescription"
defaultMessage="If the setting `monitoring.ui.ccs.enabled` is set to `true`, make sure your cluster has the `remote_cluster_client` role on at least one node."
Copy link
Contributor

Choose a reason for hiding this comment

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

My first thought here is "wouldn't kibana already know if monitoring.ui.ccs.enabled is true?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I just got a little lazy 😊 I'll pull in the config on that page and only show this if it's true!

@miltonhultgren miltonhultgren enabled auto-merge (squash) September 15, 2022 09:19
@miltonhultgren miltonhultgren merged commit f014ca4 into elastic:main Sep 15, 2022
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #16 / Cases cases deletion sub privilege create two cases logging in with user cases_all_user single case view User cases_all_user can delete a case while on a specific case page
  • [job] [logs] FTR Configs #29 / dashboard app - group 1 dashboard embeddable rendering data rendered correctly when dashboard is hard refreshed

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
monitoring 478.8KB 479.2KB +358.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
monitoring 23.8KB 23.8KB +34.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 15, 2022
…led (elastic#140738)

* [Stack Monitoring] Verify remote cluster client role when CCS is enabled (elastic#129546)

* Only show UI hint if CCS is enabled

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f014ca4)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 140738

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 15, 2022
…led (#140738) (#140801)

* [Stack Monitoring] Verify remote cluster client role when CCS is enabled (#129546)

* Only show UI hint if CCS is enabled

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit f014ca4)

Co-authored-by: Milton Hultgren <milton.hultgren@elastic.co>
@tylersmalley
Copy link
Contributor

This PR missed the 8.4.2 release, so I have updated the labels to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release Feature:Stack Monitoring release_note:skip Skip the PR/issue when compiling release notes v8.4.3 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Stack Monitoring] Missing remote_cluster_client role is reported as "access denied"
5 participants