-
Notifications
You must be signed in to change notification settings - Fork 276
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
[Question] What capabilities should a token that is passed to an extension have? Should it be a JWT? #2545
Comments
Token Based Authentication for ExtensionsProblemThe plugins can interact opensearch as the user. However, extensions do not have this capability. Extensions need a way to perform actions as the users. For achieving this, the extensions require token to make a request against opensearch cluster as the user. List capabilities/required - How is that token used?
Pro/ConsOption 1: JWT One of the most common solutions used for representing claims that are to be transferred between two parties. JWT consists of three parts separated by dots: a header, a payload, and a signature. Payload contains the actual claims being transferred. The signature is used to verify the integrity of the token. Pros:
Cons:
Option 2: JWE JWE is commonly used for encrypting a payload so that it can be securely transmitted between two parties. JWE Consists of five parts separated by dots: a header, a payload, a ciphertext, an initialization vector (IV), authentication tag, and optionally an encrypted key. The header contains information about the encrypted data. The IV is used to randomize the encryption and the authentication tag is used to verify the integrity of the data. Pros:
Cons:
AppendixSteps we need if we choose Option1:
What need to be carried in the payload? Since the purpose of this token is to make extension act like a user, no matter which option we choose, the payload should carry the user informations. According to the above comparison between JWT and JWE, the biggest difference is coming from the processing of sensitive information. Therefore, it is necessary for us to reach a consensus on what user informations is sensitive (backend roles, etc.). Nested JWT JWE allows you to encrypt any arbitrary payload; however, a common use case is for the payload to be another JWT. This is known as a Nested JWT. Here is the documentation of JWT Framework: https://web-token.spomky-labs.com/advanced-topics-1/nested-tokens Steps to encrypt the payload of a JWT:
|
Moving forward starting with a JWT tokens, having clients treat them as opaque strings. Then we can transition to JWE without blocking the authentication workflow. Note; I would like for the security plugin to quickly migrate to JWE so we are enforcing opaque nature of the tokens. @opensearch-project/security Does anyone have other thoughts or should we consider this closed? |
Summary of the SolutionThe security team has opted to employ a just-in-time (JIT) token for managing authentication requests between the user's client and the extension. This token's payload claims must encompass all standard JWT token configurations while incorporating encrypted Closing this issue now. For the further discussion of authentication backend and extension's security configuration, more discussions can be found here: #2619, #2616 |
This issue should be used for detailing the options for the tokens that will be passed to extensions. This issue should have a comparison of the options and justifications for a decision.
The text was updated successfully, but these errors were encountered: