-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[Enterprise Search] Add .connector-secrets system index #104766
Merged
navarone-feekery
merged 26 commits into
elastic:main
from
navarone-feekery:connector-secrets-2
Jan 26, 2024
Merged
[Enterprise Search] Add .connector-secrets system index #104766
navarone-feekery
merged 26 commits into
elastic:main
from
navarone-feekery:connector-secrets-2
Jan 26, 2024
+1,501
−5
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
navarone-feekery
added
>non-issue
:EnterpriseSearch/Application
Enterprise Search
Team:Enterprise Search
Meta label for Enterprise Search team
v8.13.0
labels
Jan 25, 2024
Documentation preview: |
Pinging @elastic/ent-search-eng (Team:Enterprise Search) |
navarone-feekery
force-pushed
the
connector-secrets-2
branch
from
January 26, 2024 09:15
74f5233
to
7a80b8f
Compare
jedrazb
approved these changes
Jan 26, 2024
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 🚀
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
:EnterpriseSearch/Application
Enterprise Search
>non-issue
Team:Enterprise Search
Meta label for Enterprise Search team
v8.13.0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
These changes were already approved and merged in this PR.
However, they ended up blocking CI by introducing merge conflicts that weren't picked up by github. The change was reverted here.
This PR is a cherry-pick of the previous PR's commits, with an extra final commit added to address the merge conflict here.
Original PR Content:
The Search team is currently implementing BYOI (Bring Your Own Index) for Connectors. This feature will allow users to create search indices for Connectors without having
search-
prefix the index name.Native Connectors are run using the Enterprise Search system account, which has access to search indices because it can access all indices that follow the pattern
search-*
. To continue allowing Native Connectors to function after removing the prefix requirement, we need to switch to using API keys to manage index access. That brings us to this PR.The goal of this PR is to have a place where Native Connectors can store API keys (secrets storage). A connector secret can be stored from either Kibana or the Connectors CLI. Kibana would only have write access to this index so it cannot expose secrets in the UI. Enterprise Search (which runs the Connectors CLI on cloud) will have both read and write access.
These changes follow the implementation design of Fleet's secrets storage (example PR). The implementation is largely identical, with a change in namespace.
Changes
.connector-secrets
. This will be used to store the API keys that Native Connectors will use..connector-secrets
.connector-secrets
Not included
How to test this PR
The API endpoints can be tested in Kibana Dev Tools:
Run ES from source with
./gradlew run
.Once ES is running, change the default password for the elastic user from "password" to "changeme" to match Kibana's:
Run Kibana with
yarn start
.Log into Kibana and go to
/app/dev_tools#/console
.Create a secret:
This should succeed and return the id of the created secret doc, e.g.:
Copy the id and try to get the secret:
This should succeed and return the secret id and value:
Try to get a different secret using a random value. It should fail with 404 and return an error.