-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Monitoring] Handle setup mode if security is disabled #53306
[Monitoring] Handle setup mode if security is disabled #53306
Conversation
Pinging @elastic/stack-monitoring (Team:Monitoring) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job 👍 Works as expected!
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
I'm going to hold off on this until elastic/elasticsearch#50288 is available in a testable snapshot |
return get(response, 'has_all_requested', false); | ||
} catch (err) { | ||
if ( | ||
err.message === 'no handler found for uri [/_security/user/_has_privileges] and method [POST]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kobelb I know we discussed this awhile back, but I'm revisiting this PR and wondering if you think this check is sufficient enough. We can either do this, or do a pre-flight check for the security feature on the cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've had to do similar checks elsewhere. It's not perfect, but it generally works. I would however encourage you to write an integration test against Elasticsearch to ensure that if they change their error messages, that the test begins to fail. These error messages are prone to change.
@elasticmachine merge upstream |
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Handle setup mode if security is disabled * Rename so the test actually runs, and fix/add tests * Use es.js api instead of transport.request * Revert "Use es.js api instead of transport.request" This reverts commit ae0e48f. * Explicitly handle security not enabled Co-authored-by: Elastic Machine <[email protected]>
* Handle setup mode if security is disabled * Rename so the test actually runs, and fix/add tests * Use es.js api instead of transport.request * Revert "Use es.js api instead of transport.request" This reverts commit ae0e48f. * Explicitly handle security not enabled Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Backport: 7.x: 535114d |
Resolves #53129
To test, start up a fresh ES/Kibana with security disabled. Try clicking the
Set up monitoring with Metricbeat
If we can get some resolution elastic/elasticsearch#50288, we might be able to simplify this code by simply looking at the exception message. As it stands, the exception message doesn't explicitly tell us security is not enabled.