[OpenSearch Dashboards] Create API for getting and updating advanced settings in favor of direct .kibana index operation#21038
Conversation
…ect .kibana index operation Signed-off-by: Craig Perkins <craig5008@gmail.com>
Signed-off-by: Craig Perkins <craig5008@gmail.com>
…ect .kibana index operation Signed-off-by: Craig Perkins <craig5008@gmail.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 666be7b.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Failed to generate code suggestions for PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #21038 +/- ##
============================================
+ Coverage 73.21% 73.23% +0.01%
- Complexity 72620 72638 +18
============================================
Files 5849 5858 +9
Lines 332066 332204 +138
Branches 47951 47955 +4
============================================
+ Hits 243109 243274 +165
+ Misses 69456 69390 -66
- Partials 19501 19540 +39 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Failed to generate code suggestions for PR |
|
❌ Gradle check result for a79d1b7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for a79d1b7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
Companion OpenSearch-Dashboards PR: cwperks/OpenSearch-Dashboards#3
Companion Security PR: cwperks/security#75
I'm opening up this PR to discuss something I've been thinking about for a long time. Currently, OpenSearch-Dashboards does direct indexing requests into the
.kibana*indices to store saved objects and advanced settings. This leads to a bit of oddities in how to define roles and authorize actions to these indices. They are indices that store metadata for the system, but as of today they are not formally "system" indices. As such, you see funky security configs like thekibana_userrole.This PR is intended to be a step in the direction of creating backend APIs dedicated for OpenSearch Dashboards. In fact, core already has a module called opensearch-dashboards to create dedicated Dashboards APIs though that model is unused.
With this PR in particular, I aim to solve a permissions problem with tiering access to dashboards application-wide settings (or tenant-wide settings in the case of multi-tenancy). As of today, there are 2 tiers of access:
As the names imply, read users cannot create dashboards + visualizations or update setting and write users can create dashboards + visualization and update settings.
Having only 2 tiers is quite simplistic as an admin may want to restrict who can edit application-wide settings or tenant-wide settings. With the API introduced in this PR, it would allow the security plugin to differentiate between requests that update settings vs those that create or update a saved objects. Currently, to the security plugin both of these operations are equivalent because they are an index operation to the .kibana index. By creating a dedicated API for advanced settings, security will have a better signal to differentiate between a request to update dashboards settings vs on to create or update a saved object.
So with this change and its companions there would be 3 tiers of access:
I know this change may be controversial (hopefully only at first), but I do believe that directionally that this is a direction I'd like to move towards to remove the oddities for how current-state dashboards authorization works.
Related Issues
Related to Resolves opensearch-project/security-dashboards-plugin#2337
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.