-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow Plugins to request to perform cluster actions and index actions with their assigned PluginSubject and prompt on install #15778
Open
cwperks
wants to merge
25
commits into
opensearch-project:main
Choose a base branch
from
cwperks:identity-aware-plugin-request-perms
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.
Open
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
43e8974
WIP on requesting perms and displaying on install
cwperks a841f06
Actually compile a fake plugin in InstallPluginCommandTests
cwperks edfbe36
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks 5821632
Add test for prompt when installing IdentityAwarePlugin
cwperks 1106978
Update warning message
cwperks 4a29367
Get requested actions from plugin-permissions.yml
cwperks f4bd921
Allow plugin dev to configure a description to describe why plugin is…
cwperks 454a5dd
Add requested actions to PluginInfo and pass PluginInfo IdentityPlugi…
cwperks c031a1b
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks a2fb0fd
Add null check
cwperks 758b671
Check stream version
cwperks 4cdd593
Check version when serializing
cwperks 394c47a
Handle case where requestedActions is null
cwperks fde386d
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks 157740b
Ensure requestedActions is non-null
cwperks bf44a29
Simplify tests
cwperks 8b16051
modify correct build.gradle
cwperks c12df2d
Remove unused code
cwperks abbb6f0
Remove unused import
cwperks df6853b
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks 6b64364
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks 51a6cde
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks 5b8c079
Update ToXContent
cwperks ddeb16b
Set to CURRENT until backport
cwperks ea1af1f
Merge branch 'main' into identity-aware-plugin-request-perms
cwperks 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
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.
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.
Why do we need to use
PluginInfo
? Plugin does not need to be told what permissions it is allowed to use: it comes from its permissions policy.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.
Its lighter-weight than Plugin and its the vehicle that carries the actions that a plugin may request to perform with its PluginSubject.
The security plugin would need these 2 pieces of information to form the PluginSubject:
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.
Got it, this is indeed the conceptual problem (at least I overlooked). I think this pull request is a bit ahead of its time, here is my reasoning:
security
plugin feature, andI still think that the idea to expose the plugin permissions is sound but we need a way to formalize the permissions first and (may be?) make core / other plugins aware of them (basically, do what we have done with
Subject
etc).Why I think that is important, when we install any plugin right now, the security policy will be enforced no matter what. With permissions, as it stands now, this is purely hint, nothing will happen if
security
plugin is not installed / disabled (or any other its replacement is present).@peternied sorry to dragging you here, but I think the subject of permissions what discussed before, right?
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.
FWIW I think presenting this information to an administrator installing a plugin empowers them with more information about what actions a plugin will perform in the cluster regardless if the security plugin is installed or not.
I left a comment here about complications of putting system index protection directly in the core. The biggest challenge with that is that operators may need to be able to perform invasive actions on system indices and do so by presenting the admin certificate which is another feature of the security plugin.
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.
JSM Permissions actually work the same way. A cluster operator is prompted with the permissions on install even if they run opensearch with JSM disabled.
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.
This is right, and I agree with that. The question is how to do that in a way that if administrator says "Looks good" but nothing is enforced?
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.
You're right its not possible to disable outside of the tests. JSM being removed in JDK 24 is a disruptive change. lmk if I can help with review on any items.
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.
Please join the discussion #1687 (with respect to JDK-24 subject)
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.
Hey @reta, I opened a draft PR in core to add a new sandbox module for system index protection: #16695
In its current state it is a crude implementation and would need to be expanded upon to match the functionality that the security plugin provides.
I wanted to open a draft to demonstrate some of the challenges in moving system index protection to the core. Ultimately, I think it is a good idea so that they are protected regardless if the security plugin is installed and enabled.
One of the biggest challenges is generic ActionRequest -> indices() resolution in an action filter. The way this works in the security plugin is the IndexResolverReplacer.getOrReplaceAllIndices().
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.
Apologies for the delay @cwperks , I will try to find the time next week to look at it, thanks !