-
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
[Saved Queries] Rework saved query privileges #202863
Open
davismcphee
wants to merge
83
commits into
elastic:main
Choose a base branch
from
davismcphee:rework-saved-query-privileges
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,435
−1,495
Open
Changes from all commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
be94cfe
Remoe saveQueryMenuVisibility
davismcphee 82135fc
Removed unused prop
davismcphee 154ddfa
Deprecate features
davismcphee dc5dd8b
Map deprecated feature privileges
davismcphee d7c7492
Merge branch 'main' into rework-saved-query-privileges
davismcphee 530be40
Update savedQueryManagement read privilege
davismcphee e283580
Fix reporting privileges
davismcphee 9a7669f
Rename feature_discover to feature_discover_v2
davismcphee ecbbd1b
Replace feature_visualize with feature_visualize_v2
davismcphee d9ffd02
Replace feature_dashboard with feature_dashboard_v2
davismcphee f4300c6
Replace feature_maps with feature_maps_v2
davismcphee 342c0d2
Replace maps UI capabilities with maps_v2
davismcphee 5f1aecf
Replace discover UI capabilities with discover_v2
davismcphee 6462941
Fix types
davismcphee ecd017a
Replace dashboard UI capabilities with dashboard_v2
davismcphee c6caf36
Replace visualize UI capabilities with visualize_v2
davismcphee 54530cd
Update serverless roles
davismcphee c3631a3
Update docs
davismcphee 7438ac2
Fix more capabilities references
davismcphee 7b80270
Fix some Jest tests
davismcphee eecd961
Try to catch remaining references in CI
davismcphee c285640
Fix more Jest tests
davismcphee 257aefb
Update capabilitiesProvider return values
davismcphee ecd00f2
Merge branch 'main' into rework-saved-query-privileges
davismcphee d812bf2
Update Capabilities def to try to catch more errors
davismcphee 694988a
Merge branch 'main' into rework-saved-query-privileges
davismcphee 36785cf
Revert "Update Capabilities def to try to catch more errors"
davismcphee 5492bda
Another shot at catching dangling refs
davismcphee a4c9658
Fix spaces authorization bug
davismcphee 2cfa7d4
Merge branch 'main' into rework-saved-query-privileges
davismcphee 08c2e0f
Merge branch 'main' into rework-saved-query-privileges
davismcphee 9ed56a6
Add minimal replacedBy
davismcphee adb4b53
Fix issue where Kibana fails to start when there are replacedBy privi…
davismcphee ae13ef7
Fix issue checking for discover navLink
davismcphee a4d46f7
Remove v1 privileges saveQuery references
davismcphee 7b4c8e9
Update failing tests
davismcphee 9e38a78
Merge branch 'main' into rework-saved-query-privileges
davismcphee ca08ea1
Update Jest snapshots
davismcphee c0175c9
Fixing functional tests
davismcphee 46a10d1
Revert quote changes in yml files
davismcphee c399174
Update serverless yml files
davismcphee 3fd0fee
Merge branch 'main' into rework-saved-query-privileges
davismcphee dfed85d
Merge branch 'main' into rework-saved-query-privileges
davismcphee 7235ea8
Fix functional tests
davismcphee e8edb23
Only show saved query management in the UI with savedQueryManagement …
davismcphee 7acd0e2
Update docs and upgrade notes
davismcphee 505cfd7
Fix undefined error and update tests
davismcphee cdb4da3
Remove .only in test
davismcphee f4a565a
Merge main, fix conflict
kertal 049f07d
Apply suggestions by @azasypkin
kertal 1eadd4f
Merge branch 'main' into rework-saved-query-privileges
kertal 42bfe4c
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine 2a5a720
Merge branch 'main' into rework-saved-query-privileges
kertal 80062a7
Merge remote-tracking branch 'upstream/main' into rework-saved-query-…
kertal 9d693c0
Fix tests
kertal 59a8dca
Merge remote-tracking branch 'upstream/main' into rework-saved-query-…
kertal 2d2c7be
Fix type error
kertal 01354de
Merge remote-tracking branch 'upstream/main' into rework-saved-query-…
kertal 1ac85f5
Merge branch 'main' into rework-saved-query-privileges
davismcphee 2a1431b
Update initSpacesOnPostAuthRequestInterceptor to use FeaturesPluginSt…
davismcphee 392ee3f
Update deprecated feature display names
davismcphee 9f5d07b
Fix broken type
davismcphee cc2229f
Merge branch 'main' into rework-saved-query-privileges
davismcphee 069e8f8
Merge branch 'main' into rework-saved-query-privileges
davismcphee ebf724d
Add allowSavingQueries prop to control if queries can be saved
davismcphee 5e78180
Update upgrade notes
davismcphee 2553533
Merge branch 'main' into rework-saved-query-privileges
davismcphee a4e9f98
Merge branch 'main' into rework-saved-query-privileges
davismcphee d81d900
Fix broken test
davismcphee 01bd64c
Fix test failures
davismcphee a3cb358
Merge branch 'main' into rework-saved-query-privileges
davismcphee 7351b70
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine 71282ba
Add feature replacedBy props
davismcphee 587233d
Add functional tests for deprecated features
davismcphee 034c5db
Update yml config
davismcphee b137d34
Updates snapshot in serverless sec sol authz for deprecated composite…
jeramysoucy 3e0182a
Merge branch 'main' into rework-saved-query-privileges
davismcphee 9786c73
Merge branch 'main' into rework-saved-query-privileges
davismcphee 547744d
Revert changes to x-pack/test/functional/es_archives/alerting/8_2_0/d…
davismcphee 1e9dc0d
Fix snapshot
davismcphee d6fe93d
Merge branch 'main' into rework-saved-query-privileges
davismcphee 3469d55
Fix overrides in serverless.yml
davismcphee 82727a4
Update snapshots
davismcphee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,9 +16,9 @@ xpack.searchIndices.enabled: false | |
## Fine-tune the security solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. | ||
xpack.features.overrides: | ||
### Dashboard feature is hidden in Role management since it's automatically granted by SIEM feature. | ||
dashboard.hidden: true | ||
dashboard_v2.hidden: true | ||
### Discover feature is hidden in Role management since it's automatically granted by SIEM feature. | ||
discover.hidden: true | ||
discover_v2.hidden: true | ||
### Machine Learning feature is moved from Analytics category to the Security one as the last item. | ||
ml: | ||
category: "security" | ||
|
@@ -29,25 +29,29 @@ xpack.features.overrides: | |
### Security's `All` feature privilege should implicitly grant `All` access to Discover, Dashboard, Maps, and | ||
### Visualize features. | ||
all.composedOf: | ||
- feature: "discover" | ||
- feature: "discover_v2" | ||
privileges: [ "all" ] | ||
- feature: "dashboard" | ||
- feature: "dashboard_v2" | ||
privileges: [ "all" ] | ||
- feature: "visualize" | ||
- feature: "visualize_v2" | ||
privileges: [ "all" ] | ||
- feature: "maps" | ||
- feature: "maps_v2" | ||
privileges: [ "all" ] | ||
- feature: "savedQueryManagement" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
privileges: [ "all" ] | ||
# Security's `Read` feature privilege should implicitly grant `Read` access to Discover, Dashboard, Maps, and | ||
# Visualize features. Additionally, it should implicitly grant privilege to create short URLs in Discover, | ||
### Dashboard, and Visualize apps. | ||
read.composedOf: | ||
- feature: "discover" | ||
- feature: "discover_v2" | ||
privileges: [ "read" ] | ||
- feature: "dashboard_v2" | ||
privileges: [ "read" ] | ||
- feature: "dashboard" | ||
- feature: "visualize_v2" | ||
privileges: [ "read" ] | ||
- feature: "visualize" | ||
- feature: "maps_v2" | ||
privileges: [ "read" ] | ||
- feature: "maps" | ||
- feature: "savedQueryManagement" | ||
privileges: [ "read" ] | ||
|
||
## Cloud settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Originally I replaced the existing discover/dashboard/visualize/maps overrides with the v2 features, but I encountered authorization errors in
x-pack/test_serverless/functional/test_suites/observability/role_management/custom_role_access.ts
for a role with the v1 Discover feature. I'm not sure how this is supposed to work, but it seemed like the overrides weren't applied when the feature was mapped to v2, so I instead duplicated the overrides for v2 features.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.
Yeah, unfortunately, we have to keep the privileges portion of overrides for the deprecated features, as they are still registered and referenced by existing/old roles. However, we can drop the category property.
The confusion probably stems from the fact that roles or privileges are not mutated/migrated in the traditional sense - we keep both old and new features, along with their feature privileges, at the same time. Old roles will continue to refer to the old privileges (unless re-saved by admin), while new roles will refer to the new privileges. We only ensure that the new feature privilege provides at least the same level of access as the deprecated features did.