-
Notifications
You must be signed in to change notification settings - Fork 58
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
[FEATURE] [DISCUSS] Implement Proxy Actions #525
Comments
Thanks @dbwiddis for writing this up, I support this approach to triggering extension actions from another extension. I believe we can utilize a similar approach to support executing non-extension actions registered in OpenSearch as well. For instance, in Anomaly Detection
Since the Hooking onto your approach for bullet point four :
We can add a check if the underlying action is executable via the provided node client within |
Thanks, @joshpalis, using OpenSearch actions was definitely one of the use cases I considered, and am contemplating how to potentially register some actions as "proxy actions" so they can be executed. One concern I have is along the security front, though. How do we prevent any extension from arbitrarily executing actions on other extensions (or on OpenSearch if we enable that)? We're trying to use the Rest API as a single point of contact for "executing" things because it will include the appropriate authorization checks, but these transport-based calls completely bypass that. I'd even think we'd want to "opt in" to any particular action being enabled for remote execution, so it's more complex than just registering a list. |
Thanks @dbwiddis and @joshpalis for writing this up. The feature @dbwiddis talks about is to abstract the handling which is directly an overhead for extension instead move it over to @joshpalis I understand you are hitting into a problem with extension to call an action registered on OpenSearch which is not supported. Also extension to extension communication can be done via These are 2 separate problems. Here are my thoughts:
Let know me your thoughts @dbwiddis @joshpalis |
Also this makes me think we have write up some design tenets for extensions. I can pick this up to provide general guidelines for all extension developers if that helps. |
@dbwiddis In response to:
See discussions here and here and please chime in with any ideas. The issue is discussing creating policy files for extensions to define the actions an extension is permitted to perform. If I'm reading this thread correctly it sounds like before the ProxyAction destined for another extension gets routed to the other extension that it will go through core first. When it gets to core, could that trigger the authz checks to determine if the extension is permitted to perform the action? |
Hey @scrawfor99 thanks for chiming in and linking those two issues. We definitely need to integrate with this process.
(waving hands vaguely) Yes. More specifically, there are going to be multiple layers of permissions.
On top of this there should be some tenets for how/when we trigger remote things, like "prioritize using REST API for invoking remote actions elsewhere, if that's possible to do". Proxy actions should probably be the exception rather than the rule. |
@peternied , @cwperks do share your thoughts from security end. |
The idea that an extension might provide functionality via that aren't exposed as REST APIs seems broken, why shouldn't external callers be able to perform the same kinds of actions as an extension? From a security perspective, if we have additional ways to trigger actions REST API vs proxy we should still have consistent security enforcement. Sounds like there will be additional security requirements for this enforcement - I think we would need more design detail to figure out how to support a new require, more detailed scenario and data flow diagram. Please @ mention me if you'd like a more in depth review. |
I think this should tag @cwperks :) |
Hey @peternied @scrawfor99 @cwperks and anyone else following along. :) I need to do something to implement this in order to enable Job Scheduler -> Anomaly Detector actions. I'll probably do that later this week. My plan is to:
I know (and we all know) this isn't the final solution. |
To everyone who has liked, subscribed, and purchased a product from my sponsor, see opensearch-project/OpenSearch#6734 for the OpenSearch side of this implementation and yell if you see any problems. |
The draft OpenSearch action is in a mostly finished state. I'll start working on the SDK side (this issue) which should work with either the existing (ProxyAction) or new (Dynamic Actions) arrangement, as the handler transport will be the same for both. Key point is I like the new dynamic actions from the standpoint of funneling all remote actions through the NodeClient's |
Have this done as far as sending the request to OpenSearch, fixing some bugs along the way. Just need to handle the forwarded request. Making notes of the sequence here since I've confused myself several times with the 4-way communication, this will eventually find its way into a sequence diagram:
|
🚀 |
Is your feature request related to a problem?
The
getActions()
extension point has been implemented and allows an extension to execute its own actions. On OpenSearch, theProxyAction
handlers have been implemented to register these actions and forward requests to extensions. However, there is no handling of these actions on the SDK.What solution would you like?
ExtensionsRunner
to always instantiateSDKActionModule
. Move theActionExtension
conditional into the module where thegetActions()
extension point is read.ProxyAction
to OpenSearch to be executed on another extension. Handle the response.SDKActionModule
SDKActionModule
'sgetActions()
to find the action to execute. Send the appropriate response.actions
exceptions: there will never be a null action map; and change the "this action isn't registered in this extension" to a fallback where the action is sent to OpenSearch via the (registered) action from the steps above.ProxyAction
for this purpose so no fallback is needed/desiredWhat alternatives have you considered?
Forward requests to OpenSearch in a way other than sending an action.
Do you have any additional context?
See #107 for long term improvements on this approach.
The text was updated successfully, but these errors were encountered: