Skip to content
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

Wrong format of API key role descriptors used for node requests after cluster upgrade #62911

Closed
ywangd opened this issue Sep 25, 2020 · 3 comments · Fixed by #62917
Closed

Wrong format of API key role descriptors used for node requests after cluster upgrade #62911

ywangd opened this issue Sep 25, 2020 · 3 comments · Fixed by #62917
Assignees
Labels
>bug :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team

Comments

@ywangd
Copy link
Member

ywangd commented Sep 25, 2020

An effeciency optimisation for API Key role descriptors were introduced in #58156. The optimisation introdueced a new storage format for role descriptors in metadata of the authentication object. BWC was added in the PR. However it is not sufficient to cover the following scenario:

  1. In v7.8, a task is created using API key which is serialised as part of the authentication header
  2. The cluster is upgraded to v7.9
  3. An upgraded node tries to run the task created in step 1, which in turn deserialises the authentication object. The task then needs to send requests using NodeClient, which serialises the authentication object again.
  4. When the target node is also v7.9, the authentication header is sent without rewriting the API key role descriptors in the new storage format. However, the authetication object is declared to be v7.9.
  5. When the target node recieves the request, it sees the authentication object is of format v7.9. Hence it tries to process the role descriptors in the new format way and fails because they are still in the old format of v7.8.
@ywangd ywangd added >bug :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC labels Sep 25, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-security (:Security/Authorization)

@albertzaharovits
Copy link
Contributor

@ywangd
Can you please explain how this is possible in point 4 above?

However, the authetication object is declared to be v7.9.

@albertzaharovits
Copy link
Contributor

I now get it, after I looked at the fix. It's a problem when we rewrite authentication to make it sure it is decodable by the remote node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Security Meta label for security team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants