-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Infra][ECO] Fix RBAC issue in hosts view #199841
Conversation
/ci |
739a20c
to
19f0e7c
Compare
/ci |
139206d
to
0cb2146
Compare
0cb2146
to
24ec3e3
Compare
/ci |
92ab4e6
to
7454b48
Compare
7454b48
to
914bff5
Compare
/ci |
/ci |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
@elasticmachine merge upstream |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
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.
The code LGTM 🚀
One security concern: I am not sure if that's related to the change but if the user is restricted to read everything in observability except APM and has restricted indices he is still able to see the services in the details view (the link won't navigate to APM because the user doesn't have the permission - it will be Application not found
) but should we still show the services section/name in the host view if we set that restriction (no APM UI/Indecies access)?
The role I created to test this case:
no_apm_permission.mov
This could be something to address separately from this PR
Hey @jennypavlova, great finding. In such cases we should IMO show the services but not link to APM. Users can still query for APM data in Discover, so the data is not restricted. What is restricted in your scenario is the access to APM app. edit: let's open a new ticket for this problem |
@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.
Changes to x-pack/plugins/observability_solution/apm_data_access/kibana.jsonc lgtm
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11952856046 |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
2 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
closes [elastic#200151](elastic#200151) ## Summary This PR change the `getApmIndices` function from `apm_data_access` to fetch the information using Kibana's internal user. This was done for 2 reasons: 1 - Plugins using `savedObjects.client` might face a situation where the logged in user doesn't have permission to read saved objects, causing the retrieval of apm indices to fail, which could lead to unexpected exceptions 2 - Elasticsearch is able to determine whether the user has permission to view docs in the index patterns, therefore, it's ok to retrieve the index pattern with Kibana's internal user because ultimately elasticsearch will only return the data the user has access to. ### Infra app permission **Role config:** <img width="500" alt="image" src="https://github.com/user-attachments/assets/ae98a98f-570a-4139-b804-91a8de0c9d1d"> <img width="500" alt="image" src="https://github.com/user-attachments/assets/afe29e7f-ab02-40f4-a86c-aeb016655708"> **Without access to APM indices** <img width="500" alt="image" src="https://github.com/user-attachments/assets/8aa7d4e5-3484-4723-838c-54920e442c08"> <img width="500" alt="image" src="https://github.com/user-attachments/assets/af3ce400-7a45-4313-84c7-5b8170c39bf5"> **With access to APM indices** <img width="500" alt="image" src="https://github.com/user-attachments/assets/1effc137-72a2-4e5b-b2ac-62e685370a21"> <img width="500" alt="image" src="https://github.com/user-attachments/assets/e161f6d9-85a7-4f80-a7d3-7ec0bdc338a3"> ### Admin <img width="500" alt="image" src="https://github.com/user-attachments/assets/d280f0d6-de6c-408f-a080-fa150d237afc"> ### How to test - Follow the steps above - Other areas affected: assistant and profiling --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Friendly reminder: Looks like this PR hasn’t been backported yet. |
2 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
This reverts commit 209c667.
closes #200151
Summary
This PR change the
getApmIndices
function fromapm_data_access
to fetch the information using Kibana's internal user. This was done for 2 reasons:1 - Plugins using
savedObjects.client
might face a situation where the logged in user doesn't have permission to read saved objects, causing the retrieval of apm indices to fail, which could lead to unexpected exceptions2 - Elasticsearch is able to determine whether the user has permission to view docs in the index patterns, therefore, it's ok to retrieve the index pattern with Kibana's internal user because ultimately elasticsearch will only return the data the user has access to.
Infra app permission
Role config:
Without access to APM indices
With access to APM indices
Admin
How to test