-
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
Action registration / framework level license check #54946
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
Getting a list of existing built-in action types should be easy. I think we'll then have a couple of different flavors of "availability":
For actionTypes that aren't "built-in" in that they aren't defined in the action plugin, but in some other plugin, I think we want to consider these as "built-in", so I think we'll have to hard-code these somehow in the actions plugin. We don't have any of these yet ... |
There was some discussion that an execution-time check might be better than a registration time check, because it simplifies cases like trial licenses, license upgrade/downgrade - you don't have to restart Kibana. So you'd be able to register any action you want, but it may not execute based on the default action license level. So maybe the simplest option is just to have a "default" action license level? Any action that gets registered can optionally set itself higher than the default, but not lower. If we want it to be lower we have to put it in a list of exceptions in the actions framework. |
Ya, seems like execution-time check would be good, would it make sense to do both? Seems confusing to be able to create an action that would fail execution because of license checks. In the UI, we could provide some kind of warning, but we don't really have a concept of doing that with the REST API. I guess the question is, what scenario breaks if we do both creation-time and execution-time checks? |
Yeah good point - I guess the checks have to be applied in a few places (action creation, action update, listing action types) and not just execution.
Upgrade and start-trial scenarios don't work if we enforce at both startup/registration time & execution-time. You would upgrade your license, but not have access to any of the new actions until a restart? Downgrade and end-trial scenarios should would work OK though. |
Ya, seems like any kind of check we'd do at startup/registration would make the "live upgrade" scenario not work. The checks should be made for any activity that would mutate or execute an action. So that when a customer upgrades, the check will be made after that, and should work with the upgraded privileges. If you don't have the "sufficient privileges" seems like you should only be allowed to read/delete actions. If you end up getting downgrade privileges (trial expires), you shouldn't be able to create, update, or execute an action, but I think it makes sense for a customer to see them and probably delete them. They certainly shouldn't be deleted automagically or anything, in case the customer goes from trial -> trial expired -> buys a gold license; they'd just have some "action down time" from when the trial expired to buying a license. |
I've put some thought into this and wrote up a summary below of what we should confirm before implementing this. Looking forward to everyone's thoughts!
Feel free to ask for any clarifications on the points above. cc @elastic/kibana-alerting-services @peterschretlen @bmcconaghy |
You mean after the built-ins have been registered? Presumably server-log and index are basic, so should NOT be registered as gold. So 3rd party action types are always gold? Would we ever have plugins that want to register Basic actions? Guessing the answer is no, or we would move those into the the actions plugin, as they are presumably fairly simple. We'll need to doc this behavior, could be confusing for plugin authors writing their own actions. |
Things like "GET /api/action/{id} should return not found error" don't feel right at all. We already maintain a list of "disabled" actionTypes, via config, and that state is returned in the actionsClient and HTTP "list" functions. I believe it has some of the same constraints that we need here - if you had an action whose actionType is later disabled, it of course won't run it, but is it an error, or not found, or ??? We probably want the same thing if the action can't be used because of the license. Here's the config: kibana/x-pack/plugins/actions/server/config.ts Lines 18 to 22 in 77fe83e
We've already added checks for config-based disablement, here, which is used in presumably the same places we'd be making license checks: kibana/x-pack/plugins/actions/server/actions_config.ts Lines 74 to 82 in 7e08763
It seems like we could extend the notion of "disabled" here to include the license check as well, enable the appropriate error to be logged if it's disabled (via config, or via license). We'd probably want the list types function to return separate boolean values for disabled via config and disabled via license. Logging license issues would be good, but one of those things that we probably just want to log once per Kibana process, per actionType we find someone trying to use, that has license issues. |
I totally forgot about those! I see nothing wrong piggy backing on this feature. |
For APIs, rather than returning
I don't think there's any harm in being able to fetch this data? I think it would be strange to have a unauthorized connector still exist yet its details are inaccessible.
I think we should let API clients filter the list, and not filter it ourselves. Or we provide a flag to the API to include unauthorized actions. In the UI I think whether we show them or not will depend on the context
|
Thanks for the feedback @pmuellr and @peterschretlen. This all makes sense to me and will use it as a starting point 👍 |
We anticipate making a wider variety of action types available ( see #45023 ) which may be available at different license levels.
In addition, 3rd parties can create and register custom actions, and the ability to register custom actions should also be subject to a license check. This implies:
The text was updated successfully, but these errors were encountered: