-
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
Use exception metadata to determine if APIKeys are enabled #59576
Comments
Pinging @elastic/kibana-security (Team:Security) |
Blocks #49403, specifically the ask to expose a public method for consumers to check |
It's also blocking us on fleet #54611 |
We have two requirements commingled in this issue:
The former is easily solved, but the latter poses additional challenges.
There are complications with both of these options: The |
@legrego I indeed think creating a dummy API key with a short lifetime is the most robust way to check if API Keys are enabled. It simply unequivocally validates that API keys work. My only concern is that this records a spurious audit event. Yet I'm not too concerned about it, because we're not in a position where we account, in any way, for all the API keys that the system users create. Here's an example of a dummy API key:
Another slightly related option is to try to invalidate a non existing API key. If API keys are not enabled, it will fail differently compared to when the API key does not exist. I think it's very unlikely we'll ever return a "missing API key" error code, when in fact API keys are not enabled. However, we can also go with the alternative of parsing the output of the I don't have a strong preference either way, just personal taste. |
Now that elastic/elasticsearch#52811 has been merged, we can now use the exception metadata to determine whether or not API Keys are enabled/disabled. This is presently being done by inspecting the exception message:
kibana/x-pack/plugins/security/server/routes/api_keys/privileges.ts
Line 35 in 2ec82d3
Fleet would like to be able to do so as well, so if we can publicly expose a method to do so, that'd help @nchaulet.
The text was updated successfully, but these errors were encountered: