-
Notifications
You must be signed in to change notification settings - Fork 24.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
Add kerberos grant_type to get token in exchange for Kerberos ticket #42847
Conversation
Kibana wants to create access_token/refresh_token pair using Token management APIs in exchange for kerberos tickets. `client_credentials` grant_type requires every user to have `cluster:admin/xpack/security/token/create` cluster privilege. This commit introduces `kerberos` grant_type for generating `access_token` and `refresh_token` in exchange for a valid base64 encoded kerberos ticket. In addition, `kibana_user` role now has cluster privilege to create tokens. This allows Kibana to create access_token/refresh_token pair in exchange for kerberos tickets. Note: The lifetime from the kerberos ticket is not used in ES and so even after it expires the access_token/refresh_token pair will be valid. Care must be taken to invalidate such tokens using token management APIs if required. TODO: - The `KerberosAuthenticationIT` requires krb5-kdc fixture to be enabled, currently it is disabled. This will be fixed in another commit. - Documentation
Pinging @elastic/es-security |
I don't think this is necessary. The call to the API will be made by the |
...ore/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequest.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequest.java
Outdated
Show resolved
Hide resolved
…security/action/token/CreateTokenRequest.java Co-Authored-By: Tim Vernum <tim@adjective.org>
…h into kerberos-grant-type
.../src/main/java/org/elasticsearch/xpack/security/action/token/TransportCreateTokenAction.java
Show resolved
Hide resolved
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.
Looks good Yogesh ! Just a few comments/suggestions, and I'll take a final look on Monday morning
...ore/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequest.java
Outdated
Show resolved
Hide resolved
...ore/src/main/java/org/elasticsearch/xpack/core/security/action/token/CreateTokenRequest.java
Outdated
Show resolved
Hide resolved
...a/org/elasticsearch/xpack/security/authc/kerberos/SpnegoHttpClientConfigCallbackHandler.java
Show resolved
Hide resolved
.../src/main/java/org/elasticsearch/xpack/security/action/token/TransportCreateTokenAction.java
Show resolved
Hide resolved
...ty/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java
Outdated
Show resolved
Hide resolved
...ty/src/main/java/org/elasticsearch/xpack/security/rest/action/oauth2/RestGetTokenAction.java
Outdated
Show resolved
Hide resolved
Hi @jkakavas, I have addressed your review comments, please take another look when you get some time. Thank you. |
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.
LGTM
…lastic#42847) Kibana wants to create access_token/refresh_token pair using Token management APIs in exchange for kerberos tickets. `client_credentials` grant_type requires every user to have `cluster:admin/xpack/security/token/create` cluster privilege. This commit introduces `_kerberos` grant_type for generating `access_token` and `refresh_token` in exchange for a valid base64 encoded kerberos ticket. In addition, `kibana_user` role now has cluster privilege to create tokens. This allows Kibana to create access_token/refresh_token pair in exchange for kerberos tickets. Note: The lifetime from the kerberos ticket is not used in ES and so even after it expires the access_token/refresh_token pair will be valid. Care must be taken to invalidate such tokens using token management APIs if required. Closes elastic#41943
…42847) (#43355) Kibana wants to create access_token/refresh_token pair using Token management APIs in exchange for kerberos tickets. `client_credentials` grant_type requires every user to have `cluster:admin/xpack/security/token/create` cluster privilege. This commit introduces `_kerberos` grant_type for generating `access_token` and `refresh_token` in exchange for a valid base64 encoded kerberos ticket. In addition, `kibana_user` role now has cluster privilege to create tokens. This allows Kibana to create access_token/refresh_token pair in exchange for kerberos tickets. Note: The lifetime from the kerberos ticket is not used in ES and so even after it expires the access_token/refresh_token pair will be valid. Care must be taken to invalidate such tokens using token management APIs if required. Closes #41943
Kibana wants to create access_token/refresh_token pair using Token
management APIs in exchange for Kerberos tickets.
client_credentials
grant_type requires every user to have
cluster:admin/xpack/security/token/create
cluster privilege.
This commit introduces
_kerberos
grant_type for generatingaccess_token
and
refresh_token
in exchange for a valid base64 encoded Kerberos ticket.This allows the Kibana system user to create access_token/refresh_token pair in exchange for
kerberos tickets.
Note:
The lifetime from the kerberos ticket is not used in ES and so even after it expires
the access_token/refresh_token pair will be valid. Care must be taken to invalidate
such tokens using token management APIs if required.
Closes #41943