[Question] Should authz information be provided in a(n) [encrypted] claim inside the access token given to extensions #2621
Labels
enhancement
New feature or request
untriaged
Require the attention of the repository maintainers and may need to be prioritized
In order for extensions to interact with the OpenSearch cluster on-behalf-of a user, the extension will be provided an access token that is issued just-in-time to perform its operations. There is currently an ongoing debate on what is contained in the claims of the JWT and so far the following claims will be included with certainty:
the dispute needed to be resolved is if authz information needs to be included in the claims as well:
Reasons the authz (
roles
andbackend_roles
) should be included are:roles
andbackend_roles
to perform roles injection and protect resources created by the plugin respectivelyProposal 1: Include roles and backend_roles in the claims of the JWT
For this approach these claims would be encrypted by default, but on the extension level could be configured in
bwc_plugin_compatibility_mode
for extensions that rely onbackend_roles
. An off-ramp to cut plugin/extension's reliance onbackend_roles
is being discussed [Provide link to issue here]. In bwc mode, the claims would be unencrypted.In this model, there is no lookup required when the security plugin receives this access token from an extension. On receipt of the access token, the security plugin will verify the signature of the JWT and decrypt the
r
(r
short forroles
) andbr
(br
short forbackend_roles
) claims. From there it will proceed to authorization as normal.It is not clear how to do roles lookup if the
roles
andbackend_roles
are not included in the token. If these claims are not present and the user is not an internal user, then it would require keeping track of sessions or reaching out to the external identity provider that first authenticated the user.Proposal 2: Exclude roles and backend_roles from the claims of the JWTIn this approach, roles and backend_roles could be provided to extensions through the transport layer through another means (inbwc
mode), but it will be explicitly deprecated and convey to extensions developers to cut their reliance on these or risk compilation failures when support is officially removed.The challenge in this approach is how to lookup the authz information when the access token is received by OpenSearch.Additional Background Info
roles
andbackend_roles
are considered sensitive information and will be kept internal to OpenSearch.Its not unheard of that some JWTs already issued for OSD are over 4kb.
The text was updated successfully, but these errors were encountered: