-
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
[Alerting] Restricting alerting health API to users with access to rules #118932
Conversation
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
LGTM!
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.
Changes LGTM, but I didn't find any comment under the related issue, which will lead to this solution. As I understood, this is just a partial restriction (for the users which do not have access to any rule type) and it doesn't answer all the questions from the related issue. I assume it was a verbal discussion, but it would be nice to provide the comment or document it somewhere.
@YulNaumenko Thanks for the review! Can you clarify why you consider this just a partial restriction and which questions it doesn't answer from the related issue? Believe there were several discussions during triage where it was discussed that having this API open to all users was considered a bug and that this should be restricted to users of alerting. Is there something more that this PR can do to address the issue? |
I think current PR is an elegant solution for the problem with a public access to the health API. Only one concern I had is about loosing track about agreement on the approach. Basically I was confused by the last comment #102100 (comment) which proposed to do something different.
I don't know if something is needed to be addressed. This telemetry PR #119349 is also related to the issue, so I'm wonder if something more is needed in the future. |
@YulNaumenko Gotcha. Sorry for the confusion. This PR was meant to address |
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: cc @ymao1 |
Co-authored-by: Kibana Machine <[email protected]>
Co-authored-by: Kibana Machine <[email protected]>
Addresses part of #102100
Summary
Added a check to the alerting framework health API to ensure that users have access to at least one rule type before providing health information. Takes advantage of the existing
list_rule_types
API which returns all rule types that a user has access to.To Verify
/api/alerting/_health
as user, user receives403 Forbidden
response/api/alerting/_health
Checklist