Skip to content

[8.3] Ensure CreateApiKey always creates a new document (#88413) #88415

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

Merged
merged 2 commits into from
Jul 11, 2022

Conversation

ywangd
Copy link
Member

@ywangd ywangd commented Jul 11, 2022

Backports the following commits to 8.3:

The OpType of the indexRequest used for creating new API keys does not
have its OpType configured. This means it defaults to OpType.INDEX which
allows it to replace an existing document. This PR fixes it by explicity
set OpType to CREATE so that it always create a new document (or throw
error if ID conflict does happen).

Since API key ID is time-based random base64 UUID, it is unlikely for
this to happen in practice and we are not aware of any related bug
report.
@ywangd ywangd added :Security/Security Security issues without another label >bug auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Security Meta label for security team labels Jul 11, 2022
@elasticmachine
Copy link
Collaborator

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

@elasticsearchmachine elasticsearchmachine merged commit c9e66aa into elastic:8.3 Jul 11, 2022
@ywangd ywangd deleted the backport/8.3/pr-88413 branch July 11, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Security/Security Security issues without another label Team:Security Meta label for security team v8.3.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants